Changeset 2058
- Timestamp:
- Nov 24, 2005, 10:41:14 AM (19 years ago)
- Location:
- production/gippsland_2005
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
production/gippsland_2005/project.py
r2044 r2058 4 4 5 5 from os import sep 6 from os import environ 6 7 from os.path import expanduser 7 8 import sys 8 9 9 10 #Making assumptions about the location of scenario data 11 # Assumes the INUNDATIONHOME environ variable exists 10 12 scenario_dir_name = 'gippsland_storm_surge_scenario_2005' 11 13 … … 15 17 16 18 if sys.platform == 'win32': 17 home = '..\..\..\..\..\..'#Sandpit's parent dir19 home = environ["INUNDATIONHOME"] #Sandpit's parent dir 18 20 else: 19 21 home = expanduser('~') -
production/gippsland_2005/run_small_gippsland.py
r2044 r2058 20 20 from pyvolution.data_manager import convert_dem_from_ascii2netcdf,\ 21 21 dem2pts, asc_csiro2sww 22 from pyvolution.pmesh2domain import pmesh_to_domain_instance 22 #from pyvolution.pmesh2domain import pmesh_to_domain_instance 23 from pyvolution.pmesh2domain import pmesh_instance_to_domain_instance 23 24 from caching import cache 24 25 import project 26 from create_mesh import create_mesh 25 27 26 28 #Data preparation 27 29 #Convert ASC 2 DEM 2 PTS using source data and store result in source data 28 30 demname = project.demname 29 31 demname = project.datadir + 'lakes_100' 30 32 # just interested in the boundary/ mesh intereaction first off. 31 33 #cache(convert_dem_from_ascii2netcdf, demname, {'verbose': True}, … … 34 36 # #evaluate = True) 35 37 36 #cache(dem2pts, demname, {'verbose': True},37 #dependencies = [demname + '.dem'],38 #verbose = True)38 cache(dem2pts, demname, {'verbose': True}, 39 dependencies = [demname + '.dem'], 40 verbose = True) 39 41 40 42 41 # Convert CSIRO boundary42 cache(ferret2sww, 43 (source_dir+project.boundary_basename, 44 project.boundary_basename), 45 {'bath_dir':project.bath_dir,46 'elevation_dir':project.elevation_dir,47 'ucur_dir':project.ucur_dir,48 'vcur_dir':project.vcur_dir,49 'sww_file':project.boundaryname + '.sww',50 'verbose': True,43 # Convert CSIRO boundary 44 # NOTE: This function is dependent on a lot of files, and I haven't listed 45 # them, since there is so many and I don't think they will be changing. 46 cache(asc_csiro2sww, 47 (project.bath_dir, 48 project.elevation_dir, 49 project.ucur_dir, 50 project.vcur_dir, 51 project.boundaryname + '.sww'), 52 {'verbose': True, 51 53 'minlat': -38.25, 52 54 'maxlat': -37.7, … … 55 57 'mean_stage': project.tide, 56 58 'zscale': 1, #Enhance tsunami 57 'fail_on_NaN': False, 58 'inverted_bathymetry': True}, 59 'fail_on_NaN': False}, 59 60 #evaluate = True, 60 61 verbose = True) 62 63 64 #Create the mesh .. 65 66 #cache this, with dependancy on create_mesh.py 67 mesh, triagle_count = create_mesh(10000000) 68 69 70 #meshname = project.meshname + '_%d.msh' %resolution 71 #meshname = project.meshdir + 'lakes_small_100.msh' 72 73 74 #Setup domain 75 76 domain = cache(pmesh_instance_to_domain_instance, (mesh, Domain), 77 #dependencies = [meshname], 78 verbose = True) 79 80 81 domain.set_name(project.basename) # + '_%d' %resolution) 82 domain.set_datadir(project.outputdir) 83 domain.store = True 84 #domain.smooth = False 85 86 87 #domain.quantities_to_be_stored = ['stage', 'xmomentum', 'ymomentum'] 88 domain.quantities_to_be_stored = ['stage'] 89 90 print 'Number of triangles = ', len(domain) 91 print 'The extent is ', domain.get_extent() 92 93 94 95 #Setup Initial Conditions 96 domain.set_quantity('friction', 0) 97 domain.set_quantity('stage', project.tide) 98 domain.set_quantity('elevation', 99 filename = demname + '.pts', 100 use_cache = True, 101 verbose = True) 102 103 104 105 #Setup Boundary Conditions 106 print domain.get_boundary_tags() 107 108 Bf = File_boundary(project.boundary_basename + '.sww', domain, verbose = True) 109 #domain.starttime = 3000 #Obtained from MOST 110 domain.starttime = 0 #Obtained from MOST 111 112 Br = Reflective_boundary(domain) 113 Bt = Transmissive_boundary(domain) 114 Bd = Dirichlet_boundary([tide,0,0]) 115 Bw = Time_boundary(domain=domain, 116 f=lambda t: [(60<t<660)*4, 0, 0]) 117 118 119 domain.set_boundary( {'back': Br,'side': Bd, 'ocean': Bf} ) #MOST tsunami 120 121 #domain.set_boundary( {'back': Bd,'side': Bd, 'ocean': Bd} ) #Nothing 122 123 124 #Evolve 125 import time 126 t0 = time.time() 127 128 for t in domain.evolve(yieldstep = 60, finaltime = 40000): 129 # skip_initial_step = True): 130 domain.write_time() 131 domain.write_boundary_statistics(tags = 'ocean') #quantities = 'stage') 132 133 print 'That took %.2f seconds' %(time.time()-t0)
Note: See TracChangeset
for help on using the changeset viewer.