Changeset 4410


Ignore:
Timestamp:
Apr 23, 2007, 11:54:29 AM (17 years ago)
Author:
nick
Message:

fix and update boundary file test

Location:
anuga_validation/automated_validation_tests/urs_mux_files_validation
Files:
2 added
3 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • anuga_validation/automated_validation_tests/urs_mux_files_validation/run_Bf.py

    r4408 r4410  
    8181
    8282# convert MUX urs files to an SWW file output
    83 #print 'boundary file is: ',boundaries_dir_name
    84 '''
    85 from caching import cache
    86 cache(urs2sww,
    87           (boundaries_dir_name,
    88            boundaries_dir_name),
    89           {'verbose': False,
    90            'mint': 9200, 'maxt': 11200,
    91 #           'origin': domain.geo_reference.get_origin(),
    92            'fail_on_NaN': False},
    93            verbose = True,
    94            )
    95 '''
    9683urs2sww(boundaries_dir_name,boundaries_dir_name,
    9784           mint=9200, maxt= 11200,
    98 #           'origin': domain.geo_reference.get_origin(),
    9985           fail_on_NaN= False,
    10086           verbose=True)
     
    122108# Setup boundary conditions
    123109#-------------------------------------------------------------------------
    124 #Bf = File_boundary(out_dir + 'o_test_8500_12000.sww',
    125 #                  domain, time_thinning=24, use_cache=True, verbose=True)
    126110Bf = Field_boundary(out_dir + 'o_test.sww',
    127111                  domain, mean_stage=tide, use_cache=True, verbose=False)
    128 
    129 #print 'finished reading boundary file'
    130112
    131113#Br = Reflective_boundary(domain)
     
    133115Bd = Dirichlet_boundary([tide,0,0])
    134116
    135 #print'set_boundary'
    136117
    137118domain.set_boundary({'back': Bt,
     
    139120                    'ocean': Bf
    140121                    })
    141 #print'finish set boundary'
    142 
    143122#----------------------------------------------------------------------------
    144123# Evolve system through time
     
    156135#Gets timeseries from boundary sww and evolved sww
    157136home = getenv('INUNDATIONHOME') #Sandpit's parent dir   
    158 #user = get_user_name()
    159137data = 'data'
    160138state = 'western_australia'
     
    162140
    163141scenario = 'dampier_tsunami_scenario_2006'
    164 #scenario = 'test_dampier'
    165142an = 'anuga'
    166143bo = 'boundaries'
    167144
    168145run_time = 'blank'
    169 #run_time = project.run_time
    170146production_dirs = {run_time: 'URS evolved data'#,
    171                    #'boundaries': 'URS boundary condition'
    172147                   }
    173148
     
    178153
    179154
    180 #gauge_boundary_filename = 'boundary_gauge_near_top.csv'
    181155gauge_boundary_filename = 'gauges_time_series_b_near_top.csv'
    182156gauge_evolved_filename = 'gauges_time_series_near_top.csv'
     
    187161evolved_dir_filename= os.path.join(out_dir,gauge_evolved_filename)
    188162
    189 #print'boundary_dir_filename',boundary_dir_filename
    190 #print'evolved_dir_filename',evolved_dir_filename
    191                                      
    192163swwfiles = {}
    193164swwfile = out_dir + fileName + '.sww'
    194165swwfiles[swwfile] = run_time
    195 #print"swwfiles",swwfiles,"shallow_water"
    196166       
    197167texname, elev_output = sww2timeseries(swwfiles,
    198                                       out_dir+sep+"gauges.csv",
     168                                      out_dir+sep+"gauges.txt",
     169#                                      out_dir+sep+"gauges.csv",
    199170                                      production_dirs,
    200171                                      report = False,
     
    213184       
    214185texname, elev_output = sww2timeseries(swwfiles,
    215                                       out_dir+sep+"boundary_gauges.csv",
     186                                      out_dir+sep+"boundary_gauges.txt",
     187#                                      out_dir+sep+"boundary_gauges.csv",
    216188                                      production_dirs,
    217189                                      report = False,
     
    269241print "test successful"
    270242print 'fileName',fileName+'.sww'
    271 os.remove(fileName+'.sww')
     243#os.remove(fileName+'.sww')
    272244#print 'evolved_dir_filename',evolved_dir_filename
    273 os.remove('gauges_time_series_near_top.csv')
    274 os.remove('gauges_time_series_b_near_top.csv')
    275 os.remove('gauges_t0.csv')
    276 os.remove('gauges_maxmins.csv')
     245#os.remove('gauges_time_series_near_top.csv')
     246#os.remove('gauges_time_series_b_near_top.csv')
     247#os.remove('gauges_t0.csv')
     248#os.remove('gauges_maxmins.csv')
    277249os.remove(meshes_dir_name)
    278250
  • anuga_validation/automated_validation_tests/urs_mux_files_validation/validate_Bf.py

    r4408 r4410  
    1111
    1212class Test_Bf(unittest.TestCase):
    13     def setUp(self):
     13    def test_setUp(self):
    1414
    1515        # Remove garbage
    1616        for file in os.listdir('.'):
    17             if file.endswith('.stdout'):# or\
    18 #               file.endswith('.sww') or\
    19 #               file.endswith('.msh'):
     17            if file.endswith('.stdout') or\
     18               file.endswith('.sww') or\
     19               file.endswith('.csv'):
    2020                os.remove(file)
    2121               
    22         '''
    23         #print
    24         s = 'create_okushiri.py'
    25         #print s
    26         res = os.system('python %s > create_okushiri.stdout' %s)
    27         assert res == 0
    28        
    29         s = 'run_Bf.py'
    30         #print s       
    31         res = os.system('python %s > run_Bf.stdout' %s)
    32         #must run without error       
    33         assert res == 0
    34     '''       
    35 
    3622    def tearDown(self):
    3723        pass
    38 
    39     #def test_creation_of_mesh(self):
    40     #    s = 'create_okushiri.py'
    41     #    os.system('python %s > create_okushiri.stdout' %s)
    42 
    43     #def test_that_simulation_can_run(self):
    44     #    s = 'run_okushiri.py'
    45     #    os.system('python %s > run_okushiri.stdout' %s)
    4624
    4725    def test_compare_URSsww_vs_EvolveANUGAsww(self):   
     
    5129                        %s)
    5230        assert res == 0
     31       
     32    def test_cleanUp(self):
     33
     34        # Remove garbage
     35        print 'clean up'
     36        for file in os.listdir('.'):
     37            if file.endswith('.sww') or\
     38               file.endswith('.csv'):
     39                os.remove(file)
     40               
    5341
    5442
Note: See TracChangeset for help on using the changeset viewer.