Changeset 1393 for inundation/ga/storm_surge/pyvolution/test_quantity.py
- Timestamp:
- May 15, 2005, 10:25:56 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
inundation/ga/storm_surge/pyvolution/test_quantity.py
r1018 r1393 201 201 quantity = Quantity(self.mesh4) 202 202 203 204 203 #Try constants first 204 const = 5 205 205 quantity.set_values(const, location = 'vertices') 206 #print 'Q', quantity.get_integral() 207 208 assert allclose(quantity.get_integral(), 209 self.mesh4.get_area() * const) 210 211 #Try with a linear function 206 #print 'Q', quantity.get_integral() 207 208 assert allclose(quantity.get_integral(), self.mesh4.get_area() * const) 209 210 #Try with a linear function 212 211 def f(x, y): 213 212 return x+y … … 216 215 217 216 218 219 220 217 ref_integral = (4.0/3 + 8.0/3 + 10.0/3 + 10.0/3) * 2 218 219 assert allclose (quantity.get_integral(), ref_integral) 221 220 222 221 … … 929 928 runner = unittest.TextTestRunner() 930 929 runner.run(suite) 931
Note: See TracChangeset
for help on using the changeset viewer.