Changeset 4410
- Timestamp:
- Apr 23, 2007, 11:54:29 AM (17 years ago)
- 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 81 81 82 82 # convert MUX urs files to an SWW file output 83 #print 'boundary file is: ',boundaries_dir_name84 '''85 from caching import cache86 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 '''96 83 urs2sww(boundaries_dir_name,boundaries_dir_name, 97 84 mint=9200, maxt= 11200, 98 # 'origin': domain.geo_reference.get_origin(),99 85 fail_on_NaN= False, 100 86 verbose=True) … … 122 108 # Setup boundary conditions 123 109 #------------------------------------------------------------------------- 124 #Bf = File_boundary(out_dir + 'o_test_8500_12000.sww',125 # domain, time_thinning=24, use_cache=True, verbose=True)126 110 Bf = Field_boundary(out_dir + 'o_test.sww', 127 111 domain, mean_stage=tide, use_cache=True, verbose=False) 128 129 #print 'finished reading boundary file'130 112 131 113 #Br = Reflective_boundary(domain) … … 133 115 Bd = Dirichlet_boundary([tide,0,0]) 134 116 135 #print'set_boundary'136 117 137 118 domain.set_boundary({'back': Bt, … … 139 120 'ocean': Bf 140 121 }) 141 #print'finish set boundary'142 143 122 #---------------------------------------------------------------------------- 144 123 # Evolve system through time … … 156 135 #Gets timeseries from boundary sww and evolved sww 157 136 home = getenv('INUNDATIONHOME') #Sandpit's parent dir 158 #user = get_user_name()159 137 data = 'data' 160 138 state = 'western_australia' … … 162 140 163 141 scenario = 'dampier_tsunami_scenario_2006' 164 #scenario = 'test_dampier'165 142 an = 'anuga' 166 143 bo = 'boundaries' 167 144 168 145 run_time = 'blank' 169 #run_time = project.run_time170 146 production_dirs = {run_time: 'URS evolved data'#, 171 #'boundaries': 'URS boundary condition'172 147 } 173 148 … … 178 153 179 154 180 #gauge_boundary_filename = 'boundary_gauge_near_top.csv'181 155 gauge_boundary_filename = 'gauges_time_series_b_near_top.csv' 182 156 gauge_evolved_filename = 'gauges_time_series_near_top.csv' … … 187 161 evolved_dir_filename= os.path.join(out_dir,gauge_evolved_filename) 188 162 189 #print'boundary_dir_filename',boundary_dir_filename190 #print'evolved_dir_filename',evolved_dir_filename191 192 163 swwfiles = {} 193 164 swwfile = out_dir + fileName + '.sww' 194 165 swwfiles[swwfile] = run_time 195 #print"swwfiles",swwfiles,"shallow_water"196 166 197 167 texname, elev_output = sww2timeseries(swwfiles, 198 out_dir+sep+"gauges.csv", 168 out_dir+sep+"gauges.txt", 169 # out_dir+sep+"gauges.csv", 199 170 production_dirs, 200 171 report = False, … … 213 184 214 185 texname, 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", 216 188 production_dirs, 217 189 report = False, … … 269 241 print "test successful" 270 242 print 'fileName',fileName+'.sww' 271 os.remove(fileName+'.sww')243 #os.remove(fileName+'.sww') 272 244 #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') 277 249 os.remove(meshes_dir_name) 278 250 -
anuga_validation/automated_validation_tests/urs_mux_files_validation/validate_Bf.py
r4408 r4410 11 11 12 12 class Test_Bf(unittest.TestCase): 13 def setUp(self):13 def test_setUp(self): 14 14 15 15 # Remove garbage 16 16 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'): 20 20 os.remove(file) 21 21 22 '''23 #print24 s = 'create_okushiri.py'25 #print s26 res = os.system('python %s > create_okushiri.stdout' %s)27 assert res == 028 29 s = 'run_Bf.py'30 #print s31 res = os.system('python %s > run_Bf.stdout' %s)32 #must run without error33 assert res == 034 '''35 36 22 def tearDown(self): 37 23 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)46 24 47 25 def test_compare_URSsww_vs_EvolveANUGAsww(self): … … 51 29 %s) 52 30 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 53 41 54 42
Note: See TracChangeset
for help on using the changeset viewer.