Changeset 611
- Timestamp:
- Nov 22, 2004, 4:50:04 PM (20 years ago)
- Location:
- inundation/ga/storm_surge/pyvolution
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
inundation/ga/storm_surge/pyvolution/least_squares.py
r608 r611 185 185 self.build_coefficient_matrix_B(point_coordinates) 186 186 187 187 def set_point_coordinates(self, point_coordinates): 188 """ 189 A public interface to setting the point co-ordinates. 190 """ 191 self.build_coefficient_matrix_B(point_coordinates) 188 192 189 193 def build_coefficient_matrix_B(self, point_coordinates=None): … … 239 243 #Find vertices near x 240 244 candidate_vertices = root.search(x[0], x[1]) 241 242 element_found, sigma0, sigma1, sigma2, k = \243 self.search_triangles_of_vertices(candidate_vertices, x)244 245 245 246 is_more_elements = True 247 if candidate_vertices == []: 248 # The point isn't even within the root cell! 249 is_more_elements = False 250 element_found = False 251 else: 252 element_found, sigma0, sigma1, sigma2, k = \ 253 self.search_triangles_of_vertices(candidate_vertices, x) 254 246 255 while not element_found and is_more_elements: 247 256 candidate_vertices = root.expand_search() -
inundation/ga/storm_surge/pyvolution/quad.py
r608 r611 81 81 for child in self: 82 82 if child.contains(x,y): 83 branch.append(self) 83 brothers = list(self.children) 84 brothers.remove(child) 85 branch.append(brothers) 84 86 points, branch = child.search_branch(x,y, branch) 85 87 else: … … 98 100 for child in self: 99 101 if child.contains(x,y): 100 branch.append(self) 102 brothers = list(self.children) 103 brothers.remove(child) 104 branch.append(brothers) 101 105 points, branch = child.search_branch(x,y, branch) 102 106 … … 114 118 points = [] 115 119 else: 116 larger_cell = self.branch.pop() 117 #print "larger_cell ", larger_cell.show() # Get_tree() 118 for child in larger_cell: 119 #This means it will also go down the branch known to be bad. 120 #So, if things are too slow, this could be speed up 121 points += child.retrieve() 120 three_cells = self.branch.pop() 121 for cell in three_cells: 122 #print "cell ", cell.show() 123 points += cell.retrieve() 122 124 return points 123 125 -
inundation/ga/storm_surge/pyvolution/test_least_squares.py
r608 r611 69 69 answer = [ [ 0.06666667, 0.46666667, 0.46666667, 0., 70 70 0., 0. , 0., 0., 0., 0.]] 71 assert allclose(interp.get_A(), answer) 71 assert allclose(interp.get_A(), answer) 72 interp.set_point_coordinates([[-30, -30]]) #point outside of mesh 73 #print "PDSG - interp.get_A()", interp.get_A() 74 answer = [ [ 0.0, 0.0, 0.0, 0., 75 0., 0. , 0., 0., 0., 0.]] 76 assert allclose(interp.get_A(), answer) 77 78 79 #point outside of quad tree root cell 80 interp.set_point_coordinates([[-70, -70]]) 81 #print "PDSG - interp.get_A()", interp.get_A() 82 answer = [ [ 0.0, 0.0, 0.0, 0., 83 0., 0. , 0., 0., 0., 0.]] 84 assert allclose(interp.get_A(), answer) 72 85 73 86
Note: See TracChangeset
for help on using the changeset viewer.