Changeset 3877
- Timestamp:
- Oct 27, 2006, 2:29:02 PM (19 years ago)
- Location:
- anuga_work/production/dampier_2006
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_work/production/dampier_2006/build_dampier.py
r3871 r3877 152 152 if access(project.boundaries_time_dir,F_OK) == 0: 153 153 mkdir (project.boundaries_time_dir) 154 #urs2sww(boundaries_in_dir_name,basename_out= project.boundaries_time_dir_name, 155 # minlat=project.south_boundary, maxlat=project.north_boundary, 156 # minlon= project.west_boundary, maxlon=project.east_boundary, 157 # mint=0, maxt= 35000, 158 # verbose='true') 159 154 urs2sww(boundaries_in_dir_name,basename_out= project.boundaries_time_dir_name, 155 minlat=project.south_boundary, maxlat=project.north_boundary, 156 minlon= project.west_boundary, maxlon=project.east_boundary, 157 mint=0, maxt= 35000, 158 verbose='true') 159 ''' 160 from caching import cache 160 161 cache(urs2sww, 161 162 (boundaries_in_dir_name, 162 basename_out=project.boundaries_time_dir_name),163 project.boundaries_time_dir_name), 163 164 {'verbose': True, 164 165 'minlat': project.south_boundary, … … 167 168 'maxlon': project.east_boundary, 168 169 'mint': 0, 'maxt': 35000, 169 'origin': domain.geo_reference.get_origin(),170 # 'origin': domain.geo_reference.get_origin(), 170 171 'mean_stage': project.tide, 171 172 # 'zscale': 1, #Enhance tsunami 172 'fail_on_NaN': False, 173 'inverted_bathymetry': True}, 173 'fail_on_NaN': False}, 174 174 verbose = True, 175 175 ) 176 176 # dependencies = source_dir + project.boundary_basename + '.sww') 177 177 ''' 178 178 179 179 -
anuga_work/production/dampier_2006/project.py
r3871 r3877 36 36 #mesh_name = 'elevation50m' 37 37 boundaries_name = 'dampier' 38 boundaries_source = ' test'39 40 tide = 0.038 boundaries_source = 'mag_9_corrected' 39 40 tide = 2.4 41 41 42 42 # topography file names … … 133 133 134 134 #only used to clip boundary condition 135 north_boundary = north + 0.0 4136 south_boundary = south - 0.0 4137 west_boundary = west - 0.0 4138 east_boundary = east + 0.0 4135 north_boundary = north + 0.02 136 south_boundary = south - 0.02 137 west_boundary = west - 0.02 138 east_boundary = east + 0.02 139 139 140 140 -
anuga_work/production/dampier_2006/run_dampier.py
r3871 r3877 34 34 from anuga.geospatial_data.geospatial_data import * 35 35 from anuga.abstract_2d_finite_volumes.util import Screen_Catcher 36 from anuga_parallel.parallel_api import distribute, numprocs, myid 36 37 37 38 # Application specific imports … … 53 54 boundaries_time_dir_name = project.boundaries_dir + build_time + sep + boundaries_name 54 55 55 #from anuga.shallow_water.data_manager import urs2sww56 57 # creates copy of code in output dir if dir doesn't exist58 if access(project.output_run_time_dir,F_OK) == 0:59 print 'project.output_run_time_dir',dirname(project.output_run_time_dir)60 mkdir (project.output_run_time_dir,0777)61 copy (dirname(project.__file__) +sep+ project.__name__+'.py',62 project.output_run_time_dir + project.__name__+'.py')63 copy (__file__, project.output_run_time_dir + basename(__file__))64 print 'project.output_run_time_dir',project.output_run_time_dir65 66 #normal screen output is stored in67 screen_output_name = project.output_run_time_dir + "screen_output.txt"68 screen_error_name = project.output_run_time_dir + "screen_error.txt"69 70 #used to catch screen output to file71 sys.stdout = Screen_Catcher(screen_output_name)72 sys.stderr = Screen_Catcher(screen_error_name)73 74 print 'USER: ', project.user75 76 #--------------------------------------------------------------------------77 # Create the triangular mesh based on overall clipping polygon with a78 # tagged79 # boundary and interior regions defined in project.py along with80 # resolutions (maximal area of per triangle) for each polygon81 #--------------------------------------------------------------------------82 83 interior_regions = [#[project.karratha_polygon, 25000],84 #[project.dampier_polygon, 2000],85 #[project.refinery_polygon, 2000],86 #[project.point_polygon, 2000]]87 #[project.cipma_polygon, 20000]]88 [project.cipma_polygon, 50000]] # Caused memory error?89 90 #---------------------------91 # this is check that no interior polygon is outside the bounding poly92 #------------------------------93 94 """95 count = 096 for i in range(len(interior_regions)):97 region = interior_regions[i]98 interior_polygon = region[0]99 if len(inside_polygon(interior_polygon, bounding_polygon,100 closed = True, verbose = False)) <> len(interior_polygon):101 print 'WARNING: interior polygon %d is outside bounding polygon' %(i)102 count += 1103 104 if count == 0:105 print 'interior regions OK'106 else:107 print 'check out your interior polygons'108 print 'check %s in production directory' %figname109 import sys; sys.exit()110 """111 #-------------------------------------112 113 print 'start create mesh from regions'114 meshes_dir_name = project.meshes_dir_name + '.msh'115 create_mesh_from_regions(project.bounding_polygon,116 boundary_tags={'back': [7, 8], 'side': [0, 6],117 'ocean': [1, 2, 3, 4, 5]},118 maximum_triangle_area=300000,119 interior_regions=interior_regions,120 filename=meshes_dir_name,121 use_cache=True,122 verbose=True)123 56 124 57 #------------------------------------------------------------------------- … … 128 61 domain = Domain(meshes_dir_name, use_cache=True, verbose=True) 129 62 print domain.statistics() 130 domain.set_name(project.scenario_name)131 domain.set_datadir(project.output_run_time_dir)132 domain.set_default_order(2)133 domain.set_minimum_storable_height(0.01) # Don't store anything less than 1cm134 135 63 136 64 … … 149 77 150 78 79 #------------------------------------------------------ 80 # Distribute domain to implement parallelism !!! 81 #------------------------------------------------------ 82 83 if numprocs > 1: 84 domain=distribute(domain) 85 86 87 #------------------------------------------------------ 88 # Set domain parameters 89 #------------------------------------------------------ 90 91 domain.set_name(project.scenario_name) 92 domain.set_datadir(project.output_run_time_dir) 93 domain.set_default_order(2) #associate to the spatial order of the triangle 94 domain.set_minimum_storable_height(0.01) # Don't store anything less than 1cm 95 96 151 97 #------------------------------------------------------------------------- 152 98 # Setup boundary conditions … … 159 105 Bf = File_boundary(boundaries_time_dir_name + '.sww', 160 106 domain, verbose = True) 161 #Bf = File_boundary(source_dir + project.boundary_scenario_name + '.sww',162 # domain, verbose = True)163 107 Br = Reflective_boundary(domain) 164 108 Bd = Dirichlet_boundary([tide,0,0])
Note: See TracChangeset
for help on using the changeset viewer.