Changeset 5252
- Timestamp:
- Apr 30, 2008, 9:35:06 AM (17 years ago)
- Location:
- anuga_core/source/anuga/shallow_water
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/source/anuga/shallow_water/test_tsunami_okada.py
r5244 r5252 51 51 filename = path+sep+'fullokada_SS.txt' 52 52 # initial condition of earthquake for multiple source 53 x0 = 7000.054 y0 = 10000.055 length = 10.056 width = 6.057 strike = 0.0 58 depth = 1 5.059 slip = 10.053 x0 = 50000.0 54 y0 = 25000.0 55 length = 50.0 56 width =10.0 57 strike = 0.0 58 depth = 10.0 59 slip = 30.0 60 60 dip =15.0 61 61 rake =90.0 … … 99 99 #create domain 100 100 dx = dy = 4000 101 l= 20000102 w= 20000101 l=100000 102 w=100000 103 103 #create topography 104 104 def topography(x,y): 105 el=-1 .000105 el=-1000 106 106 return el 107 107 … … 114 114 #create variable with elevation data to implement in okada 115 115 zrec0 = Quantity(domain) 116 zrec0.set_values( topography)116 zrec0.set_values(0.0) 117 117 zrec=zrec0.get_vertex_values(xy=True) 118 118 # call okada … … 135 135 Z=tsunami.get_values(interpolation_points=[[Xt,Yt]] 136 136 ,location='edges') 137 stage.append( Z[0])137 stage.append(-Z[0]) 138 138 k=k+4000 139 139 … … 232 232 #create topography 233 233 def topography(x,y): 234 el=-1 .000234 el=-1000 235 235 return el 236 236 … … 241 241 domain.set_quantity('elevation',topography) 242 242 Ts = earthquake_tsunami(ns=ns,NSMAX=NSMAX,length=length, width=width, strike=strike,\ 243 depth=depth,dip=dip, xi=x0, yi=y0, slip=slip, rake=rake,\243 depth=depth,dip=dip, xi=x0, yi=y0,z0=0, slip=slip, rake=rake,\ 244 244 domain=domain, verbose=True) 245 245 … … 255 255 Z=tsunami.get_values(interpolation_points=[[Xt,Yt]] 256 256 ,location='edges') 257 stage.append( Z[0])257 stage.append(-Z[0]) 258 258 k=k+4000 259 259 260 260 print tmp 261 print 'hello' 262 print stage 261 print 'hello',stage 263 262 assert allclose(stage,tmp,atol=1.e-3) 264 263 -
anuga_core/source/anuga/shallow_water/tsunami_okada.py
r5244 r5252 19 19 x0 x origin (0) 20 20 y0 y origin (0) 21 z0 z origin 21 22 slip metres of fault slip (1) 22 23 rake angle of slip (w.r.t. horizontal) in fault plane (90 degrees) 23 zrec elevation(m) 24 obtained as followed: 25 zrec0 = Quantity(domain) 26 zrec0.set_values(topography) 27 zrec=zrec0.get_vertex_values(xy=True) 24 28 25 29 26 … … 34 31 35 32 def earthquake_tsunami(ns,NSMAX,length, width, strike, depth,\ 36 dip, xi, yi, slip, rake,\33 dip, xi, yi,z0, slip, rake,\ 37 34 domain=None, verbose=False): 38 35 39 36 from anuga.abstract_2d_finite_volumes.quantity import Quantity 40 37 from math import sin, radians 41 38 from Numeric import zeros, Float 42 39 43 40 #zrec0 = Quantity(domain) 44 zrec0=domain.get_quantity('elevation') 41 zrec0 = Quantity(domain) 42 zrec0.set_values(z0) 45 43 zrec=zrec0.get_vertex_values(xy=True) 46 47 44 48 45 x0= zeros(ns,Float) … … 341 338 for j in range(0,6): 342 339 strain[irec][j]= strain[irec][j] + strain0[j] 343 z.append( disp[irec][2])340 z.append(-disp[irec][2]) 344 341 return z 345 342
Note: See TracChangeset
for help on using the changeset viewer.