Changeset 6460
- Timestamp:
- Mar 5, 2009, 10:20:00 AM (14 years ago)
- Location:
- anuga_work/production/australia_ph2
- Files:
-
- 21 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_work/production/australia_ph2/adelaide/project.py
r6387 r6460 32 32 finaltime=1000 # final time for simulation 33 33 34 # index is only used when wave = Tb 35 index = 1203 # index from the PTHA 36 wave = 'Tb' # Bf (sts wave) Tb (index wave) 37 34 38 setup = 'trial' # This can be one of three values 35 39 # trial - coarsest mesh, fast … … 48 52 #------------------------------------------------------------------------------- 49 53 50 output_comment = [setup, tide, event_number ]54 output_comment = [setup, tide, event_number, index, wave] 51 55 52 56 #------------------------------------------------------------------------------- -
anuga_work/production/australia_ph2/adelaide/run_model.py
r6387 r6460 35 35 from anuga.interface import Reflective_boundary 36 36 from anuga.interface import Field_boundary 37 from anuga.interface import Time_boundary 38 from anuga.interface import file_function 39 37 40 from anuga.interface import create_sts_boundary 38 41 from anuga.interface import csv2building_polygons … … 47 50 from setup_model import project 48 51 import build_urs_boundary as bub 49 52 import prepare_timeboundary as TB 50 53 51 54 #------------------------------------------------------------------------------- … … 69 72 # Create the STS file 70 73 print 'project.mux_data_folder=%s' % project.mux_data_folder 71 event_sts_path = os.path.join(project.event_folder, project.scenario_name) 72 if not os.path.exists(event_sts_path + '.sts'): 73 bub.build_urs_boundary(project.mux_input_filename, event_sts_path) 74 if not os.path.exists(project.event_sts + '.sts'): 75 bub.build_urs_boundary(project.mux_input_filename, project.event_sts) 74 76 75 77 # Read in boundary from ordered sts file … … 116 118 print 'Setup initial conditions' 117 119 118 # ##Set the initial stage in the offcoast region only120 # Set the initial stage in the offcoast region only 119 121 if project.land_initial_conditions: 120 122 IC = Polygon_function(project.land_initial_conditions, … … 123 125 else: 124 126 IC = 0 125 126 127 domain.set_quantity('stage', IC, use_cache=True, verbose=True) 127 128 domain.set_quantity('friction', project.friction) … … 138 139 print 'Set boundary - available tags:', domain.get_boundary_tags() 139 140 141 # Prepare time boundary 142 TB.prepare_timeboundary(project.boundary_csv) 143 f = file_function(project.boundary_csv[:-4] + '.tms') 144 140 145 Br = Reflective_boundary(domain) 141 146 Bt = Transmissive_stage_zero_momentum_boundary(domain) 142 147 Bd = Dirichlet_boundary([project.tide, 0, 0]) 143 Bf = Field_boundary(project.event_sts+'.sts',144 domain, mean_stage=project.tide,145 time_thinning=1,146 default_boundary=Bd,147 boundary_polygon=bounding_polygon_sts,148 use_cache=True,149 verbose=True)150 148 151 domain.set_boundary({'back': Br, 149 if project.wave == 'Bf': 150 Bf = Field_boundary(project.event_sts+'.sts', 151 domain, mean_stage=project.tide, 152 time_thinning=1, 153 default_boundary=Bd, 154 boundary_polygon=bounding_polygon_sts, 155 use_cache=True, 156 verbose=True) 157 domain.set_boundary({'back': Br, 152 158 'side': Bd, 153 159 'ocean': Bf}) 160 161 elif project.wave == 'Tb': 162 Tb = Time_boundary(domain,f,default_boundary=Bd ) 163 164 domain.set_boundary({'back': Br, 165 'side': Bd, 166 'ocean': Tb}) 167 else: 168 print 'No wave specified in project script (Bf or Tb)' 169 154 170 155 171 #------------------------------------------------------------------------------- -
anuga_work/production/australia_ph2/broome/project.py
r6382 r6460 33 33 finaltime=1000 # final time for simulation 34 34 35 # index is only used when wave = Tb 36 index = 1203 # index from the PTHA 37 wave = 'Tb' # Bf (sts wave) Tb (index wave) 38 39 35 40 setup = 'trial' # This can be one of three values 36 41 # trial - coarsest mesh, fast … … 49 54 #------------------------------------------------------------------------------- 50 55 51 output_comment = [setup, tide, event_number ]56 output_comment = [setup, tide, event_number, index, wave] 52 57 53 58 #------------------------------------------------------------------------------- -
anuga_work/production/australia_ph2/broome/run_model.py
r6382 r6460 35 35 from anuga.interface import Reflective_boundary 36 36 from anuga.interface import Field_boundary 37 from anuga.interface import Time_boundary 38 from anuga.interface import file_function 39 37 40 from anuga.interface import create_sts_boundary 38 41 from anuga.interface import csv2building_polygons … … 47 50 from setup_model import project 48 51 import build_urs_boundary as bub 52 import prepare_timeboundary as TB 49 53 50 54 #------------------------------------------------------------------------------- … … 135 139 print 'Set boundary - available tags:', domain.get_boundary_tags() 136 140 141 # Prepare time boundary 142 TB.prepare_timeboundary(project.boundary_csv) 143 f = file_function(project.boundary_csv[:-4] + '.tms') 144 137 145 Br = Reflective_boundary(domain) 138 146 Bt = Transmissive_stage_zero_momentum_boundary(domain) 139 147 Bd = Dirichlet_boundary([project.tide, 0, 0]) 140 Bf = Field_boundary(project.event_sts+'.sts',141 domain, mean_stage=project.tide,142 time_thinning=1,143 default_boundary=Bd,144 boundary_polygon=bounding_polygon_sts,145 use_cache=True,146 verbose=True)147 148 148 domain.set_boundary({'back': Br, 149 if project.wave == 'Bf': 150 Bf = Field_boundary(project.event_sts+'.sts', 151 domain, mean_stage=project.tide, 152 time_thinning=1, 153 default_boundary=Bd, 154 boundary_polygon=bounding_polygon_sts, 155 use_cache=True, 156 verbose=True) 157 domain.set_boundary({'back': Br, 149 158 'side': Bd, 150 159 'ocean': Bf}) 160 161 elif project.wave == 'Tb': 162 Tb = Time_boundary(domain,f,default_boundary=Bd ) 163 164 domain.set_boundary({'back': Br, 165 'side': Bd, 166 'ocean': Tb}) 167 else: 168 print 'No wave specified in project script (Bf or Tb)' 169 151 170 152 171 #------------------------------------------------------------------------------- -
anuga_work/production/australia_ph2/carnarvon/project.py
r6412 r6460 34 34 finaltime=1000 # final time for simulation 35 35 36 setup = 'trial' # This can be one of three values 36 # index is only used when wave = Tb 37 index = 1203 # index from the PTHA 38 wave = 'Tb' # Bf (sts wave) Tb (index wave) 39 40 setup = 'final' # This can be one of three values 37 41 # trial - coarsest mesh, fast 38 42 # basic - coarse mesh … … 50 54 #------------------------------------------------------------------------------- 51 55 52 output_comment = [setup, tide, event_number ]56 output_comment = [setup, tide, event_number, index, wave] 53 57 54 58 #------------------------------------------------------------------------------- -
anuga_work/production/australia_ph2/carnarvon/run_model.py
r6412 r6460 35 35 from anuga.interface import Reflective_boundary 36 36 from anuga.interface import Field_boundary 37 from anuga.interface import Time_boundary 38 from anuga.interface import file_function 39 37 40 from anuga.interface import create_sts_boundary 38 41 from anuga.interface import csv2building_polygons … … 47 50 from setup_model import project 48 51 import build_urs_boundary as bub 52 import prepare_timeboundary as TB 49 53 50 54 #------------------------------------------------------------------------------- … … 135 139 print 'Set boundary - available tags:', domain.get_boundary_tags() 136 140 141 # Prepare time boundary 142 TB.prepare_timeboundary(project.boundary_csv) 143 f = file_function(project.boundary_csv[:-4] + '.tms') 144 137 145 Br = Reflective_boundary(domain) 138 146 Bt = Transmissive_stage_zero_momentum_boundary(domain) 139 147 Bd = Dirichlet_boundary([project.tide, 0, 0]) 140 Bf = Field_boundary(project.event_sts+'.sts',141 domain, mean_stage=project.tide,142 time_thinning=1,143 default_boundary=Bd,144 boundary_polygon=bounding_polygon_sts,145 use_cache=True,146 verbose=True)147 148 148 domain.set_boundary({'back': Br, 149 if project.wave == 'Bf': 150 Bf = Field_boundary(project.event_sts+'.sts', 151 domain, mean_stage=project.tide, 152 time_thinning=1, 153 default_boundary=Bd, 154 boundary_polygon=bounding_polygon_sts, 155 use_cache=True, 156 verbose=True) 157 domain.set_boundary({'back': Br, 149 158 'side': Bd, 150 159 'ocean': Bf}) 160 161 elif project.wave == 'Tb': 162 Tb = Time_boundary(domain,f,default_boundary=Bd ) 163 164 domain.set_boundary({'back': Br, 165 'side': Bd, 166 'ocean': Tb}) 167 else: 168 print 'No wave specified in project script (Bf or Tb)' 169 151 170 152 171 #------------------------------------------------------------------------------- -
anuga_work/production/australia_ph2/ceduna/project.py
r6402 r6460 34 34 finaltime=1000 # final time for simulation 35 35 36 # index is only used when wave = Tb 37 index = 1203 # index from the PTHA 38 wave = 'Tb' # Bf (sts wave) Tb (index wave) 39 36 40 setup = 'final' # This can be one of three values 37 41 # trial - coarsest mesh, fast … … 50 54 #------------------------------------------------------------------------------- 51 55 52 output_comment = [setup, tide, event_number ]56 output_comment = [setup, tide, event_number, index, wave] 53 57 54 58 #------------------------------------------------------------------------------- -
anuga_work/production/australia_ph2/ceduna/run_model.py
r6402 r6460 35 35 from anuga.interface import Reflective_boundary 36 36 from anuga.interface import Field_boundary 37 from anuga.interface import Time_boundary 38 from anuga.interface import file_function 39 37 40 from anuga.interface import create_sts_boundary 38 41 from anuga.interface import csv2building_polygons … … 47 50 from setup_model import project 48 51 import build_urs_boundary as bub 52 import prepare_timeboundary as TB 49 53 50 54 #------------------------------------------------------------------------------- … … 135 139 print 'Set boundary - available tags:', domain.get_boundary_tags() 136 140 141 # Prepare time boundary 142 TB.prepare_timeboundary(project.boundary_csv) 143 f = file_function(project.boundary_csv[:-4] + '.tms') 144 137 145 Br = Reflective_boundary(domain) 138 146 Bt = Transmissive_stage_zero_momentum_boundary(domain) 139 147 Bd = Dirichlet_boundary([project.tide, 0, 0]) 140 Bf = Field_boundary(project.event_sts+'.sts',141 domain, mean_stage=project.tide,142 time_thinning=1,143 default_boundary=Bd,144 boundary_polygon=bounding_polygon_sts,145 use_cache=True,146 verbose=True)147 148 148 domain.set_boundary({'back': Br, 149 if project.wave == 'Bf': 150 Bf = Field_boundary(project.event_sts+'.sts', 151 domain, mean_stage=project.tide, 152 time_thinning=1, 153 default_boundary=Bd, 154 boundary_polygon=bounding_polygon_sts, 155 use_cache=True, 156 verbose=True) 157 domain.set_boundary({'back': Br, 149 158 'side': Bd, 150 159 'ocean': Bf}) 160 161 elif project.wave == 'Tb': 162 Tb = Time_boundary(domain,f,default_boundary=Bd ) 163 164 domain.set_boundary({'back': Br, 165 'side': Bd, 166 'ocean': Tb}) 167 else: 168 print 'No wave specified in project script (Bf or Tb)' 169 151 170 152 171 #------------------------------------------------------------------------------- -
anuga_work/production/australia_ph2/dampier/project.py
r6443 r6460 30 30 zone = 50 # specify zone of model 31 31 event_number = 70028 # the event number or the mux file name 32 index = 120333 32 alpha = 0.1 # smoothing parameter for mesh 34 33 friction=0.01 # manning's friction coefficient 35 34 starttime=0 # start time for simulation 36 35 finaltime=80000 # final time for simulation 36 37 # index is only used when wave = Tb 38 index = 1203 # index from the PTHA 39 wave = 'Tb' # Bf (sts wave) Tb (index wave) 37 40 38 41 setup = 'trial' # This can be one of three values … … 52 55 #------------------------------------------------------------------------------- 53 56 54 output_comment = [setup, tide, event_number ]57 output_comment = [setup, tide, event_number, index, wave] 55 58 56 59 #------------------------------------------------------------------------------- -
anuga_work/production/australia_ph2/esperance/project.py
r6433 r6460 34 34 finaltime=1000 # final time for simulation 35 35 36 # index is only used when wave = Tb 37 index = 1203 # index from the PTHA 38 wave = 'Tb' # Bf (sts wave) Tb (index wave) 39 36 40 setup = 'final' # This can be one of three values 37 41 # trial - coarsest mesh, fast … … 50 54 #------------------------------------------------------------------------------- 51 55 52 output_comment = [setup, tide, event_number ]56 output_comment = [setup, tide, event_number, index, wave] 53 57 54 58 #------------------------------------------------------------------------------- -
anuga_work/production/australia_ph2/esperance/run_model.py
r6399 r6460 35 35 from anuga.interface import Reflective_boundary 36 36 from anuga.interface import Field_boundary 37 from anuga.interface import Time_boundary 38 from anuga.interface import file_function 39 37 40 from anuga.interface import create_sts_boundary 38 41 from anuga.interface import csv2building_polygons … … 47 50 from setup_model import project 48 51 import build_urs_boundary as bub 52 import prepare_timeboundary as TB 49 53 50 54 #------------------------------------------------------------------------------- … … 135 139 print 'Set boundary - available tags:', domain.get_boundary_tags() 136 140 141 # Prepare time boundary 142 TB.prepare_timeboundary(project.boundary_csv) 143 f = file_function(project.boundary_csv[:-4] + '.tms') 144 137 145 Br = Reflective_boundary(domain) 138 146 Bt = Transmissive_stage_zero_momentum_boundary(domain) 139 147 Bd = Dirichlet_boundary([project.tide, 0, 0]) 140 Bf = Field_boundary(project.event_sts+'.sts',141 domain, mean_stage=project.tide,142 time_thinning=1,143 default_boundary=Bd,144 boundary_polygon=bounding_polygon_sts,145 use_cache=True,146 verbose=True)147 148 148 domain.set_boundary({'back': Br, 149 if project.wave == 'Bf': 150 Bf = Field_boundary(project.event_sts+'.sts', 151 domain, mean_stage=project.tide, 152 time_thinning=1, 153 default_boundary=Bd, 154 boundary_polygon=bounding_polygon_sts, 155 use_cache=True, 156 verbose=True) 157 domain.set_boundary({'back': Br, 149 158 'side': Bd, 150 159 'ocean': Bf}) 160 161 elif project.wave == 'Tb': 162 Tb = Time_boundary(domain,f,default_boundary=Bd ) 163 164 domain.set_boundary({'back': Br, 165 'side': Bd, 166 'ocean': Tb}) 167 else: 168 print 'No wave specified in project script (Bf or Tb)' 169 151 170 152 171 #------------------------------------------------------------------------------- -
anuga_work/production/australia_ph2/eucla_motel/project.py
r6433 r6460 34 34 finaltime=1000 # final time for simulation 35 35 36 # index is only used when wave = Tb 37 index = 1203 # index from the PTHA 38 wave = 'Tb' # Bf (sts wave) Tb (index wave) 39 36 40 setup = 'final' # This can be one of three values 37 41 # trial - coarsest mesh, fast … … 50 54 #------------------------------------------------------------------------------- 51 55 52 output_comment = [setup, tide, event_number ]56 output_comment = [setup, tide, event_number, index, wave] 53 57 54 58 #------------------------------------------------------------------------------- -
anuga_work/production/australia_ph2/eucla_motel/run_model.py
r6399 r6460 35 35 from anuga.interface import Reflective_boundary 36 36 from anuga.interface import Field_boundary 37 from anuga.interface import Time_boundary 38 from anuga.interface import file_function 39 37 40 from anuga.interface import create_sts_boundary 38 41 from anuga.interface import csv2building_polygons … … 47 50 from setup_model import project 48 51 import build_urs_boundary as bub 52 import prepare_timeboundary as TB 49 53 50 54 #------------------------------------------------------------------------------- … … 135 139 print 'Set boundary - available tags:', domain.get_boundary_tags() 136 140 141 # Prepare time boundary 142 TB.prepare_timeboundary(project.boundary_csv) 143 f = file_function(project.boundary_csv[:-4] + '.tms') 144 137 145 Br = Reflective_boundary(domain) 138 146 Bt = Transmissive_stage_zero_momentum_boundary(domain) 139 147 Bd = Dirichlet_boundary([project.tide, 0, 0]) 140 Bf = Field_boundary(project.event_sts+'.sts',141 domain, mean_stage=project.tide,142 time_thinning=1,143 default_boundary=Bd,144 boundary_polygon=bounding_polygon_sts,145 use_cache=True,146 verbose=True)147 148 148 domain.set_boundary({'back': Br, 149 if project.wave == 'Bf': 150 Bf = Field_boundary(project.event_sts+'.sts', 151 domain, mean_stage=project.tide, 152 time_thinning=1, 153 default_boundary=Bd, 154 boundary_polygon=bounding_polygon_sts, 155 use_cache=True, 156 verbose=True) 157 domain.set_boundary({'back': Br, 149 158 'side': Bd, 150 159 'ocean': Bf}) 160 161 elif project.wave == 'Tb': 162 Tb = Time_boundary(domain,f,default_boundary=Bd ) 163 164 domain.set_boundary({'back': Br, 165 'side': Bd, 166 'ocean': Tb}) 167 else: 168 print 'No wave specified in project script (Bf or Tb)' 169 151 170 152 171 #------------------------------------------------------------------------------- -
anuga_work/production/australia_ph2/gold_coast/project.py
r6393 r6460 34 34 finaltime=1000 # final time for simulation 35 35 36 setup = 'trial' # This can be one of three values 36 # index is only used when wave = Tb 37 index = 1203 # index from the PTHA 38 wave = 'Tb' # Bf (sts wave) Tb (index wave) 39 40 setup = 'final' # This can be one of three values 37 41 # trial - coarsest mesh, fast 38 42 # basic - coarse mesh … … 50 54 #------------------------------------------------------------------------------- 51 55 52 output_comment = [setup, tide, event_number ]56 output_comment = [setup, tide, event_number, index, wave] 53 57 54 58 #------------------------------------------------------------------------------- -
anuga_work/production/australia_ph2/gold_coast/run_model.py
r6393 r6460 35 35 from anuga.interface import Reflective_boundary 36 36 from anuga.interface import Field_boundary 37 from anuga.interface import Time_boundary 38 from anuga.interface import file_function 39 37 40 from anuga.interface import create_sts_boundary 38 41 from anuga.interface import csv2building_polygons … … 47 50 from setup_model import project 48 51 import build_urs_boundary as bub 52 import prepare_timeboundary as TB 49 53 50 54 #------------------------------------------------------------------------------- … … 135 139 print 'Set boundary - available tags:', domain.get_boundary_tags() 136 140 141 # Prepare time boundary 142 TB.prepare_timeboundary(project.boundary_csv) 143 f = file_function(project.boundary_csv[:-4] + '.tms') 144 137 145 Br = Reflective_boundary(domain) 138 146 Bt = Transmissive_stage_zero_momentum_boundary(domain) 139 147 Bd = Dirichlet_boundary([project.tide, 0, 0]) 140 Bf = Field_boundary(project.event_sts+'.sts',141 domain, mean_stage=project.tide,142 time_thinning=1,143 default_boundary=Bd,144 boundary_polygon=bounding_polygon_sts,145 use_cache=True,146 verbose=True)147 148 148 domain.set_boundary({'back': Br, 149 if project.wave == 'Bf': 150 Bf = Field_boundary(project.event_sts+'.sts', 151 domain, mean_stage=project.tide, 152 time_thinning=1, 153 default_boundary=Bd, 154 boundary_polygon=bounding_polygon_sts, 155 use_cache=True, 156 verbose=True) 157 domain.set_boundary({'back': Br, 149 158 'side': Bd, 150 159 'ocean': Bf}) 160 161 elif project.wave == 'Tb': 162 Tb = Time_boundary(domain,f,default_boundary=Bd ) 163 164 domain.set_boundary({'back': Br, 165 'side': Bd, 166 'ocean': Tb}) 167 else: 168 print 'No wave specified in project script (Bf or Tb)' 169 151 170 152 171 #------------------------------------------------------------------------------- -
anuga_work/production/australia_ph2/hobart/project.py
r6413 r6460 34 34 finaltime=1000 # final time for simulation 35 35 36 setup = 'trial' # This can be one of three values 36 # index is only used when wave = Tb 37 index = 1203 # index from the PTHA 38 wave = 'Tb' # Bf (sts wave) Tb (index wave) 39 40 setup = 'final' # This can be one of three values 37 41 # trial - coarsest mesh, fast 38 42 # basic - coarse mesh … … 50 54 #------------------------------------------------------------------------------- 51 55 52 output_comment = [setup, tide, event_number ]56 output_comment = [setup, tide, event_number, index, wave] 53 57 54 58 #------------------------------------------------------------------------------- -
anuga_work/production/australia_ph2/hobart/run_model.py
r6407 r6460 35 35 from anuga.interface import Reflective_boundary 36 36 from anuga.interface import Field_boundary 37 from anuga.interface import Time_boundary 38 from anuga.interface import file_function 39 37 40 from anuga.interface import create_sts_boundary 38 41 from anuga.interface import csv2building_polygons … … 47 50 from setup_model import project 48 51 import build_urs_boundary as bub 52 import prepare_timeboundary as TB 49 53 50 54 #------------------------------------------------------------------------------- … … 135 139 print 'Set boundary - available tags:', domain.get_boundary_tags() 136 140 141 # Prepare time boundary 142 TB.prepare_timeboundary(project.boundary_csv) 143 f = file_function(project.boundary_csv[:-4] + '.tms') 144 137 145 Br = Reflective_boundary(domain) 138 146 Bt = Transmissive_stage_zero_momentum_boundary(domain) 139 147 Bd = Dirichlet_boundary([project.tide, 0, 0]) 140 Bf = Field_boundary(project.event_sts+'.sts',141 domain, mean_stage=project.tide,142 time_thinning=1,143 default_boundary=Bd,144 boundary_polygon=bounding_polygon_sts,145 use_cache=True,146 verbose=True)147 148 148 domain.set_boundary({'back': Br, 149 if project.wave == 'Bf': 150 Bf = Field_boundary(project.event_sts+'.sts', 151 domain, mean_stage=project.tide, 152 time_thinning=1, 153 default_boundary=Bd, 154 boundary_polygon=bounding_polygon_sts, 155 use_cache=True, 156 verbose=True) 157 domain.set_boundary({'back': Br, 149 158 'side': Bd, 150 159 'ocean': Bf}) 160 161 elif project.wave == 'Tb': 162 Tb = Time_boundary(domain,f,default_boundary=Bd ) 163 164 domain.set_boundary({'back': Br, 165 'side': Bd, 166 'ocean': Tb}) 167 else: 168 print 'No wave specified in project script (Bf or Tb)' 169 151 170 152 171 #------------------------------------------------------------------------------- -
anuga_work/production/australia_ph2/perth/project.py
r6429 r6460 34 34 finaltime=1000 # final time for simulation 35 35 36 setup = 'trial' # This can be one of three values 36 # index is only used when wave = Tb 37 index = 1203 # index from the PTHA 38 wave = 'Tb' # Bf (sts wave) Tb (index wave) 39 40 setup = 'final' # This can be one of three values 37 41 # trial - coarsest mesh, fast 38 42 # basic - coarse mesh … … 50 54 #------------------------------------------------------------------------------- 51 55 52 output_comment = [setup, tide, event_number ]56 output_comment = [setup, tide, event_number, index, wave] 53 57 54 58 #------------------------------------------------------------------------------- -
anuga_work/production/australia_ph2/perth/run_model.py
r6429 r6460 35 35 from anuga.interface import Reflective_boundary 36 36 from anuga.interface import Field_boundary 37 from anuga.interface import Time_boundary 38 from anuga.interface import file_function 39 37 40 from anuga.interface import create_sts_boundary 38 41 from anuga.interface import csv2building_polygons … … 47 50 from setup_model import project 48 51 import build_urs_boundary as bub 52 import prepare_timeboundary as TB 49 53 50 54 #------------------------------------------------------------------------------- … … 135 139 print 'Set boundary - available tags:', domain.get_boundary_tags() 136 140 141 # Prepare time boundary 142 TB.prepare_timeboundary(project.boundary_csv) 143 f = file_function(project.boundary_csv[:-4] + '.tms') 144 137 145 Br = Reflective_boundary(domain) 138 146 Bt = Transmissive_stage_zero_momentum_boundary(domain) 139 147 Bd = Dirichlet_boundary([project.tide, 0, 0]) 140 Bf = Field_boundary(project.event_sts+'.sts',141 domain, mean_stage=project.tide,142 time_thinning=1,143 default_boundary=Bd,144 boundary_polygon=bounding_polygon_sts,145 use_cache=True,146 verbose=True)147 148 148 domain.set_boundary({'back': Br, 149 if project.wave == 'Bf': 150 Bf = Field_boundary(project.event_sts+'.sts', 151 domain, mean_stage=project.tide, 152 time_thinning=1, 153 default_boundary=Bd, 154 boundary_polygon=bounding_polygon_sts, 155 use_cache=True, 156 verbose=True) 157 domain.set_boundary({'back': Br, 149 158 'side': Bd, 150 159 'ocean': Bf}) 160 161 elif project.wave == 'Tb': 162 Tb = Time_boundary(domain,f,default_boundary=Bd ) 163 164 domain.set_boundary({'back': Br, 165 'side': Bd, 166 'ocean': Tb}) 167 else: 168 print 'No wave specified in project script (Bf or Tb)' 169 151 170 152 171 #------------------------------------------------------------------------------- -
anuga_work/production/australia_ph2/sydney/project.py
r6307 r6460 1 """Common filenames and locations for elevation, meshes and outputs.2 This script is the heart of all scripts in the folder3 1 """ 4 #------------------------------------------------------------------------------ 5 # Import necessary modules 6 #------------------------------------------------------------------------------ 2 This file contains all your file and directory definitions 3 for elevation, meshes and outputs. 4 """ 7 5 8 6 import os 9 from os.path import join 10 from os import sep, getenv 7 from anuga.utilities.system_tools import get_user_name, get_host_name 11 8 from time import localtime, strftime, gmtime 12 from anuga.utilities.polygon import read_polygon, number_mesh_triangles 13 from anuga.utilities.system_tools import get_user_name, get_host_name 14 15 #------------------------------------------------------------------------------ 9 from os.path import join, exists 10 from os import sep 11 12 13 #------------------------------------------------------------------------------- 16 14 # Directory setup 17 #------------------------------------------------------------------------------ 18 # Note: INUNDATIONHOME is the inundation directory, not the data directory. 19 20 home = getenv('INUNDATIONHOME')+sep+'data'+sep # Absolute path for data folder 21 muxhome = getenv('MUXHOME') 22 user = get_user_name() 23 host = get_host_name() 24 25 # determines time for setting up output directories 26 time = strftime('%Y%m%d_%H%M%S',localtime()) 27 gtime = strftime('%Y%m%d_%H%M%S',gmtime()) 28 build_time = time+'_build' 29 run_time = time+'_run' 15 #------------------------------------------------------------------------------- 30 16 31 17 # this section needs to be updated to reflect the modelled community. … … 33 19 state = 'australia_ph2' 34 20 scenario_name = 'sydney' 35 scenario_folder = 'sydney'36 37 #------------------------------------------------------------------------------ 21 scenario_folder = scenario_name 22 23 #------------------------------------------------------------------------------- 38 24 # Initial Conditions 39 #------------------------------------------------------------------------------ 40 # Model specific parameters. One or all can be changed each time the 41 # run_scenario script is executed 42 tide = 0 #0.6 43 event_number = 7875 # Java 9.3 original 25 #------------------------------------------------------------------------------- 26 27 # Model specific parameters. 28 # One or all can be changed each time the run_model script is executed 29 tide = 0 # difference between MSL and HAT 30 zone = 50 # specify zone of model 31 event_number = 7875 # the event number or the mux file name 44 32 alpha = 0.1 # smoothing parameter for mesh 45 33 friction=0.01 # manning's friction coefficient 46 starttime=0 47 finaltime=1000 # final time for simulation 48 49 setup='trial' # Final can be replaced with trial or basic. 50 # Either will result in a coarser mesh that will allow a 51 # faster, but less accurate, simulation. 52 53 if setup =='trial': 54 print'trial' 55 scale_factor=100 56 time_thinning=96 57 yieldstep=240 58 if setup =='basic': 59 print'basic' 60 scale_factor=4 61 time_thinning=12 62 yieldstep=120 63 if setup =='final': 64 print'final' 65 scale_factor=1 66 time_thinning=4 67 yieldstep=60 68 69 70 #------------------------------------------------------------------------------ 71 # Output Filename 72 #------------------------------------------------------------------------------ 73 # Important to distinguish each run - ensure str(user) is included! 74 # Note, the user is free to include as many parameters as desired 75 output_comment= ('_' + setup + '_' + str(tide)+ '_' + str(event_number) + 76 '_' + str(user)) 77 78 #------------------------------------------------------------------------------ 34 starttime=0 # start time for simulation 35 finaltime=80000 # final time for simulation 36 37 # index is only used when wave = Tb 38 index = 1203 # index from the PTHA 39 wave = 'Tb' # Bf (sts wave) Tb (index wave) 40 41 setup = 'trial' # This can be one of three values 42 # trial - coarsest mesh, fast 43 # basic - coarse mesh 44 # final - fine mesh, slowest 45 46 #------------------------------------------------------------------------------- 47 # Output filename 48 # 49 # Your output filename should be unique between different runs on different data. 50 # The list of items below will be used to create a file in your output directory. 51 # Your user name and time+date will be automatically added. For example, 52 # [setup, tide, event_number] 53 # will result in a filename like 54 # 20090212_091046_run_final_0_27283_rwilson 55 #------------------------------------------------------------------------------- 56 57 output_comment = [setup, tide, event_number, index, wave] 58 59 #------------------------------------------------------------------------------- 79 60 # Input Data 80 #------------------------------------------------------------------------------ 61 #------------------------------------------------------------------------------- 62 81 63 # ELEVATION DATA 82 # Used in build_ busselton.py64 # Used in build_elevation.py 83 65 # Format for ascii grids, as produced in ArcGIS + a projection file 84 #ascii_grid_filenames = ['busselton_v2', # Topo 85 # 'grid_250m_clip'] # Busselton Topo 66 ascii_grid_filenames = [] # 250m grid 2005 86 67 87 68 # Format for point is x,y,elevation (with header) 88 69 point_filenames = ['sydney_elevation.txt', 89 'melbourne_elevation.txt'] 90 70 'melbourne_elevation.txt'] # 250m grid 2005 71 72 ### Add csv header list to all files in point_filenames 73 ##headerlist = ['x', 'y', 'elevation'] 74 ##for f in point_filenames: 75 ## add_csv_header(join(topographies_folder, f), headerlist) 76 77 # BOUNDING POLYGON - for data clipping and estimate of triangles in mesh 78 # Used in build_elevation.py 79 # Format for points easting,northing (no header) 80 bounding_polygon_filename = 'bounding_polygon.csv' 81 bounding_polygon_maxarea = 100000 82 83 # INTERIOR REGIONS - for designing the mesh 84 # Used in run_model.py 85 # Format for points easting,northing (no header) 86 interior_regions_data = [] 91 87 92 88 # LAND - used to set the initial stage/water to be offcoast only 93 # Used in run_busselton,py 94 # Format for points easting,northing (no header) 89 # Used in run_model.py. Format for points easting,northing (no header) 95 90 land_initial_conditions_filename = [['initial_condition_extend.csv', 0]], 96 91 ['initial_condition_comerong_island.csv', 0], … … 98 93 ['initial_condition_montague_island.csv', 0]] 99 94 100 # BOUNDING POLYGON - for data clipping and estimate of triangles in mesh 101 # Used in build_busselton.py 102 # Format for points easting,northing (no header) 103 bounding_polygon_filename = 'bounding_polygon.csv' 104 105 # INTERIOR REGIONS - for designing the mesh 106 # Used in run_model.py 107 # Format for points easting,northing (no header) 108 ##interior_regions_data = [['coast_3km_buffer.csv', 50000]] 109 110 111 # BOUNDING POLYGON 112 # used in build_boundary.py and run_busselton.py respectively 95 # GAUGES - for creating timeseries at a specific point 96 # Used in get_timeseries.py. 97 # Format easting,northing,name,elevation (with header) 98 gauges_filename = 'gauges.csv' 99 100 # BUILDINGS EXPOSURE - for identifying inundated houses 101 # Used in run_building_inundation.py 102 # Format latitude,longitude etc (geographic) 103 building_exposure_filename = 'busselton_res_clip.csv' # from NEXIS 104 105 # BOUNDING POLYGON - used in build_boundary.py and run_model.py respectively 113 106 # NOTE: when files are put together the points must be in sequence 114 107 # For ease go clockwise! 115 # Check the run_ busselton.py for boundary_tags108 # Check the run_model.py for boundary_tags 116 109 117 110 # Thinned ordering file from Hazard Map (geographic) 118 111 # Format is index,latitude,longitude (with header) 119 urs_order_filename = ' thinned_boundary_ordering_extend.csv'112 urs_order_filename = 'urs_order.csv' 120 113 121 114 # Landward bounding points 122 115 # Format easting,northing (no header) 123 landward_boundary_filename = 'landward_boundary_extend.csv' 124 125 126 127 128 129 #------------------------------------------------------------------------------ 116 landward_boundary_filename = 'landward_boundary.csv' 117 118 # MUX input filename. 119 # If a meta-file from EventSelection is used, set 'multi-mux' to True. 120 # If a single MUX stem filename (*.grd) is used, set 'multi-mux' to False. 121 ##mux_input_filename = event_number # to be found in event_folder 122 # (ie boundaries/event_number/) 123 ##multi_mux = False 124 mux_input_filename = 'event.list' 125 multi_mux = True 126 127 128 129 130 ################################################################################ 131 ################################################################################ 132 #### NOTE: NOTHING WOULD NORMALLY CHANGE BELOW THIS POINT. #### 133 ################################################################################ 134 ################################################################################ 135 136 # Get system user and host names. 137 # These values can be used to distinguish between two similar runs by two 138 # different users or runs by the same user on two different machines. 139 user = get_user_name() 140 host = get_host_name() 141 142 # Environment variable names. 143 # The inundation directory, not the data directory. 144 ENV_INUNDATIONHOME = 'INUNDATIONHOME' 145 146 # Path to MUX data 147 ENV_MUXHOME = 'MUXHOME' 148 149 #------------------------------------------------------------------------------- 130 150 # Output Elevation Data 131 #------------------------------------------------------------------------------ 151 #------------------------------------------------------------------------------- 152 132 153 # Output filename for elevation 133 # this is a combination of all the data generated in build_ busselton.py154 # this is a combination of all the data generated in build_elevation.py 134 155 combined_elevation_basename = scenario_name + '_combined_elevation' 135 156 136 #------------------------------------------------------------------------------ 157 #------------------------------------------------------------------------------- 137 158 # Directory Structure 138 #------------------------------------------------------------------------------ 159 #------------------------------------------------------------------------------- 160 161 # determines time for setting up output directories 162 time = strftime('%Y%m%d_%H%M%S', localtime()) 163 gtime = strftime('%Y%m%d_%H%M%S', gmtime()) 164 build_time = time + '_build' 165 run_time = time + '_run_' 166 167 # create paths generated from environment variables. 168 home = join(os.getenv(ENV_INUNDATIONHOME), 'data') # Absolute path for data folder 169 muxhome = os.getenv(ENV_MUXHOME) 170 171 # check various directories/files that must exist 139 172 anuga_folder = join(home, state, scenario_folder, 'anuga') 140 173 topographies_folder = join(anuga_folder, 'topographies') … … 142 175 boundaries_folder = join(anuga_folder, 'boundaries') 143 176 output_folder = join(anuga_folder, 'outputs') 144 gauges_folder = join(anuga_folder, 'gauges')177 gauges_folder = join(anuga_folder, 'gauges') 145 178 meshes_folder = join(anuga_folder, 'meshes') 146 147 #------------------------------------------------------------------------------ 179 event_folder = join(boundaries_folder, str(event_number)) 180 181 # MUX data files 182 # Directory containing the MUX data files to be used with EventSelection. 183 mux_data_folder = join(muxhome, 'mux') 184 185 #------------------------------------------------------------------------------- 148 186 # Location of input and output data 149 #------------------------------------------------------------------------------ 150 151 # The absolute pathname of the all elevation, generated in build_busselton.py 187 #------------------------------------------------------------------------------- 188 189 # Convert the user output_comment to a string for run_model.py 190 output_comment = ('_'.join([str(x) for x in output_comment if x != user]) 191 + '_' + user) 192 193 # The absolute pathname of the all elevation, generated in build_elevation.py 152 194 combined_elevation = join(topographies_folder, combined_elevation_basename) 153 195 154 # The absolute pathname of the mesh, generated in run_ busselton.py155 meshes = meshes_folder + sep + scenario_name+ '.msh'156 157 # The absolute pathname for the urs order points, used within build_boundary.py196 # The absolute pathname of the mesh, generated in run_model.py 197 meshes = join(meshes_folder, scenario_name) + '.msh' 198 199 # The pathname for the urs order points, used within build_urs_boundary.py 158 200 urs_order = join(boundaries_folder, urs_order_filename) 159 201 160 202 # The absolute pathname for the landward points of the bounding polygon, 161 # Used within run_ busselton.py)203 # Used within run_model.py) 162 204 landward_boundary = join(boundaries_folder, landward_boundary_filename) 163 205 164 206 # The absolute pathname for the .sts file, generated in build_boundary.py 165 event_sts = join( boundaries_folder, str(event_number))207 event_sts = join(event_folder, scenario_name) 166 208 167 209 # The absolute pathname for the output folder names 168 # Used for build_ busselton.py169 output_build = output_folder + sep + build_time+ '_' + str(user)170 # Used for run_ busselton.py171 output_run = output_folder + sep + run_time+ output_comment210 # Used for build_elevation.py 211 output_build = join(output_folder, build_time) + '_' + str(user) 212 # Used for run_model.py 213 output_run = join(output_folder, run_time) + output_comment 172 214 # Used by post processing 173 215 output_run_time = join(output_run, scenario_name) 174 216 175 176 #------------------------------------------------------------------------------ 177 # Reading polygons and creating interior regions 178 #------------------------------------------------------------------------------ 179 180 # Create list of land polygons with initial conditions 181 land_initial_conditions = [] 182 for filename, MSL in land_initial_conditions_filename: 183 polygon = read_polygon(join(polygons_folder, filename)) 184 land_initial_conditions.append([filename, MSL]) 185 186 ### Create list of interior polygons with scaling factor 187 interior_regions = [] 188 ##for filename, maxarea in interior_regions_data: 189 ## polygon = read_polygon(join(polygons_folder, filename)) 190 ## interior_regions.append([polygon, maxarea*scale_factor]) 191 192 # Initial bounding polygon for data clipping 193 bounding_polygon = read_polygon(join(polygons_folder, 194 bounding_polygon_filename)) 195 bounding_maxarea = 125000*scale_factor 196 197 # Estimate the number of triangles 198 trigs_min = number_mesh_triangles(interior_regions, 199 bounding_polygon, bounding_maxarea) 200 print 'min estimated number of triangles', trigs_min 201 202 217 # The absolute pathname for the gauges file 218 # Used for get_timeseries.py 219 gauges = join(gauges_folder, gauges_filename) 220 221 # The absolute pathname for the building file 222 # Used for run_building_inundation.py 223 building_exposure = join(gauges_folder, building_exposure_filename) 224 225 # full path to where MUX files (or meta-files) live 226 mux_input = join(event_folder, mux_input_filename) 227 228 boundary_csv = event_folder + sep + 'sts_gauge_' + str(index) +'.csv' -
anuga_work/production/australia_ph2/sydney/run_model.py
r6307 r6460 1 """Run a tsunami inundation scenario for sydney region, NSW, Australia.1 """Run a tsunami inundation scenario for Busselton, WA, Australia. 2 2 3 3 The scenario is defined by a triangular mesh created from project.polygon, the 4 elevation data is compiled into a pts file through build_ sydney.py and a4 elevation data is compiled into a pts file through build_elevation.py and a 5 5 simulated tsunami is generated through an sts file from build_boundary.py. 6 6 7 7 Input: sts file (build_boundary.py for respective event) 8 pts file (build_ sydney.py)8 pts file (build_elevation.py) 9 9 information from project file 10 10 Outputs: sww file stored in project.output_run_time_dir … … 22 22 # Standard modules 23 23 import os 24 import os.path 24 25 import time 26 from time import localtime, strftime, gmtime 25 27 26 28 # Related major packages 29 from Scientific.IO.NetCDF import NetCDFFile 30 import Numeric as num 31 27 32 from anuga.interface import create_domain_from_regions 28 33 from anuga.interface import Transmissive_stage_zero_momentum_boundary … … 30 35 from anuga.interface import Reflective_boundary 31 36 from anuga.interface import Field_boundary 37 from anuga.interface import Time_boundary 38 from anuga.interface import file_function 39 32 40 from anuga.interface import create_sts_boundary 33 41 from anuga.interface import csv2building_polygons … … 36 44 from anuga.shallow_water.data_manager import start_screen_catcher 37 45 from anuga.shallow_water.data_manager import copy_code_files 46 from anuga.shallow_water.data_manager import urs2sts 38 47 from anuga.utilities.polygon import read_polygon, Polygon_function 39 48 40 49 # Application specific imports 41 import project # Definition of file names and polygons 50 from setup_model import project 51 import build_urs_boundary as bub 52 import prepare_timeboundary as TB 42 53 54 #------------------------------------------------------------------------------- 55 # Copy scripts to time stamped output directory and capture screen 56 # output to file. Copy script must be before screen_catcher 57 #------------------------------------------------------------------------------- 43 58 44 #------------------------------------------------------------------------------45 # Copy scripts to time stamped output directory and capture screen46 # output to file. Copy script must be before screen_catcher.47 #------------------------------------------------------------------------------48 59 copy_code_files(project.output_run, __file__, 49 os.path. dirname(project.__file__)+os.sep+\50 project.__name__+'.py')60 os.path.join(os.path.dirname(project.__file__), 61 project.__name__+'.py')) 51 62 start_screen_catcher(project.output_run, 0, 1) 52 63 53 54 #------------------------------------------------------------------------------ 64 #------------------------------------------------------------------------------- 55 65 # Create the computational domain based on overall clipping polygon with 56 66 # a tagged boundary and interior regions defined in project.py along with 57 # resolutions (maximal area of per triangle) for each polygon. 58 #------------------------------------------------------------------------------ 67 # resolutions (maximal area of per triangle) for each polygon 68 #------------------------------------------------------------------------------- 69 59 70 print 'Create computational domain' 71 72 # Create the STS file 73 print 'project.mux_data_folder=%s' % project.mux_data_folder 74 if not os.path.exists(project.event_sts + '.sts'): 75 bub.build_urs_boundary(project.mux_input_filename, project.event_sts) 60 76 61 77 # Read in boundary from ordered sts file … … 63 79 64 80 # Reading the landward defined points, this incorporates the original clipping 65 # polygon minus the 100m contour .81 # polygon minus the 100m contour 66 82 landward_boundary = read_polygon(project.landward_boundary) 67 83 … … 70 86 71 87 # Number of boundary segments 72 N = len(event_sts)-188 num_ocean_segments = len(event_sts) - 1 73 89 # Number of landward_boundary points 74 M= file_length(project.landward_boundary)90 num_land_points = file_length(project.landward_boundary) 75 91 76 92 # Boundary tags refer to project.landward_boundary 77 93 # 4 points equals 5 segments start at N 78 boundary_tags={'back': range(N+1,N+M), 79 'side': [N,N+M], 80 'ocean': range(N)} 94 boundary_tags={'back': range(num_ocean_segments+1, 95 num_ocean_segments+num_land_points), 96 'side': [num_ocean_segments, 97 num_ocean_segments+num_land_points], 98 'ocean': range(num_ocean_segments)} 81 99 82 100 # Build mesh and domain … … 94 112 domain.set_minimum_storable_height(0.01) # Don't store depth less than 1cm 95 113 114 #------------------------------------------------------------------------------- 115 # Setup initial conditions 116 #------------------------------------------------------------------------------- 96 117 97 #------------------------------------------------------------------------------98 # Setup initial conditions99 #------------------------------------------------------------------------------100 118 print 'Setup initial conditions' 101 119 102 120 # Set the initial stage in the offcoast region only 103 IC = Polygon_function(project.land_initial_conditions, 104 default=project.tide, 105 geo_reference=domain.geo_reference) 121 if project.land_initial_conditions: 122 IC = Polygon_function(project.land_initial_conditions, 123 default=project.tide, 124 geo_reference=domain.geo_reference) 125 else: 126 IC = 0 106 127 domain.set_quantity('stage', IC, use_cache=True, verbose=True) 107 128 domain.set_quantity('friction', project.friction) 108 129 domain.set_quantity('elevation', 109 130 filename=project.combined_elevation+'.pts', 110 use_cache= False,131 use_cache=True, 111 132 verbose=True, 112 133 alpha=project.alpha) 113 134 135 #------------------------------------------------------------------------------- 136 # Setup boundary conditions 137 #------------------------------------------------------------------------------- 114 138 115 #------------------------------------------------------------------------------116 # Setup boundary conditions117 #------------------------------------------------------------------------------118 139 print 'Set boundary - available tags:', domain.get_boundary_tags() 140 141 # Prepare time boundary 142 TB.prepare_timeboundary(project.boundary_csv) 143 f = file_function(project.boundary_csv[:-4] + '.tms') 119 144 120 145 Br = Reflective_boundary(domain) 121 146 Bt = Transmissive_stage_zero_momentum_boundary(domain) 122 Bf = Field_boundary(project.event_sts+'.sts', 123 domain, mean_stage=project.tide, 124 time_thinning=1, 125 default_boundary=Bd, 126 boundary_polygon=bounding_polygon_sts, 127 use_cache=True, 128 verbose=True) 147 Bd = Dirichlet_boundary([project.tide, 0, 0]) 129 148 130 domain.set_boundary({'back': Br, 131 'side': Bt, 149 if project.wave == 'Bf': 150 Bf = Field_boundary(project.event_sts+'.sts', 151 domain, mean_stage=project.tide, 152 time_thinning=1, 153 default_boundary=Bd, 154 boundary_polygon=bounding_polygon_sts, 155 use_cache=True, 156 verbose=True) 157 domain.set_boundary({'back': Br, 158 'side': Bd, 132 159 'ocean': Bf}) 160 161 elif project.wave == 'Tb': 162 Tb = Time_boundary(domain,f,default_boundary=Bd ) 133 163 164 domain.set_boundary({'back': Br, 165 'side': Bd, 166 'ocean': Tb}) 167 else: 168 print 'No wave specified in project script (Bf or Tb)' 169 134 170 135 #------------------------------------------------------------------------------ 171 #------------------------------------------------------------------------------- 136 172 # Evolve system through time 137 #------------------------------------------------------------------------------ 173 #------------------------------------------------------------------------------- 174 138 175 t0 = time.time() 139 176 for t in domain.evolve(yieldstep=project.yieldstep, … … 143 180 print domain.boundary_statistics(tags='ocean') 144 181 145 print 'Simulation took %.2f seconds' % (time.time()-t0)182 print 'Simulation took %.2f seconds' % (time.time()-t0)
Note: See TracChangeset
for help on using the changeset viewer.