Changeset 486 for inundation/ga/storm_surge
- Timestamp:
- Nov 5, 2004, 3:35:13 PM (20 years ago)
- Location:
- inundation/ga/storm_surge/pyvolution
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
inundation/ga/storm_surge/pyvolution/mesh.py
r484 r486 432 432 # assert self.neighbours[id,edge] < 0 433 433 434 #FIXME: May get rid of 435 def rectangular_mesh(m, n, len1=1.0, len2=1.0, origin = (0.0, 0.0)): 436 from mesh_factory import rectangular 437 points, triangles, boundary = rectangular(m, n, len1, len2, origin) 438 439 return Mesh(points, triangles, boundary) 440 441 442 #FIXME: Get oblique and contracting and circular meshes from Chris 443 434 -
inundation/ga/storm_surge/pyvolution/mesh_factory.py
r317 r486 62 62 return points, elements, boundary 63 63 64 65 #FIXME: Get oblique and contracting and circular meshes from Chris 64 66 65 67 -
inundation/ga/storm_surge/pyvolution/test_domain.py
r469 r486 6 6 from domain import * 7 7 from config import epsilon 8 from Numeric import allclose, array 8 from Numeric import allclose, array, ones, Float 9 9 10 10 … … 266 266 domain.update_conserved_quantities() 267 267 268 269 #FIXME: Update this test once I understand the semi_implicit scheme 270 #x = array([1, 2, 3, 4]) + array( [.4,.3,.2,.1] ) 271 #x /= array( [.9,.9,.9,.9] ) 272 # 273 #for name in domain.conserved_quantities: 274 # assert allclose(domain.quantities[name].centroid_values, x) 268 sem = array([1.,1.,1.,1.])/array([1, 2, 3, 4]) 269 denom = ones(4, Float)-domain.timestep*sem 270 271 x = array([1, 2, 3, 4]) + array( [.4,.3,.2,.1] ) 272 x /= denom 273 274 for name in domain.conserved_quantities: 275 assert allclose(domain.quantities[name].centroid_values, x) 275 276 276 277 277 278 def testz_set_region(self): 278 """ Domain implements a default first order gradient limiter279 """Set quantities for sub region 279 280 """ 280 281 … … 326 327 domain.set_region([add_to_verts]) 327 328 328 self.failUnless( 329 self.failUnless(domain.test == "Mound", 329 330 'set region failed') 330 331 331 332 #------------------------------------------------------------- 332 333 if __name__ == "__main__": 333 suite = unittest.makeSuite(TestCase,'test z')334 suite = unittest.makeSuite(TestCase,'test') 334 335 runner = unittest.TextTestRunner() 335 336 runner.run(suite) -
inundation/ga/storm_surge/pyvolution/test_mesh.py
r334 r486 7 7 8 8 from mesh import * 9 from mesh_factory import rectangular 9 10 from config import epsilon 10 11 from Numeric import allclose, array … … 343 344 M=1 344 345 N=1 345 mesh = rectangular_mesh(M, N) 346 347 points, vertices, boundary = rectangular(M, N) 348 mesh = Mesh(points, vertices, boundary) 346 349 347 350 #Test that points are arranged in a counter clock wise order … … 350 353 M=2 351 354 N=2 352 mesh = rectangular_mesh(M, N) 353 355 points, vertices, boundary = rectangular(M, N) 356 mesh = Mesh(points, vertices, boundary) 357 354 358 #Test that points are arranged in a counter clock wise order 355 359 mesh.check_integrity() … … 363 367 364 368 365 mesh = rectangular_mesh(4, 4) 369 points, vertices, boundary = rectangular(4, 4) 370 mesh = Mesh(points, vertices, boundary) 371 366 372 367 373 #Test that points are arranged in a counter clock wise order … … 389 395 len1 = 100.0 390 396 len2 = 17.0 391 mesh = rectangular_mesh(M, N, len1, len2) 397 398 points, vertices, boundary = rectangular(M, N, len1, len2) 399 mesh = Mesh(points, vertices, boundary) 392 400 393 401 assert len(mesh) == 2*M*N … … 408 416 #Check that integers don't cause trouble 409 417 N = 16 410 mesh = rectangular_mesh(2*N, N, len1=10, len2=10) 418 419 points, vertices, boundary = rectangular(2*N, N, len1=10, len2=10) 420 mesh = Mesh(points, vertices, boundary) 421 411 422 412 423
Note: See TracChangeset
for help on using the changeset viewer.