Changeset 5065 for anuga_validation
- Timestamp:
- Feb 20, 2008, 3:12:21 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_validation/circular_island/run_circular.py
r5038 r5065 12 12 from anuga.shallow_water import Transmissive_Momentum_Set_Stage_boundary 13 13 from anuga.shallow_water import Dirichlet_boundary, Time_boundary 14 from anuga.shallow_water.data_manager import get_maximum_inundation_data, start_screen_catcher 15 from anuga.abstract_2d_finite_volumes.util import file_function, sww2csv_gauges 14 from anuga.shallow_water.data_manager import get_maximum_inundation_data, start_screen_catcher, copy_code_files 15 from anuga.abstract_2d_finite_volumes.util import file_function, sww2csv_gauges,csv2timeseries_graphs 16 16 from anuga.pmesh.mesh_interface import create_mesh_from_regions 17 17 from anuga.utilities.polygon import read_polygon#, plot_polygons … … 19 19 from Numeric import array, zeros, Float, allclose,resize 20 20 from anuga.shallow_water.data_manager import csv2dict 21 21 from time import localtime, strftime, gmtime 22 from anuga.utilities.system_tools import get_user_name, get_host_name 23 from os import sep, environ, getenv 22 24 #------------------------- 23 25 # Create Domain from mesh 24 26 #------------------------- 25 27 26 #start_screen_catcher() 28 user = get_user_name() 29 home = getenv('INUNDATIONHOME') + sep +'data'+sep #Sandpit's parent dir 30 time = strftime('%Y%m%d_%H%M%S',localtime()) 31 32 res=0.01 33 34 dir_comment = time+'_res_'+str(res)+'_'+str(user) 35 36 anuga_dir = home+'anuga_validation'+sep+'circular_island_tsunami_benchmark'+sep+'anuga'+sep 37 output_dir = anuga_dir+'outputs'+sep+dir_comment+sep 38 copy_code_files(output_dir,__file__) 39 40 start_screen_catcher(output_dir) 27 41 28 42 def get_xy(x=0,y=0,r=1,angle=1): … … 91 105 92 106 93 107 # angle to make circular interior polygons 94 108 angles1 = (0.0, 22.5, 45.0, 67.5, 90.0, 112.5, 135.0, 157.5, 180.0, 202.5, 225.0, 95 109 247.5, 270.0, 292.5, 315.0, 337.5) … … 98 112 center_y = 13.80 99 113 100 d=0.75 101 res=0.05 102 res=1. 114 #d=0.75 103 115 #L=3.6 and therefore the gauges 1,2,3 and 4 are located 1.8 from the toe of the island 104 116 # 13.8 - 3.6(radii of island) - 1.8 = 8.4 … … 202 214 model_name='wavetank_model' 203 215 domain.set_name(model_name) # Name of output sww file 216 domain.set_datadir(output_dir) 204 217 domain.set_default_order(1) # Apply second order scheme 205 218 #domain.set_all_limiters(0.9) # Max second order scheme (old lim) … … 208 221 domain.tight_slope_limiters = 1 209 222 domain.beta_h = 0.0 223 sww_file=output_dir+sep+model_name+'.sww' 210 224 211 225 … … 261 275 r2 = 2.6 262 276 #degrees to check 263 d= 2277 d=1 264 278 265 279 poly_segment = [] … … 276 290 #print i,poly[i] 277 291 278 run_up, location = get_maximum_inundation_data(filename= model_name+'.sww',polygon=poly_segment, verbose=False)292 run_up, location = get_maximum_inundation_data(filename=sww_file,polygon=poly_segment, verbose=False) 279 293 280 294 print 'maxd %.3f, %.6f, %.6f, %.5s, %.5s '%(((angle/pi)*180)+180, run_up*100, (run_up-water_height)*100, location[0],location[1]) 281 295 282 283 284 285 286 287 296 sww_file=anuga_dir+'outputs'+sep+'20080220_010628_res_0.05_nbartzis'+sep+'wavetank_model.sww' 297 sww_file=anuga_dir+'outputs'+sep+'20080219_233611_res_0.05_nbartzis'+sep+'wavetank_model.sww' 298 sww2csv_gauges(sww_file=sww_file, 299 gauge_file='gauges.csv', 300 quantities = ['stage','depth', 'elevation', 'xmomentum', 'ymomentum'], 301 verbose=True, 302 use_cache = True) 303 304 csv2timeseries_graphs(directories_dic={anuga_dir+sep+'boundaries'+sep:['wavetank',0, 0], 305 anuga_dir+'outputs'+sep+'20080219_233611_res_0.05_nbartzis'+sep:['Fixed Wave',0,0]}, 306 output_dir=anuga_dir+'outputs'+sep+'20080219_233611_res_0.05_nbartzis'+sep, 307 base_name='gauge_', 308 plot_numbers='', 309 quantities=['stage'], 310 extra_plot_name='', 311 assess_all_csv_files=True, 312 create_latex=False, 313 verbose=True) 314 315 316 317 318
Note: See TracChangeset
for help on using the changeset viewer.