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