Changeset 1941
 Timestamp:
 Oct 17, 2005, 11:25:38 AM (18 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

inundation/pyvolution/least_squares.py
r1933 r1941 23 23 #from general_mesh import General_mesh 24 24 from Numeric import zeros, array, Float, Int, dot, transpose, concatenate, ArrayType 25 from mesh import Mesh25 from pyvolution.mesh import Mesh 26 26 27 27 from Numeric import zeros, take, array, Float, Int, dot, transpose, concatenate, ArrayType 28 from sparse import Sparse, Sparse_CSR29 from cg_solve import conjugate_gradient, VectorShapeError28 from pyvolution.sparse import Sparse, Sparse_CSR 29 from pyvolution.cg_solve import conjugate_gradient, VectorShapeError 30 30 31 31 from coordinate_transforms.geo_reference import Geo_reference … … 314 314 315 315 """ 316 from util import ensure_numeric316 from pyvolution.util import ensure_numeric 317 317 318 318 #Convert input to Numeric arrays … … 433 433 #Maybe we need some sort of blocking 434 434 435 from quad import build_quadtree435 from pyvolution.quad import build_quadtree 436 436 from utilities.numerical_tools import ensure_numeric 437 437 from utilities.polygon import inside_polygon … … 531 531 root = build_quadtree(self.mesh, 532 532 max_points_per_cell = max_points_per_cell) 533 533 #root.show() 534 self.expanded_quad_searches = [] 534 535 #Compute matrix elements 535 536 for i in range(n): … … 545 546 element_found, sigma0, sigma1, sigma2, k = \ 546 547 self.search_triangles_of_vertices(candidate_vertices, x) 548 first_expansion = True 547 549 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 549 559 candidate_vertices, branch = root.expand_search() 550 560 if branch == []: … … 558 568 self.search_triangles_of_vertices(candidate_vertices, x) 559 569 560 570 561 571 #Update interpolation matrix A if necessary 562 572 if element_found is True: … … 592 602 sigma1 = 10.0 593 603 k = 10.0 594 604 #print "*$* candidate_vertices", candidate_vertices 595 605 #For all vertices in same cell as point x 596 606 for v in candidate_vertices: … … 827 837 828 838 #Convert input to Numeric arrays 829 from util import ensure_numeric839 from pyvolution.util import ensure_numeric 830 840 z = ensure_numeric(z, Float) 831 841 … … 928 938 The arrays must either have dimensions pxm or mx1. 929 939 The resulting function will be time dependent in 930 the former case while it will be constan twith940 the former case while it will be constan with 931 941 respect to time in the latter case. 932 942 … … 950 960 """ 951 961 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 956 963 957 964 def __init__(self,
Note: See TracChangeset
for help on using the changeset viewer.