Changeset 5275
- Timestamp:
- May 5, 2008, 3:31:58 PM (17 years ago)
- Location:
- anuga_core/source/anuga/shallow_water
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/source/anuga/shallow_water/data_manager.py
r5274 r5275 5629 5629 5630 5630 The normal flow is computed for each triangle intersected by the polyline and added up. 5631 If multiple se ctions are specifiednormal flows may partially cancel each other.5631 If multiple segments at different angles are specified the normal flows may partially cancel each other. 5632 5632 5633 5633 """ -
anuga_core/source/anuga/shallow_water/test_tsunami_okada.py
r5252 r5275 11 11 12 12 13 def test_Okada_func(self):13 def NOtest_Okada_func(self): 14 14 from os import sep, getenv 15 15 from Numeric import zeros, Float,allclose … … 140 140 assert allclose(stage,tmp,atol=1.e-8) 141 141 print stage 142 print tmp 142 143 print 'c est fini' 143 144 … … 155 156 rectangular sources 156 157 """ 157 print 'ca commence' 158 158 159 #get path where this test is run 159 160 path= get_pathname_from_package('anuga.shallow_water') … … 226 227 227 228 228 # create domain229 # Create domain 229 230 dx = dy = 4000 230 231 l=20000 231 232 w=20000 232 #create topography 233 234 # Create topography 233 235 def topography(x,y): 234 236 el=-1000 … … 242 244 Ts = earthquake_tsunami(ns=ns,NSMAX=NSMAX,length=length, width=width, strike=strike,\ 243 245 depth=depth,dip=dip, xi=x0, yi=y0,z0=0, slip=slip, rake=rake,\ 244 domain=domain, verbose= True)245 246 # create a variable to store vertical displacement throughout the domain246 domain=domain, verbose=False) 247 248 # Create a variable to store vertical displacement throughout the domain 247 249 tsunami = Quantity(domain) 248 250 tsunami.set_values(Ts) 251 252 #k=0.0 253 #for i in range(0,6): 254 # for j in range(0,6): 255 # p=j*4000 256 # Yt=p 257 # Xt=k 258 # Z=tsunami.get_values(interpolation_points=[[Xt,Yt]] 259 # ,location='edges') 260 # stage.append(-Z[0]) 261 # k=k+4000 262 # 263 #assert allclose(stage,tmp,atol=1.e-3) 264 265 # Here's a faster way - try that in the first test 266 interpolation_points=[] 249 267 k=0.0 250 268 for i in range(0,6): … … 253 271 Yt=p 254 272 Xt=k 255 Z=tsunami.get_values(interpolation_points=[[Xt,Yt]] 256 ,location='edges') 257 stage.append(-Z[0]) 273 interpolation_points.append([Xt, Yt]) 274 258 275 k=k+4000 259 276 260 print tmp 261 print 'hello',stage 262 assert allclose(stage,tmp,atol=1.e-3) 263 264 277 Z=tsunami.get_values(interpolation_points=interpolation_points, 278 location='edges') 279 280 stage = -Z # FIXME(Ole): Why the sign flip? 281 282 assert allclose(stage, tmp, atol=1.e-3) 283 265 284 #------------------------------------------------------------- 266 285 if __name__ == "__main__": 267 286 #suite = unittest.makeSuite(Test_eq,'test_Okada_func') 268 suite = unittest.makeSuite(Test_eq,'test _earthquake_tsunami')287 suite = unittest.makeSuite(Test_eq,'test') 269 288 runner = unittest.TextTestRunner() 270 289 runner.run(suite)
Note: See TracChangeset
for help on using the changeset viewer.