Changeset 5252


Ignore:
Timestamp:
Apr 30, 2008, 9:35:06 AM (16 years ago)
Author:
herve
Message:

new definition for zrec
change sign for displacement

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  
    5151            filename = path+sep+'fullokada_SS.txt'
    5252        # initial condition of earthquake for multiple source
    53             x0 = 7000.0
    54             y0 = 10000.0
    55             length = 10.0
    56             width =6.0
    57             strike = 0.0
    58             depth = 15.0
    59             slip = 10.0
     53            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
    6060            dip =15.0
    6161            rake =90.0
     
    9999        #create domain
    100100        dx = dy = 4000
    101         l=20000
    102         w=20000
     101        l=100000
     102        w=100000
    103103        #create topography
    104104        def topography(x,y):
    105             el=-1.000
     105            el=-1000
    106106            return el
    107107       
     
    114114        #create variable with elevation data to implement in okada
    115115        zrec0 = Quantity(domain)
    116         zrec0.set_values(topography)
     116        zrec0.set_values(0.0)
    117117        zrec=zrec0.get_vertex_values(xy=True)
    118118        # call okada
     
    135135                Z=tsunami.get_values(interpolation_points=[[Xt,Yt]]
    136136                                     ,location='edges')
    137                 stage.append(Z[0])
     137                stage.append(-Z[0])
    138138            k=k+4000
    139139       
     
    232232        #create topography
    233233        def topography(x,y):
    234             el=-1.000
     234            el=-1000
    235235            return el
    236236       
     
    241241        domain.set_quantity('elevation',topography)
    242242        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,\
    244244                                domain=domain, verbose=True)
    245245       
     
    255255                Z=tsunami.get_values(interpolation_points=[[Xt,Yt]]
    256256                                     ,location='edges')
    257                 stage.append(Z[0])
     257                stage.append(-Z[0])
    258258            k=k+4000
    259259
    260260        print tmp
    261         print 'hello'
    262         print stage   
     261        print 'hello',stage   
    263262        assert allclose(stage,tmp,atol=1.e-3)
    264263
  • anuga_core/source/anuga/shallow_water/tsunami_okada.py

    r5244 r5252  
    1919 x0      x origin (0)
    2020 y0      y origin (0)
     21 z0      z origin
    2122 slip    metres of fault slip (1)
    2223 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     
    2825
    2926
     
    3431
    3532def earthquake_tsunami(ns,NSMAX,length, width, strike, depth,\
    36                        dip, xi, yi, slip, rake,\
     33                       dip, xi, yi,z0, slip, rake,\
    3734                       domain=None, verbose=False):
    3835
    39    
     36    from anuga.abstract_2d_finite_volumes.quantity import Quantity
    4037    from math import sin, radians
    4138    from Numeric import zeros, Float
    4239
    4340    #zrec0 = Quantity(domain)
    44     zrec0=domain.get_quantity('elevation')
     41    zrec0 = Quantity(domain)
     42    zrec0.set_values(z0)
    4543    zrec=zrec0.get_vertex_values(xy=True)
    46 
    4744   
    4845    x0= zeros(ns,Float)
     
    341338                for j in range(0,6):
    342339                    strain[irec][j]= strain[irec][j] + strain0[j]
    343             z.append(disp[irec][2])
     340            z.append(-disp[irec][2])
    344341        return z
    345342       
Note: See TracChangeset for help on using the changeset viewer.