Changeset 1941


Ignore:
Timestamp:
Oct 17, 2005, 11:25:38 AM (19 years ago)
Author:
duncan
Message:

adding diagnostic info

File:
1 edited

Legend:

Unmodified
Added
Removed
  • inundation/pyvolution/least_squares.py

    r1933 r1941  
    2323#from general_mesh import General_mesh
    2424from Numeric import zeros, array, Float, Int, dot, transpose, concatenate, ArrayType
    25 from mesh import Mesh
     25from pyvolution.mesh import Mesh
    2626
    2727from Numeric import zeros, take, array, Float, Int, dot, transpose, concatenate, ArrayType
    28 from sparse import Sparse, Sparse_CSR
    29 from cg_solve import conjugate_gradient, VectorShapeError
     28from pyvolution.sparse import Sparse, Sparse_CSR
     29from pyvolution.cg_solve import conjugate_gradient, VectorShapeError
    3030
    3131from coordinate_transforms.geo_reference import Geo_reference
     
    314314
    315315        """
    316         from util import ensure_numeric
     316        from pyvolution.util import ensure_numeric
    317317
    318318        #Convert input to Numeric arrays
     
    433433        #Maybe we need some sort of blocking
    434434
    435         from quad import build_quadtree
     435        from pyvolution.quad import build_quadtree
    436436        from utilities.numerical_tools import ensure_numeric
    437437        from utilities.polygon import inside_polygon
     
    531531        root = build_quadtree(self.mesh,
    532532                              max_points_per_cell = max_points_per_cell)
    533 
     533        #root.show()
     534        self.expanded_quad_searches = []
    534535        #Compute matrix elements
    535536        for i in range(n):
     
    545546            element_found, sigma0, sigma1, sigma2, k = \
    546547                self.search_triangles_of_vertices(candidate_vertices, x)
     548            first_expansion = True
    547549            while not element_found and is_more_elements and expand_search:
    548                 #if verbose: print 'Expanding search'
     550                if verbose: print 'Expanding search'
     551                if first_expansion = True:
     552                    expanded_quad_searches.append(1)
     553                else:
     554                    end = len(expanded_quad_searches) - 1
     555                    assert end >= 0
     556                    expanded_quad_searches[end] += 1
     557                    print "expanded_quad_searches",expanded_quad_searches
     558                self.expanded_quad_searches += 1
    549559                candidate_vertices, branch = root.expand_search()
    550560                if branch == []:
     
    558568                      self.search_triangles_of_vertices(candidate_vertices, x)
    559569
    560 
     570               
    561571            #Update interpolation matrix A if necessary
    562572            if element_found is True:
     
    592602            sigma1 = -10.0
    593603            k = -10.0
    594 
     604            #print "*$* candidate_vertices", candidate_vertices
    595605            #For all vertices in same cell as point x
    596606            for v in candidate_vertices:
     
    827837
    828838        #Convert input to Numeric arrays
    829         from util import ensure_numeric
     839        from pyvolution.util import ensure_numeric
    830840        z = ensure_numeric(z, Float)
    831841
     
    928938                            The arrays must either have dimensions pxm or mx1.
    929939                            The resulting function will be time dependent in
    930                             the former case while it will be constant with
     940                            the former case while it will be constan with
    931941                            respect to time in the latter case.
    932942       
     
    950960    """
    951961
    952 
    953     #FIXME: Pending use case, Implement arbitrary expressions as with
    954     #set_quantity and sww2dem using the underlying functionality for
    955     #doing that.
     962   
    956963   
    957964    def __init__(self,
Note: See TracChangeset for help on using the changeset viewer.