Changeset 4589 for anuga_core/source/anuga/fit_interpolate/interpolate.py
- Timestamp:
- Jul 4, 2007, 6:33:05 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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.