Changeset 6689 for branches/numpy/anuga/fit_interpolate
- Timestamp:
- Apr 1, 2009, 3:19:07 PM (16 years ago)
- Location:
- branches/numpy/anuga/fit_interpolate
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/numpy/anuga/fit_interpolate/fit.py
r6553 r6689 260 260 # The memory damage has been done by now. 261 261 else: 262 AtA = self.AtA # Did this for speed, did ~nothing262 AtA = self.AtA # Did this for speed, did ~nothing 263 263 self.point_count += point_coordinates.shape[0] 264 264 … … 267 267 self.mesh_boundary_polygon, 268 268 closed=True, 269 verbose=False) # Too much output if True 270 269 verbose=False) # Suppress output 271 270 272 271 n = len(inside_indices) … … 283 282 284 283 if element_found is True: 285 j0 = triangles[k,0] # Global vertex id for sigma0286 j1 = triangles[k,1] # Global vertex id for sigma1287 j2 = triangles[k,2] # Global vertex id for sigma2284 j0 = triangles[k,0] # Global vertex id for sigma0 285 j1 = triangles[k,1] # Global vertex id for sigma1 286 j2 = triangles[k,2] # Global vertex id for sigma2 288 287 289 288 sigmas = {j0:sigma0, j1:sigma1, j2:sigma2} … … 304 303 self.mesh_boundary_polygon, 305 304 closed=True, 306 verbose=False) # Too much output if True305 verbose=False) # Suppress output 307 306 msg = 'Point (%f, %f) is not inside mesh boundary' % tuple(x) 308 307 assert flag is True, msg … … 318 317 raise RuntimeError, msg 319 318 320 self.AtA = AtA 319 320 self.AtA = AtA 321 321 322 322 -
branches/numpy/anuga/fit_interpolate/interpolate.py
r6553 r6689 835 835 raise msg 836 836 837 # Ensure 'mesh_boundary_polygon' is defined 838 mesh_boundary_polygon = None 839 837 840 if triangles is not None and vertex_coordinates is not None: 838 841 # Check that all interpolation points fall within … … 894 897 'requires the latter.') 895 898 896 # Plot boundary and interpolation points 897 if verbose is True: 899 # Plot boundary and interpolation points, 900 # but only if if 'mesh_boundary_polygon' has data. 901 if verbose is True and mesh_boundary_polygon is not None: 898 902 import sys 899 903 if sys.platform == 'win32': -
branches/numpy/anuga/fit_interpolate/test_interpolate.py
r6441 r6689 919 919 triangles = [[0,1,3], [1,0,2], [0,4,5], [0,5,2]] #abd bac aef afc 920 920 921 point_coords_absolute = [[-2.0, 2.0],922 [-1.0, 1.0],923 [ 0.0,2.0],924 [ 1.0,1.0],925 [ 2.0,1.0],926 [ 0.0,0.0],927 [ 1.0,0.0],928 [ 0.0, -1.0],921 point_coords_absolute = [[-2.0, 2.0], 922 [-1.0, 1.0], 923 [ 0.0, 2.0], 924 [ 1.0, 1.0], 925 [ 2.0, 1.0], 926 [ 0.0, 0.0], 927 [ 1.0, 0.0], 928 [ 0.0, -1.0], 929 929 [-0.2, -0.5], 930 930 [-0.9, -1.5], 931 [ 0.5, -1.9],932 [ 3.0,1.0]]931 [ 0.5, -1.9], 932 [ 3.0, 1.0]] 933 933 934 934 geo = Geo_reference(57, 100, 500) … … 967 967 968 968 969 point_coords = [[-2.0, 2.0],970 [-1.0, 1.0],971 [ 0.0,2.0],972 [ 1.0,1.0],973 [ 2.0,1.0],974 [ 0.0,0.0],975 [ 1.0,0.0],976 [ 0.0, -1.0],969 point_coords = [[-2.0, 2.0], 970 [-1.0, 1.0], 971 [ 0.0, 2.0], 972 [ 1.0, 1.0], 973 [ 2.0, 1.0], 974 [ 0.0, 0.0], 975 [ 1.0, 0.0], 976 [ 0.0, -1.0], 977 977 [-0.2, -0.5], 978 978 [-0.9, -1.5], 979 [ 0.5, -1.9],980 [ 3.0,1.0]]979 [ 0.5, -1.9], 980 [ 3.0, 1.0]] 981 981 982 982 interp = Interpolate(vertices, triangles) … … 1030 1030 1031 1031 1032 point_coords = [[-2.0, 2.0],1033 [-1.0, 1.0],1034 [ 0.0,2.0],1035 [ 1.0,1.0],1036 [ 2.0,1.0],1037 [ 0.0,0.0],1038 [ 1.0,0.0],1039 [ 0.0, -1.0],1032 point_coords = [[-2.0, 2.0], 1033 [-1.0, 1.0], 1034 [ 0.0, 2.0], 1035 [ 1.0, 1.0], 1036 [ 2.0, 1.0], 1037 [ 0.0, 0.0], 1038 [ 1.0, 0.0], 1039 [ 0.0, -1.0], 1040 1040 [-0.2, -0.5], 1041 1041 [-0.9, -1.5], 1042 [ 0.5, -1.9],1043 [ 3.0,1.0]]1042 [ 0.5, -1.9], 1043 [ 3.0, 1.0]] 1044 1044 1045 1045 interp = Interpolate(vertices, triangles) -
branches/numpy/anuga/fit_interpolate/test_search_functions.py
r6553 r6689 113 113 if k >= 0: 114 114 V = mesh.get_vertex_coordinates(k) # nodes for triangle k 115 assert is_inside_triangle(x, V, closed=True) 115 116 assert is_inside_polygon(x, V) 116 117 assert found is True
Note: See TracChangeset
for help on using the changeset viewer.