Changeset 5538 for anuga_work/development/anuga_1d
- Timestamp:
- Jul 19, 2008, 8:40:31 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_work/development/anuga_1d/test_shallow_water.py
r5536 r5538 11 11 class Test_Shallow_Water(unittest.TestCase): 12 12 def setUp(self): 13 self.points 1= [0.0, 1.0, 2.0, 3.0]13 self.points = [0.0, 1.0, 2.0, 3.0] 14 14 self.vertex_values = [[1.0,2.0],[4.0,5.0],[-1.0,2.0]] 15 16 17 pass18 15 19 16 def tearDown(self): … … 23 20 24 21 def test_creation(self): 25 26 27 D1 = Domain(self.points1) 28 29 assert allclose(D1.centroids, [0.5, 1.5, 2.5]) 30 22 domain = Domain(self.points) 23 assert allclose(domain.centroids, [0.5, 1.5, 2.5]) 31 24 32 25 def test_compute_fluxes(self): 26 """ 27 Compare shallow_water_domain flux calculation against a previous 28 Python implementation (defined in this file) 29 """ 30 domain = Domain(self.points) 31 domain.set_quantity('stage',2.0) 32 domain.set_boundary({'exterior' : Reflective_boundary(domain)}) 33 34 stage_ud, xmom_ud = compute_fluxes_python(domain) 33 35 36 domain.compute_fluxes() 34 37 35 D1 = Domain(self.points1) 36 D1.set_quantity('stage',2.0) 37 D1.set_boundary({'exterior' : Reflective_boundary(D1)}) 38 #print doamin.quantities['xmomentum'].explicit_update 39 #print compute_fluxes_python(domain) 38 40 39 stage_ud, xmom_ud = compute_fluxes_python(D1) 40 41 D1.compute_fluxes() 42 43 #print D1.quantities['xmomentum'].explicit_update 44 #print compute_fluxes_python(D1) 45 46 assert allclose( D1.quantities['stage'].explicit_update, stage_ud ) 47 assert allclose( D1.quantities['xmomentum'].explicit_update, xmom_ud ) 41 assert allclose( domain.quantities['stage'].explicit_update, stage_ud ) 42 assert allclose( domain.quantities['xmomentum'].explicit_update, xmom_ud ) 48 43 49 44
Note: See TracChangeset
for help on using the changeset viewer.