Changeset 4751
- Timestamp:
- Oct 24, 2007, 11:34:30 AM (17 years ago)
- Location:
- anuga_validation/automated_validation_tests/UQ_runup_2006
- Files:
-
- 2 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
anuga_validation/automated_validation_tests/UQ_runup_2006/project.py
r4750 r4751 3 3 """ 4 4 basename = "uq" 5 5 6 depth_filename = "depth.csv" 6 7 velocity_x_filename = "velocity_x.csv" 7 8 velocity_y_filename = "velocity_y.csv" 8 9 9 10 10 mesh_filename = 'uq-mesh.tsh' 11 11 12 actual_filename = 'actual.csv' -
anuga_validation/automated_validation_tests/UQ_runup_2006/run_dam.py
r4750 r4751 20 20 Dirichlet_boundary, Time_boundary, File_boundary 21 21 from anuga.abstract_2d_finite_volumes.region import Set_region 22 from anuga.fit_interpolate.interpolate import interpolate_sww2csv 22 from anuga.fit_interpolate.interpolate import interpolate_sww2csv, \ 23 file_function 23 24 from anuga.abstract_2d_finite_volumes.util import start_screen_catcher, \ 24 25 copy_code_files 25 import create_mesh 26 27 import project 28 26 from anuga.shallow_water.data_manager import csv2dict 27 from numerical_tools import err # norm, corr, 29 28 30 29 # Application specific imports 31 32 30 import create_mesh 31 import project 33 32 def main(): 34 33 … … 100 99 print 'That took %.2f seconds' %(time.time()-t0) 101 100 print 'finished' 102 103 points = [[0.4,0.2]]104 #-------------------------------------------------------------------------105 # Calculate gauge info106 #-------------------------------------------------------------------------107 print "name",project.basename +".sww"108 interpolate_sww2csv( project.basename +".sww",109 points,110 project.depth_filename + '.csv',111 project.velocity_x_filename + '.csv',112 project.velocity_y_filename + '.csv')113 101 114 102 # Load actual experimental results 103 actual,title_index_dic = csv2dict(project.actual_filename) 104 105 gauge_locations = [[0.4,0.2]] 106 quantities = ['stage', 'elevation'] 107 file_instance = file_function( project.basename +".sww", 108 quantities = quantities, 109 interpolation_points = gauge_locations, 110 verbose = True, 111 use_cache = False) 112 # create a list of the simulated_depths at the actual data times. 113 simulated_depths = [] 114 for atime in actual['time']: 115 quantities_slice = file_instance(float(atime), 116 point_id=0) 117 depth = quantities_slice[0] - quantities_slice[1] 118 simulated_depths.append(depth) 119 flume_depths = actual["0.4:0.2"] 120 flume_depths = [float(i) for i in flume_depths] 121 # calc the norm 122 #print "map(None, simulated_depths, flume_depths)", \ 123 # map(None, simulated_depths, flume_depths) 124 normmax = 0 125 norm = err(simulated_depths, 126 flume_depths, 2, relative = True) # 2nd norm (rel. RMS 127 if norm > normmax: 128 normmax = norm 129 print norm 130 print "norm", norm 115 131 #------------------------------------------------------------- 116 132 if __name__ == "__main__":
Note: See TracChangeset
for help on using the changeset viewer.