Changeset 5728 for anuga_work/development/anuga_1d/test_shallow_water.py
- Timestamp:
- Sep 4, 2008, 7:12:44 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_work/development/anuga_1d/test_shallow_water.py
r5727 r5728 5 5 6 6 7 from shallow_water_domain import *8 from shallow_water_domain import flux_function as domain_flux_function9 10 from Numeric import allclose, array, ones, Float 7 from shallow_water_domain_new import * 8 from shallow_water_domain_new import flux_function as domain_flux_function 9 10 from Numeric import allclose, array, ones, Float, maximum 11 11 12 12 … … 15 15 self.points = [0.0, 1.0, 2.0, 3.0] 16 16 self.vertex_values = [[1.0,2.0],[4.0,5.0],[-1.0,2.0]] 17 self.points2 = [0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0] 17 18 18 19 def tearDown(self): … … 123 124 """ 124 125 125 def slope_ one(x):126 return x126 def slope_square(x): 127 return maximum(4.0-(x-5.0)*(x-5.0), 0.0) 127 128 128 domain = Domain(self.points )129 domain.set_quantity('stage', 4.0)130 domain.set_quantity('elevation',slope_ one)129 domain = Domain(self.points2) 130 domain.set_quantity('stage',10.0) 131 domain.set_quantity('elevation',slope_square) 131 132 domain.set_boundary({'exterior' : Reflective_boundary(domain)}) 132 133 133 yieldstep= 0.01134 finaltime= 0.01134 yieldstep=10.0 135 finaltime=10.0 135 136 136 137 for t in domain.evolve(yieldstep=yieldstep, finaltime=finaltime): … … 146 147 print domain.quantities['xmomentum'].centroid_values 147 148 148 assert allclose( array([-34.3, -24.5, -14.7], Float), domain.quantities['xmomentum'].explicit_update )149 #assert allclose( array([-34.3, -24.5, -14.7], Float), domain.quantities['xmomentum'].explicit_update ) 149 150 150 151
Note: See TracChangeset
for help on using the changeset viewer.