Changeset 5309


Ignore:
Timestamp:
May 12, 2008, 12:20:39 PM (16 years ago)
Author:
ole
Message:

Reverted tsunami Okada (svn merge -r 5293:5292 test_tsunami_okada.py)
and made it run both tests

File:
1 edited

Legend:

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

    r5293 r5309  
    127127        # get vertical displacement at each point of the domain respecting
    128128        # original script's order
     129        interpolation_points=[]
    129130        k=0.0
    130131        for i in range(0,6):
     
    133134                Yt=p
    134135                Xt=k
    135                 Z=tsunami.get_values(interpolation_points=[[Xt,Yt]]
    136                                      ,location='edges')
    137                 stage.append(-Z[0])
     136                interpolation_points.append([Xt, Yt])
     137
    138138            k=k+4000
     139        Z=tsunami.get_values(interpolation_points=interpolation_points,
     140                             location='edges')
    139141       
    140142        assert allclose(stage,tmp,atol=1.e-8)
    141         #print stage
     143        print stage
     144        print tmp
    142145        print 'c est fini'
    143146
     
    155158        rectangular sources
    156159        """
    157         print 'ca commence'
     160
    158161        #get path where this test is run
    159162        path= get_pathname_from_package('anuga.shallow_water')
     
    226229
    227230         
    228         #create domain
     231        # Create domain
    229232        dx = dy = 4000
    230233        l=20000
    231234        w=20000
    232         #create topography
     235       
     236        # Create topography
    233237        def topography(x,y):
    234238            el=-1000
     
    244248                                domain=domain, verbose=False)
    245249       
    246         #create a variable to store vertical displacement throughout the domain
     250        # Create a variable to store vertical displacement throughout the domain
    247251        tsunami = Quantity(domain)
    248252        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
    249269        interpolation_points=[]
    250270        k=0.0
     
    257277
    258278            k=k+4000
    259 
    260279        Z=tsunami.get_values(interpolation_points=interpolation_points,
    261280                             location='edges')
     
    268287        assert allclose(stage,tmp,atol=1.e-3)
    269288
    270        
    271289#-------------------------------------------------------------
    272290if __name__ == "__main__":
    273     #suite = unittest.makeSuite(Test_eq,'test_Okada_func')
    274     suite = unittest.makeSuite(Test_eq,'test_earthquake_tsunami')
     291    suite = unittest.makeSuite(Test_eq,'test')
    275292    runner = unittest.TextTestRunner()
    276293    runner.run(suite)
Note: See TracChangeset for help on using the changeset viewer.