Changeset 2093
- Timestamp:
- Nov 29, 2005, 2:43:38 PM (19 years ago)
- Location:
- production/gippsland_2005
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
production/gippsland_2005/create_mesh.py
r2084 r2093 61 61 + mesh_file[-4:] 62 62 m.export_mesh_file(mesh_file) 63 return triangle_count63 return mesh_file, triangle_count 64 64 65 65 -
production/gippsland_2005/project.py
r2086 r2093 10 10 #Making assumptions about the location of scenario data 11 11 # Assumes the INUNDATIONHOME environ variable exists 12 def Project():13 def __init__(self):14 scenario_dir_name = 'gippsland_storm_surge_scenario_2005'15 basename = 'lakes_100'16 boundary_basename = 'csiro_bondary'17 12 18 if sys.platform == 'win32': 19 home = environ["INUNDATIONHOME"] #Sandpit's parent dir 20 else: 21 home = expanduser('~') 13 scenario_dir_name = 'gippsland_storm_surge_scenario_2005' 14 basename = 'lakes_100' 15 boundary_basename = 'csiro_bondary' 16 17 if sys.platform == 'win32': 18 home = environ["INUNDATIONHOME"] #Sandpit's parent dir 19 else: 20 home = expanduser('~') 22 21 23 22 24 25 26 27 28 29 30 31 32 23 #Derive subdirectories and filenames 24 meshdir = home+sep+scenario_dir_name+sep+'meshes'+sep 25 datadir = home+sep+scenario_dir_name+sep+'topographies'+sep 26 outputdir = home+sep+scenario_dir_name+sep+'output'+sep 27 boundarydir = home+sep+scenario_dir_name+sep+'boundaries'+sep 28 bath_dir = boundarydir + 'bathymetry_expanded' 29 elevation_dir = boundarydir + 'elev_expanded' 30 ucur_dir = boundarydir + 'ucur_expanded' 31 vcur_dir = boundarydir + 'vcur_expanded' 33 32 34 meshname = meshdir + basename + '.msh' 35 mesh_elevname = meshdir + basename + '_elev' + '.msh' 36 demname = datadir + basename + '.dem' 37 pointname = datadir + basename + '.pts' 38 boundaryname = boundarydir + boundary_basename + '.sww' 39 outputname = outputdir + basename + '.sww' #Used by post processing 33 meshname = meshdir + basename + '.msh' 34 mesh_elevname = meshdir + basename + '_elev' + '.msh' 35 demname = datadir + basename + '.dem' 36 #demname = datadir + 'lakes_100' 37 pointname = datadir + basename + '.pts' 38 boundaryname = boundarydir + boundary_basename + '.sww' 39 outputname = outputdir + basename + '.sww' #Used by post processing 40 40 41 41 gauge_filename = 'all_bld_ind.csv' 42 42 43 43 tide = 0.0 44 44 45 46 def update_names(new_info):47 """48 Update the mesh_elevname and outputname, based on the string passed in.49 Used to add the number of triangles to names.50 51 """52 self.mesh_elevname = self.mesh_elevname[:-9] + '_' + \53 str(new_info) + \54 self.mesh_elevname[-9:]55 self.outputname = self.outputname[:-4] + '_' + str(new_info) \56 + self.outputname[-4:]57 45 58 46 #------------------------------------------------------------- -
production/gippsland_2005/run_gippsland.py
r2084 r2093 49 49 ) 50 50 51 meshname = project.meshname 52 pointname = project.pointname 53 mesh_elevname = project.mesh_elevname 54 outputname = project.outputname 51 55 52 56 #Create the mesh without elevation data 53 57 # 100000 very course 54 triagle_count = cache(create_mesh,(5000),55 {'mesh_file': project.meshname,58 meshname, triagle_count = cache(create_mesh,(5000), 59 {'mesh_file':meshname, 56 60 'triangles_in_name':True} 57 61 ,dependencies = ['create_mesh.py'] 58 62 #,evaluate = True 59 63 ) 60 print "project.meshname",project.meshname 61 project.update_names(triagle_count) 62 print "project.meshname",project.meshname 64 65 mesh_elevname = mesh_elevname[:-9] + '_' + str(triagle_count) + \ 66 mesh_elevname[-9:] 67 outputname = outputname[:-4] + '_' + str(triagle_count) + outputname[-4:] 68 63 69 64 70 #Add elevation data to the mesh 65 71 #fit_to_mesh_file(mesh_file, point_file, mesh_output_file, DEFAULT_ALPHA, 66 72 # verbose=True, expand_search=True, precrop=True) 67 cache(fit_to_mesh_file,( project.meshname,68 p roject.pointname,69 project.mesh_elevname,73 cache(fit_to_mesh_file,(meshname, 74 pointname, 75 mesh_elevname, 70 76 DEFAULT_ALPHA), 71 77 {'verbose': True, 72 78 'expand_search': True, 73 79 'precrop': True} 74 ,dependencies = [ project.meshname, project.pointname]80 ,dependencies = [meshname, pointname] 75 81 ,evaluate = True 76 82 ,verbose = False … … 79 85 80 86 #Setup domain 81 domain = cache(pmesh_to_domain_instance, ( project.mesh_elevname, Domain),82 dependencies = [ project.mesh_elevname]87 domain = cache(pmesh_to_domain_instance, (mesh_elevname, Domain), 88 dependencies = [mesh_elevname] 83 89 ,verbose = False 84 90 )
Note: See TracChangeset
for help on using the changeset viewer.