Changeset 4589
- Timestamp:
- Jul 4, 2007, 6:33:05 PM (18 years ago)
- Location:
- anuga_core/source/anuga/fit_interpolate
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/source/anuga/fit_interpolate/fit.py
r4576 r4589 272 272 if verbose: print 'Building fitting matrix from %d points' %n 273 273 #Compute matrix elements for points inside the mesh 274 for k, i in enumerate(inside_poly_indices):274 for d, i in enumerate(inside_poly_indices): 275 275 #For each data_coordinate point 276 if verbose and k%((n+10)/10)==0: print 'Doing %d of %d' %(k, n)276 if verbose and d%((n+10)/10)==0: print 'Doing %d of %d' %(d, n) 277 277 x = point_coordinates[i] 278 278 element_found, sigma0, sigma1, sigma2, k = \ -
anuga_core/source/anuga/fit_interpolate/general_fit_interpolate.py
r3850 r4589 26 26 from anuga.caching.caching import cache 27 27 from anuga.abstract_2d_finite_volumes.neighbour_mesh import Mesh 28 28 29 from anuga.utilities.sparse import Sparse, Sparse_CSR 29 30 from anuga.utilities.cg_solve import conjugate_gradient, VectorShapeError 30 from anuga.coordinate_transforms.geo_reference import Geo_reference31 from anuga.utilities.quad import build_quadtree32 31 from anuga.utilities.numerical_tools import ensure_numeric 33 32 from anuga.utilities.polygon import in_and_outside_polygon 33 from anuga.utilities.quad import build_quadtree 34 35 from anuga.coordinate_transforms.geo_reference import Geo_reference 34 36 from anuga.geospatial_data.geospatial_data import Geospatial_data, \ 35 37 ensure_absolute 36 from search_functions import search_tree_of_vertices37 38 38 39 39 -
anuga_core/source/anuga/fit_interpolate/interpolate.py
r4588 r4589 32 32 from anuga.utilities.cg_solve import conjugate_gradient, VectorShapeError 33 33 from anuga.coordinate_transforms.geo_reference import Geo_reference 34 from anuga.utilities.quad import build_quadtree35 34 from anuga.utilities.numerical_tools import ensure_numeric, mean, NAN 36 35 from anuga.utilities.polygon import in_and_outside_polygon … … 255 254 #print "self.outside_poly_indices",self.outside_poly_indices 256 255 #Build n x m interpolation matrix 257 if verbose and len(self.outside_poly_indices) > 0:256 if verbose and len(self.outside_poly_indices) > 0: 258 257 print '\n WARNING: Points outside mesh boundary. \n' 259 258 # Since you can block, throw a warning, not an error. … … 271 270 n = len(self.inside_poly_indices) 272 271 #Compute matrix elements for points inside the mesh 273 if verbose: print 'Building interpolation matrix fr am %d points' %n274 for k, i in enumerate(self.inside_poly_indices):275 # For each data_coordinate point276 if verbose and k%((n+10)/10)==0: print 'Doing %d of %d' %(k, n)272 if verbose: print 'Building interpolation matrix from %d points' %n 273 for d, i in enumerate(self.inside_poly_indices): 274 # For each data_coordinate point 275 if verbose and d%((n+10)/10)==0: print 'Doing %d of %d' %(d, n) 277 276 x = point_coordinates[i] 278 277 element_found, sigma0, sigma1, sigma2, k = \ 279 278 search_tree_of_vertices(self.root, self.mesh, x) 280 #Update interpolation matrix A if necessary 279 280 # Update interpolation matrix A if necessary 281 281 if element_found is True: 282 # Assign values to matrix A283 284 j0 = self.mesh.triangles[k,0] # Global vertex id for sigma0285 j1 = self.mesh.triangles[k,1] # Global vertex id for sigma1286 j2 = self.mesh.triangles[k,2] # Global vertex id for sigma2282 # Assign values to matrix A 283 284 j0 = self.mesh.triangles[k,0] # Global vertex id for sigma0 285 j1 = self.mesh.triangles[k,1] # Global vertex id for sigma1 286 j2 = self.mesh.triangles[k,2] # Global vertex id for sigma2 287 287 288 288 sigmas = {j0:sigma0, j1:sigma1, j2:sigma2}
Note: See TracChangeset
for help on using the changeset viewer.