Changeset 4476
- Timestamp:
- May 23, 2007, 9:38:52 AM (18 years ago)
- Location:
- anuga_work/production/exmouth_2006
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_work/production/exmouth_2006/build_exmouth.py
r4465 r4476 69 69 #offshore_dir_name1 = project.offshore_dir_name1 70 70 #offshore_dir_name2 = project.offshore_dir_name2 71 71 ''' 72 72 # creates DEM from asc data 73 73 print "creates DEMs from asc data" … … 79 79 dem2pts(onshore_dir_name, use_cache=True, verbose=True) 80 80 dem2pts(onshore1_dir_name, use_cache=True, verbose=True) 81 81 ''' 82 82 print'create Geospatial data1 objects from topographies',onshore_dir_name + '.pts' 83 83 G1 = Geospatial_data(file_name = onshore_dir_name + '.pts') … … 96 96 mkdir (project.topographies_dir) 97 97 print'export',project.combined_dir_name+'_unclipped' + '.txt' 98 G.export_points_file(project.combined_dir_name+ '.txt') 98 #G.export_points_file(project.combined_dir_name+ '.txt') 99 100 print'create Geospatial data1 objects from topographies',onshore_dir_name + '.pts' 101 #G = Geospatial_data(file_name = project.combined_dir_name+ '.txt',verbose=True) 99 102 100 103 print'split' 101 G_small, G_other = G _clipped.split(.10,verbose=True)104 G_small, G_other = G.split(.10,verbose=True) 102 105 103 106 print 'export', project.combined_small_dir_name + '.txt' 104 107 G_small.export_points_file(project.combined_small_dir_name + '.txt') 105 108 #G_clipped.export_points_file(project.combined_dir_name + '.xya') 109 ''' 106 110 107 111 108 '''109 112 print'project.combined_dir_name + 1.xya',project.combined_dir_name + '1.xya' 110 113 G_all=Geospatial_data(file_name = project.combined_dir_name + '1.xya') … … 115 118 print'export 2' 116 119 G_all_2.export_points_file(project.combined_dir_name+'_other1' + '.xya') 117 ''' 120 118 121 119 122 #------------------------------------------------------------------------- … … 128 131 print 'project.boundaries_dir_name',project.boundaries_dir_name 129 132 130 urs_ungridded2sww(boundaries_in_dir_name, project.boundaries_ dir_name,133 urs_ungridded2sww(boundaries_in_dir_name, project.boundaries_in_dir_name, 131 134 verbose=True, mint=4000, maxt=35000, zscale=1) 135 136 ''' 132 137 133 138 134 139 135 140 136 137 -
anuga_work/production/exmouth_2006/project.py
r4465 r4476 96 96 #combined_dir_name_unclipped1 = topographies_dir + combined_name_unclipped1 97 97 #combined_dir_name1 = topographies_dir + combined_name1 98 combined_small_ name_dir= topographies_dir + combined_small_name98 combined_small_dir_name = topographies_dir + combined_small_name 99 99 100 100 meshes_dir = anuga_dir+'meshes'+sep … … 107 107 boundaries_name = 'exmouth_3854_17042007' 108 108 109 boundaries_in_dir = anuga_dir+'boundaries'+sep+'urs'+sep+' 1_10000'+sep109 boundaries_in_dir = anuga_dir+'boundaries'+sep+'urs'+sep+'dampier'+sep+'1_10000'+sep 110 110 boundaries_in_dir_name = boundaries_in_dir + boundaries_name 111 111 boundaries_dir = anuga_dir+'boundaries'+sep … … 133 133 from anuga.utilities.polygon import read_polygon, plot_polygons, polygon_area, is_inside_polygon 134 134 135 poly_all = read_polygon(polygons_dir+'extent_ zone50a.csv')135 poly_all = read_polygon(polygons_dir+'extent_more_points.csv') 136 136 137 137 print 'Area of bounding polygon', polygon_area(poly_all)/1000000.0 … … 142 142 # Interior region definitions 143 143 ############################### 144 '''145 poly_0 = read_polygon(polygons_dir+'neg20_coast_contour_pts.csv')146 res_0 = 20000*res_factor147 144 148 poly_1 = read_polygon(polygons_dir+'exmouth_north_coast_inside_extent.csv')149 res_1 = 5000*res_factor150 145 151 poly_ 2 = read_polygon(polygons_dir+'exmouth_south_coast_inside_extent.csv')152 res_ 2 = 5000*res_factor146 poly_coast = read_polygon(polygons_dir+'pts_coast.csv') 147 res_coast = 10000*res_factor 153 148 154 poly_ 3 = read_polygon(polygons_dir+'exmouth_town_pts.csv')155 res_3 = 2000*res_factor149 poly_coast1 = read_polygon(polygons_dir+'pts_coast1.csv') 150 #res_0 = 20000*res_factor 156 151 157 poly_ 4 = read_polygon(polygons_dir+'exmouth_inner_town_pts.csv')158 res_4 = 500*res_factor152 poly_coast2 = read_polygon(polygons_dir+'pts_coast2.csv') 153 #res_0 = 20000*res_factor 159 154 160 interior_regions = [[poly_0,res_0],[poly_1,res_1],[poly_2,res_2] 161 ,[poly_3,res_3],[poly_4,res_4]] 155 poly_coast3 = read_polygon(polygons_dir+'pts_coast3.csv') 156 #res_0 = 20000*res_factor 157 158 poly_exmouth = read_polygon(polygons_dir+'pts_exmouth.csv') 159 res_exmouth = 500*res_factor 160 161 poly_nth_defence = read_polygon(polygons_dir+'pts_nth_defence.csv') 162 res_nth_defence = 5000*res_factor 163 164 poly_middle = read_polygon(polygons_dir+'pts_middle.csv') 165 res_middle = 30000*res_factor 166 167 poly_airport = read_polygon(polygons_dir+'pts_airport.csv') 168 res_airport = 5000*res_factor 169 170 interior_regions = [[poly_coast,res_coast],[poly_coast1,res_coast],[poly_coast2,res_coast] 171 ,[poly_coast3,res_coast],[poly_middle,res_middle],[poly_exmouth,res_exmouth] 172 ,[poly_nth_defence,res_nth_defence],[poly_airport,res_airport]] 162 173 163 174 trigs_min = number_mesh_triangles(interior_regions, poly_all, res_poly_all) … … 166 177 167 178 poly_mainland = read_polygon(polygons_dir+'Initial_Condition.csv') 168 ''' 179 169 180 ################################################################### 170 181 # Clipping regions for export to asc and regions for clipping data -
anuga_work/production/exmouth_2006/run_exmouth.py
r4465 r4476 2 2 3 3 Source data such as elevation and boundary data is assumed to be available in 4 directories specified by project _urs.py5 The output sww file is stored in project _urs.output_run_time_dir6 7 The scenario is defined by a triangular mesh created from project _urs.polygon,4 directories specified by project.py 5 The output sww file is stored in project.output_run_time_dir 6 7 The scenario is defined by a triangular mesh created from project.polygon, 8 8 the elevation data and a simulated tsunami generated with URS code. 9 9 … … 37 37 from anuga.caching import myhash 38 38 # Application specific imports 39 import project _urs# Definition of file names and polygons39 import project # Definition of file names and polygons 40 40 41 41 def run_model(**kwargs): 42 42 43 tide = kwargs['tide']44 alpha = kwargs['alpha']45 friction = kwargs['friction']46 time_thinning = kwargs['time_thinning']43 # tide = kwargs['tide'] 44 # alpha = kwargs['alpha'] 45 # friction = kwargs['friction'] 46 # time_thinning = kwargs['time_thinning'] 47 47 scenario_name = kwargs['aa_scenario_name'] 48 49 50 48 51 49 #------------------------------------------------------------------------------ … … 55 53 56 54 #copy script must be before screen_catcher 57 print 'tide', tide58 kwargs['est_num_trigs']=project _urs.trigs_min55 print 'tide',kwargs['tide'] 56 kwargs['est_num_trigs']=project.trigs_min 59 57 kwargs['num_cpu']=numprocs 60 kwargs['host']=project _urs.host61 kwargs['res_factor']=project _urs.res_factor62 kwargs['starttime']=project _urs.starttime63 kwargs['yieldstep']=project _urs.yieldstep64 kwargs['finaltime']=project _urs.finaltime65 66 kwargs['output_dir']=project _urs.output_run_time_dir67 kwargs['bathy_file']=project _urs.combined_dir_name_unclipped1+'.txt'68 # kwargs['bathy_file']=project _urs.combined_small_dir_name + '.pts'69 kwargs['boundary_file']=project _urs.boundaries_dir_name + '.sww'58 kwargs['host']=project.host 59 kwargs['res_factor']=project.res_factor 60 kwargs['starttime']=project.starttime 61 kwargs['yieldstep']=project.yieldstep 62 kwargs['finaltime']=project.finaltime 63 64 kwargs['output_dir']=project.output_run_time_dir 65 kwargs['bathy_file']=project.combined_dir_name+'.txt' 66 # kwargs['bathy_file']=project.combined_small_dir_name + '.pts' 67 kwargs['boundary_file']=project.boundaries_in_dir_name + '.sww' 70 68 71 69 print 'output_dir',kwargs['output_dir'] 72 70 if myid == 0: 73 71 copy_code_files(kwargs['output_dir'],__file__, 74 dirname(project _urs.__file__)+sep+ project_urs.__name__+'.py' )72 dirname(project.__file__)+sep+ project.__name__+'.py' ) 75 73 76 74 store_parameters(**kwargs) … … 83 81 84 82 # filenames 85 # meshes_dir_name = project _urs.meshes_dir_name+'.msh'83 # meshes_dir_name = project.meshes_dir_name+'.msh' 86 84 87 85 # creates copy of code in output dir 88 print 'min triangles', project _urs.trigs_min,86 print 'min triangles', project.trigs_min, 89 87 print 'Note: This is generally about 20% less than the final amount' 90 88 … … 92 90 # Create the triangular mesh based on overall clipping polygon with a 93 91 # tagged 94 # boundary and interior regions defined in project _urs.py along with92 # boundary and interior regions defined in project.py along with 95 93 # resolutions (maximal area of per triangle) for each polygon 96 94 #-------------------------------------------------------------------------- … … 102 100 print 'start create mesh from regions' 103 101 104 create_mesh_from_regions(project _urs.poly_all,105 boundary_tags={'back': [ 1, 2], 'side': [0,3],106 'ocean': [ 4]},107 maximum_triangle_area=project _urs.res_poly_all,108 interior_regions=project _urs.interior_regions,109 filename=project _urs.meshes_dir_name+'.msh',102 create_mesh_from_regions(project.poly_all, 103 boundary_tags={'back': [3,4,5], 'side': [2,6], 104 'ocean': [0,1,7]}, 105 maximum_triangle_area=project.res_poly_all, 106 interior_regions=project.interior_regions, 107 filename=project.meshes_dir_name+'.msh', 110 108 use_cache=False, 111 109 verbose=True) 112 110 barrier() 113 114 111 115 112 #------------------------------------------------------------------------- … … 120 117 #domain = cache(Domain, (meshes_dir_name), {'use_cache':True, 'verbose':True}, verbose=True) 121 118 #above don't work 122 domain = Domain(project _urs.meshes_dir_name+'.msh', use_cache=False, verbose=True)119 domain = Domain(project.meshes_dir_name+'.msh', use_cache=False, verbose=True) 123 120 124 121 print domain.statistics() … … 127 124 kwargs['act_num_trigs']=len(domain) 128 125 129 130 126 #------------------------------------------------------------------------- 131 127 # Setup initial conditions … … 137 133 from polygon import Polygon_function 138 134 #following sets the stage/water to be offcoast only 139 IC = Polygon_function( [(project _urs.poly_mainland, -1.0)], default = tide,135 IC = Polygon_function( [(project.poly_mainland, -1.0)], default = kwargs['tide'], 140 136 geo_reference = domain.geo_reference) 141 137 domain.set_quantity('stage', IC) 142 domain.set_quantity('friction', friction)138 domain.set_quantity('friction', kwargs['friction']) 143 139 144 140 print 'Start Set quantity' … … 148 144 use_cache = True, 149 145 verbose = True, 150 alpha = alpha)146 alpha = kwargs['alpha']) 151 147 print 'Finished Set quantity' 152 148 barrier() 153 154 149 155 150 #------------------------------------------------------ … … 164 159 #------------------------------------------------------ 165 160 print 'domain id', id(domain) 166 domain.set_name( scenario_name)161 domain.set_name(kwargs['aa_scenario_name']) 167 162 domain.set_datadir(kwargs['output_dir']) 168 163 domain.set_default_order(2) # Apply second order scheme … … 180 175 print 'Available boundary tags', domain.get_boundary_tags() 181 176 print 'domain id', id(domain) 182 #print 'Reading Boundary file',project _urs.boundaries_dir_namea + '.sww'177 #print 'Reading Boundary file',project.boundaries_dir_namea + '.sww' 183 178 184 179 Bf = Field_boundary(kwargs['boundary_file'], 185 domain, time_thinning= time_thinning, mean_stage=tide,180 domain, time_thinning=kwargs['time_thinning'], mean_stage=kwargs['tide'], 186 181 use_cache=True, verbose=True) 187 182 … … 191 186 192 187 Br = Reflective_boundary(domain) 193 Bd = Dirichlet_boundary([ tide,0,0])188 Bd = Dirichlet_boundary([kwargs['tide'],0,0]) 194 189 195 190 print'set_boundary' … … 237 232 if __name__ == "__main__": 238 233 239 run_model(file_name=project _urs.home+'detail.csv', aa_scenario_name=project_urs.scenario_name,240 ab_time=project _urs.time, res_factor= project_urs.res_factor, tide=project_urs.tide, user=project_urs.user,241 alpha = project _urs.alpha, friction=project_urs.friction,242 time_thinning = project _urs.time_thinning,243 dir_comment=project _urs.dir_comment)244 245 234 run_model(file_name=project.home+'detail.csv', aa_scenario_name=project.scenario_name, 235 ab_time=project.time, res_factor= project.res_factor, tide=project.tide, user=project.user, 236 alpha = project.alpha, friction=project.friction, 237 time_thinning = project.time_thinning, 238 dir_comment=project.dir_comment) 239 240
Note: See TracChangeset
for help on using the changeset viewer.