Changeset 5293


Ignore:
Timestamp:
May 8, 2008, 5:54:45 PM (16 years ago)
Author:
sexton
Message:

minor updates to okada function

File:
1 edited

Legend:

Unmodified
Added
Removed
  • anuga_core/source/anuga/shallow_water/test_tsunami_okada.py

    r5286 r5293  
    127127        # get vertical displacement at each point of the domain respecting
    128128        # original script's order
    129         interpolation_points=[]
    130129        k=0.0
    131130        for i in range(0,6):
     
    134133                Yt=p
    135134                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])
    138138            k=k+4000
    139         Z=tsunami.get_values(interpolation_points=interpolation_points,
    140                              location='edges')
    141139       
    142140        assert allclose(stage,tmp,atol=1.e-8)
    143         print stage
    144         print tmp
     141        #print stage
    145142        print 'c est fini'
    146143
     
    158155        rectangular sources
    159156        """
    160 
     157        print 'ca commence'
    161158        #get path where this test is run
    162159        path= get_pathname_from_package('anuga.shallow_water')
     
    229226
    230227         
    231         # Create domain
     228        #create domain
    232229        dx = dy = 4000
    233230        l=20000
    234231        w=20000
    235        
    236         # Create topography
     232        #create topography
    237233        def topography(x,y):
    238234            el=-1000
     
    248244                                domain=domain, verbose=False)
    249245       
    250         # Create a variable to store vertical displacement throughout the domain
     246        #create a variable to store vertical displacement throughout the domain
    251247        tsunami = Quantity(domain)
    252248        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
    269249        interpolation_points=[]
    270250        k=0.0
     
    277257
    278258            k=k+4000
     259
    279260        Z=tsunami.get_values(interpolation_points=interpolation_points,
    280261                             location='edges')
     
    287268        assert allclose(stage,tmp,atol=1.e-3)
    288269
     270       
    289271#-------------------------------------------------------------
    290272if __name__ == "__main__":
    291273    #suite = unittest.makeSuite(Test_eq,'test_Okada_func')
    292     suite = unittest.makeSuite(Test_eq,'test')
     274    suite = unittest.makeSuite(Test_eq,'test_earthquake_tsunami')
    293275    runner = unittest.TextTestRunner()
    294276    runner.run(suite)
Note: See TracChangeset for help on using the changeset viewer.