Changeset 5239
- Timestamp:
- Apr 24, 2008, 12:01:15 PM (15 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
r5206 r5239 1 1 import unittest 2 2 from Numeric import allclose 3 from tsunami_okada import earthquake_tsunami,Okada_func3 from tsunami_okada_V2 import earthquake_tsunami,Okada_func 4 4 5 5 class Test_eq(unittest.TestCase): … … 113 113 114 114 #create variable with elevation data to implement in okada 115 zrec = Quantity(domain) 116 zrec.set_values(topography) 117 115 zrec0 = Quantity(domain) 116 zrec0.set_values(topography) 117 zrec=zrec0.get_vertex_values(xy=True) 118 print zrec 118 119 # call okada 119 120 Ts= Okada_func(ns=ns, NSMAX=NSMAX,length=length, width=width, dip=dip, \ … … 241 242 domain.set_name('test') 242 243 domain.set_quantity('elevation',topography) 243 zrec = Quantity(domain)244 zrec .set_values(topography)245 244 zrec0 = Quantity(domain) 245 zrec0.set_values(topography) 246 zrec=zrec0.get_vertex_values(xy=True) 246 247 Ts = earthquake_tsunami(ns=ns,NSMAX=NSMAX,length=length, width=width, strike=strike,\ 247 248 depth=depth,dip=dip, xi=x0, yi=y0, slip=slip, rake=rake,\ -
anuga_core/source/anuga/shallow_water/tsunami_okada.py
r5233 r5239 139 139 dislocation = self.slip 140 140 ns=self.ns 141 zrec i=self.zrec141 zrec=self.zrec 142 142 #initialization 143 143 disp0=zeros(3,Float) … … 199 199 #Z=-zrec 200 200 eps = 1.0e-6 201 201 202 # 202 203 for irec in range(0,N): 203 204 xrec=y 204 205 yrec=x 205 zrec=zreci.get_values(interpolation_points=[[xrec[irec],yrec[irec]]],location='edges') 206 Z=zrec[0] 206 for i in range(0,len(zrec[0])): 207 if zrec[0][i]==yrec and zrec[1][i]==xrec: 208 Z=zrec[2][i] 209 break 210 else: continue 211 #zrec=zreci.get_values(interpolation_points=[[xrec[irec],yrec[irec]]],location='edges') 212 207 213 for ist in range(0,ns): 208 214 #st = radians(strikes[ist])
Note: See TracChangeset
for help on using the changeset viewer.