Changeset 707 for inundation
- Timestamp:
- Dec 14, 2004, 2:18:21 PM (20 years ago)
- Location:
- inundation/ga/storm_surge/pyvolution
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
inundation/ga/storm_surge/pyvolution/quad.py
r705 r707 181 181 self.store(point) 182 182 else: 183 x = self.__class__.mesh.coordinates[point][0] 184 y = self.__class__.mesh.coordinates[point][1] 185 print "(" + str(x) + "," + str(y) + ")" 183 186 raise 'point not in region: %s' %str(point) 184 187 … … 397 400 ymax = max(mesh.coordinates[:,1]) 398 401 402 399 403 #Ensure boundary points are fully contained in region 400 404 #It is a property of the cell structure that points on xmax or ymax of any given cell … … 402 406 #Hence, the root cell needs to be expanded slightly 403 407 ymax += (ymax-ymin)/10 404 xmax += (xmax-xmin)/10 405 406 408 xmax += (xmax-xmin)/10 409 410 # To avoid round off error 411 ymin -= (ymax-ymin)/10 412 xmin -= (xmax-xmin)/10 413 414 #print "xmin", xmin 415 #print "xmax", xmax 416 #print "ymin", ymin 417 #print "ymax", ymax 418 407 419 #FIXME: Use mesh.filename if it exists 408 420 root = Cell(ymin, ymax, xmin, xmax, -
inundation/ga/storm_surge/pyvolution/test_quad.py
r705 r707 130 130 self.assertEqual(result, [0,1,2,3]) 131 131 132 133 def test_build_quadtreeII(self): 134 135 self.cell = Cell(100, 140, 0, 40, 'cell') 132 136 137 p0 = [34.6292076111,-7999.92529297] 138 p1 = [8000.0, 7999.0] 139 p2 = [-7999.96630859, 7999.0] 140 p3 = [34, 7999.97021484] 133 141 142 points = [p0,p1,p2, p3] 143 #bac, bce, ecf, dbe, daf, dae 144 vertices = [[0,1,2],[0,2,3]] 145 146 mesh = Mesh(points, vertices) 147 148 #This was causing round off error 149 Q = build_quadtree(mesh) 150 134 151 #------------------------------------------------------------- 135 152 if __name__ == "__main__":
Note: See TracChangeset
for help on using the changeset viewer.