Changeset 5309
- Timestamp:
- May 12, 2008, 12:20:39 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/source/anuga/shallow_water/test_tsunami_okada.py
r5293 r5309 127 127 # get vertical displacement at each point of the domain respecting 128 128 # original script's order 129 interpolation_points=[] 129 130 k=0.0 130 131 for i in range(0,6): … … 133 134 Yt=p 134 135 Xt=k 135 Z=tsunami.get_values(interpolation_points=[[Xt,Yt]] 136 ,location='edges') 137 stage.append(-Z[0]) 136 interpolation_points.append([Xt, Yt]) 137 138 138 k=k+4000 139 Z=tsunami.get_values(interpolation_points=interpolation_points, 140 location='edges') 139 141 140 142 assert allclose(stage,tmp,atol=1.e-8) 141 #print stage 143 print stage 144 print tmp 142 145 print 'c est fini' 143 146 … … 155 158 rectangular sources 156 159 """ 157 print 'ca commence' 160 158 161 #get path where this test is run 159 162 path= get_pathname_from_package('anuga.shallow_water') … … 226 229 227 230 228 # create domain231 # Create domain 229 232 dx = dy = 4000 230 233 l=20000 231 234 w=20000 232 #create topography 235 236 # Create topography 233 237 def topography(x,y): 234 238 el=-1000 … … 244 248 domain=domain, verbose=False) 245 249 246 # create a variable to store vertical displacement throughout the domain250 # Create a variable to store vertical displacement throughout the domain 247 251 tsunami = Quantity(domain) 248 252 tsunami.set_values(Ts) 253 interpolation_points=[] 254 255 #k=0.0 256 #for i in range(0,6): 257 # for j in range(0,6): 258 # p=j*4000 259 # Yt=p 260 # Xt=k 261 # Z=tsunami.get_values(interpolation_points=[[Xt,Yt]] 262 # ,location='edges') 263 # stage.append(-Z[0]) 264 # k=k+4000 265 # 266 #assert allclose(stage,tmp,atol=1.e-3) 267 268 # Here's a faster way - try that in the first test 249 269 interpolation_points=[] 250 270 k=0.0 … … 257 277 258 278 k=k+4000 259 260 279 Z=tsunami.get_values(interpolation_points=interpolation_points, 261 280 location='edges') … … 268 287 assert allclose(stage,tmp,atol=1.e-3) 269 288 270 271 289 #------------------------------------------------------------- 272 290 if __name__ == "__main__": 273 #suite = unittest.makeSuite(Test_eq,'test_Okada_func') 274 suite = unittest.makeSuite(Test_eq,'test_earthquake_tsunami') 291 suite = unittest.makeSuite(Test_eq,'test') 275 292 runner = unittest.TextTestRunner() 276 293 runner.run(suite)
Note: See TracChangeset
for help on using the changeset viewer.