Changeset 4147 for anuga_work/production/dampier_2006/run_dampier.py
- Timestamp:
- Jan 8, 2007, 5:59:47 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_work/production/dampier_2006/run_dampier.py
r4066 r4147 6 6 7 7 The scenario is defined by a triangular mesh created from project.polygon, 8 the elevation data and a simulated submarine landslide.8 the elevation data and a simulated tsunami generated with URS code. 9 9 10 10 Ole Nielsen and Duncan Gray, GA - 2005 and Jane Sexton, Nick Bartzis, GA - 2006 … … 23 23 import sys 24 24 25 26 25 # Related major packages 27 26 from anuga.shallow_water import Domain … … 32 31 33 32 from anuga.pmesh.mesh_interface import create_mesh_from_regions 34 35 from anuga.geospatial_data.geospatial_data import *36 33 from anuga.abstract_2d_finite_volumes.util import start_screen_catcher, copy_code_files 37 34 from anuga_parallel.parallel_api import distribute, numprocs, myid, barrier … … 45 42 #------------------------------------------------------------------------------ 46 43 44 start_screen_catcher(project.output_run_time_dir, myid, numprocs) 47 45 48 46 # filenames 49 50 #build_time = '20061029_231935_build_tide_24'51 #build_time = '20061030_165746_build_tide_24'52 #build_time = '20061102_215532_build_plus_old_data'53 #build_time = '20061103_055258_build'54 47 build_time = '20061107_063840_build' 55 #build_time = '20061025_153643_build_basic'56 48 bound_time = '20061102_221245_build' 57 49 58 50 boundaries_name = project.boundaries_name 59 #meshes_time_dir_name = project.meshes_time_dir_name+'.msh'60 51 meshes_dir_name = project.meshes_dir_name+'.msh' 61 #source_dir = project.boundarydir62 #boundaries_time_dir_name = project.boundaries_dir + build_time + sep + boundaries_name63 boundaries_time_dir_name = project.boundaries_time_dir_name64 52 boundaries_dir_name = project.boundaries_dir_name 53 65 54 tide = project.tide 66 55 … … 70 59 dirname(project.__file__)+sep+ project.__name__+'.py' ) 71 60 barrier() 72 #start_screen_catcher(project.output_run_time_dir, myid, numprocs)73 61 74 62 print 'USER: ', project.user 75 #sys.exit() 63 print 'min triangles', project.trigs_min, 64 print 'Note: This is generally about 20% less than the final amount' 65 76 66 #-------------------------------------------------------------------------- 77 67 # Create the triangular mesh based on overall clipping polygon with a … … 84 74 85 75 print 'start create mesh from regions' 86 interior_regions = [#[project.karratha_polygon, 25000], 87 [project.poly_coast, 10000], 88 [project.poly_pipeline, 2000], 89 [project.poly_facility, 500]] 90 # [project.poly_interior, 1000]] 91 from anuga.utilities.polygon import plot_polygons 92 figname = project.output_run_time_dir + 'poly_pic' 93 plot_polygons([project.poly_coast,project.poly_pipeline,project.poly_facility, 94 project.bounding_polygon], 95 figname, 96 verbose = True) 97 # if access(project.meshes_time_dir,F_OK) == 0: 98 # mkdir(project.meshes_time_dir) 99 # if access(project.meshes_dir,F_OK) == 0: 100 # mkdir(project.meshes_dir) 101 import sys; sys.exit() 102 print 'start create mesh from regions' 103 interior_regions = [#[project.karratha_polygon, 25000], 104 # [project.cipma_polygon, 1000], 105 # [project.poly_pipeline, 5000], 106 # [project.poly_facility, 500]] 107 [project.poly_interior, 1000]] 108 # meshes_dir_name = project.meshes_dir_name + '.msh' 109 110 create_mesh_from_regions(project.bounding_polygon, 111 boundary_tags={'back': [7, 8], 'side': [0, 6], 112 'ocean': [1, 2, 3, 4, 5]}, 113 maximum_triangle_area=100000, 114 interior_regions=interior_regions, 115 # filename=meshes_time_dir_name, 116 filename=meshes_dir_name, 117 use_cache=True, 118 verbose=True) 76 create_mesh_from_regions(project.poly_all, 77 boundary_tags={'back': [7, 8], 'side': [0, 6], 78 'ocean': [1, 2, 3, 4, 5]}, 79 maximum_triangle_area=project.res_poly_all, 80 interior_regions=project.interior_regions, 81 filename=meshes_dir_name, 82 use_cache=True, 83 verbose=True) 119 84 120 85 # to sync all processors are ready … … 125 90 #------------------------------------------------------------------------- 126 91 print 'Setup computational domain' 127 #domain = Domain(meshes_time_dir_name, use_cache=True, verbose=True)128 92 domain = Domain(meshes_dir_name, use_cache=True, verbose=True) 129 93 print domain.statistics() 130 94 95 """ 131 96 print 'starting to create boundary conditions' 132 97 boundaries_in_dir_name = project.boundaries_in_dir_name 133 98 134 from anuga.shallow_water.data_manager import urs2sww, ferret2sww 135 136 print 'maxlat=project.south_boundary, minlat=project.north_boundary', project.south_boundary,project.north_boundary 137 print 'minlon= project.west_boundary, maxlon=project.east_boundary',project.west_boundary, project.east_boundary 138 print ' maxlon=project.east',project.east 139 140 print 'origin: domain.geo_reference.get_origin()',domain.geo_reference.get_origin() 141 142 #import sys; sys.exit() 143 144 #if access(project.boundaries_time_dir,F_OK) == 0: 145 # mkdir (project.boundaries_time_dir) 99 from anuga.shallow_water.data_manager import urs2sw 100 146 101 # put above distribute 147 102 print 'boundary file is: ',boundaries_dir_name 148 103 from caching import cache 149 104 if myid == 0: 150 cache( ferret2sww,105 cache(urs2sww, 151 106 (boundaries_in_dir_name, 152 107 # boundaries_time_dir_name), … … 169 124 ) 170 125 barrier() 171 126 """ 172 127 173 128 #------------------------------------------------------------------------- … … 179 134 180 135 domain.set_quantity('stage', tide) 181 domain.set_quantity('friction', 0.0 )136 domain.set_quantity('friction', 0.01) 182 137 #combined_time_dir_name = project.topographies_dir+build_time+project.combined_name 183 138 print 'Start Set quantity' 184 139 185 186 140 domain.set_quantity('elevation', 187 filename = project. topographies_dir + build_time + sep + project.combined_final_name + '.pts',141 filename = project.combined_dir_name + '.txt', 188 142 use_cache = True, 189 143 verbose = True, 190 144 alpha = 0.1) 191 #domain.set_quantity('elevation', -50)192 145 print 'Finished Set quantity' 193 146 barrier() … … 211 164 domain.set_store_vertices_uniquely(False) 212 165 domain.set_quantities_to_be_stored(['stage', 'xmomentum', 'ymomentum']) 213 domain.set_maximum_allowed_speed(0. 0) # Allow a little runoff (0.1 is OK)166 domain.set_maximum_allowed_speed(0.1) # Allow a little runoff (0.1 is OK) 214 167 215 168 #------------------------------------------------------------------------- … … 217 170 #------------------------------------------------------------------------- 218 171 print 'Available boundary tags', domain.get_boundary_tags() 219 172 print 'domain id', id(domain) 220 173 print 'Reading Boundary file' 221 #boundariesname = project.boundaries_dir + '20061101_003322_build'+sep+boundaries_name 222 #print'boundariesname',boundariesname 223 #Bf = File_boundary(boundaries_time_dir_name + '.sww', 224 225 #Bf = File_boundary(boundariesname + '.sww', 226 227 print 'domain id', id(domain) 228 Bf = File_boundary(boundaries_dir_name + '.sww', 229 domain, time_thinning=5, use_cache=True, verbose=True) 174 #Bf = File_boundary(boundaries_dir_name + '.sww', 175 # domain, time_thinning=5, use_cache=True, verbose=True) 230 176 231 177 print 'finished reading boundary file' … … 246 192 t0 = time.time() 247 193 248 #for t in domain.evolve(yieldstep = 60, finaltime = 34000): 194 for t in domain.evolve(yieldstep = 60, finaltime = 34000): 195 domain.write_time() 196 domain.write_boundary_statistics(tags = 'ocean') 197 198 #for t in domain.evolve(yieldstep = 120, finaltime = 9000): 249 199 # domain.write_time() 250 200 # domain.write_boundary_statistics(tags = 'ocean') 251 252 for t in domain.evolve(yieldstep = 120, finaltime = 9000):253 domain.write_time()254 domain.write_boundary_statistics(tags = 'ocean')255 # print 'time: ',time.time()256 257 if allclose(t, 6000):258 domain.set_quantity('xmomentum', 0)259 domain.set_quantity('ymomentum', 0)260 #import sys; sys.exit()261 201 262 for t in domain.evolve(yieldstep = 60, finaltime = 28800263 ,skip_initial_step = True):264 domain.write_time()265 domain.write_boundary_statistics(tags = 'ocean')266 267 for t in domain.evolve(yieldstep = 120, finaltime = 34800268 ,skip_initial_step = True):269 domain.write_time()270 domain.write_boundary_statistics(tags = 'ocean')202 #for t in domain.evolve(yieldstep = 60, finaltime = 28800 203 # ,skip_initial_step = True): 204 # domain.write_time() 205 # domain.write_boundary_statistics(tags = 'ocean') 206 207 #for t in domain.evolve(yieldstep = 120, finaltime = 34800 208 # ,skip_initial_step = True): 209 # domain.write_time() 210 # domain.write_boundary_statistics(tags = 'ocean') 271 211 272 212 print 'That took %.2f seconds' %(time.time()-t0)
Note: See TracChangeset
for help on using the changeset viewer.