Changeset 5194 for anuga_work/production/tonga/tongatapu.py
- Timestamp:
- Apr 9, 2008, 9:09:18 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_work/production/tonga/tongatapu.py
r5139 r5194 24 24 25 25 # Related major packages 26 from anuga.shallow_water import Time_boundary 26 27 from anuga.shallow_water import Domain 27 28 from anuga.shallow_water import Dirichlet_boundary … … 31 32 from Numeric import allclose 32 33 from anuga.shallow_water.data_manager import export_grid 33 34 from anuga.shallow_water.data_manager import convert_dem_from_ascii2netcdf, dem2pts 34 35 from anuga.pmesh.mesh_interface import create_mesh_from_regions 35 36 from anuga.shallow_water.data_manager import start_screen_catcher, copy_code_files,store_parameters … … 81 82 # resolutions (maximal area of per triangle) for each polygon 82 83 #-------------------------------------------------------------------------- 83 84 #IMPORTANT don't cache create_mesh_from_region and Domain(mesh....) as it85 # causes problems with the ability to cache set quantity which takes alot of times86 84 87 85 if myid == 0: … … 98 96 barrier() 99 97 98 scenario='fixed_wave' 99 100 100 #------------------------------------------------------------------------- 101 101 # Setup computational domain … … 133 133 domain.set_quantity('elevation', 134 134 filename = kwargs['bathy_file'], 135 use_cache = True,135 use_cache = False, 136 136 verbose = True, 137 137 alpha = kwargs['alpha']) … … 170 170 tsunami_source = slide_tsunami(length=35000.0, 171 171 depth=project.slide_depth, 172 slope= 6.0,173 thickness= 500.0,172 slope=10.0, 173 thickness=800.0, 174 174 x0=project.slide_origin[0], 175 175 y0=project.slide_origin[1], … … 192 192 # FIXME (Ole): Change this to Transmissive Momentum as 193 193 # suggested by Rajaraman (ticket:208) 194 from math import sin, pi 194 195 Bw = Time_boundary(domain = domain, 195 f=lambda t: [ (60<t<3660)*100, 0, 0])196 domain.set_boundary({'ocean_east': 197 'ocean_ southeast':Bd,198 ' land':Bd,199 ' ocean_north':Bd,200 'ocean_ west':})196 f=lambda t: [5.0*sin(t*pi*1/15), 0, 0]) 197 domain.set_boundary({'ocean_east':Bw, 198 'ocean_north':Bd, 199 'ocean_west':Bd, 200 'land':Bd, 201 'ocean_southeast':Bd}) 201 202 202 203 # boundary conditions for slide scenario 203 204 if scenario == 'slide': 204 domain.set_boundary({'ocean_east': 205 'ocean_ southeast':Bd,206 ' land':Bd,207 ' ocean_north':Bd,208 'ocean_ west':})205 domain.set_boundary({'ocean_east':Bd, 206 'ocean_north':Bd, 207 'ocean_west':Bd, 208 'land':Bd, 209 'ocean_southeast':Bd}) 209 210 210 211 #---------------------------------------------------------------------------- … … 213 214 t0 = time.time() 214 215 215 for t in domain.evolve(yieldstep = 240, finaltime = kwargs['finaltime']):216 for t in domain.evolve(yieldstep = 1, finaltime = kwargs['finaltime']): 216 217 domain.write_time() 217 218 domain.write_boundary_statistics(tags = 'ocean_east') … … 240 241 print 'memory usage after del domain',mem_usage() 241 242 242 swwfile = kwargs['output_dir']+kwargs[' scenario_name']243 swwfile = kwargs['output_dir']+kwargs['aa_scenario_name'] 243 244 print'swwfile',swwfile 244 245 245 export_grid(swwfile, extra_name_out = 'to wn',246 export_grid(swwfile, extra_name_out = 'tonga', 246 247 quantities = ['speed','depth','elevation','stage'], # '(xmomentum**2 + ymomentum**2)**0.5' defaults to elevation 247 248 #quantities = ['speed','depth'], # '(xmomentum**2 + ymomentum**2)**0.5' defaults to elevation 248 249 timestep = None, 249 250 reduction = max, 250 cellsize = kwargs['export_cellsize'],251 cellsize = 25, 251 252 NODATA_value = -1E-030, 252 253 easting_min = project.eastingmin, … … 271 272 kwargs['midtime']=project.midtime 272 273 kwargs['finaltime']=project.finaltime 273 274 274 kwargs['output_dir']=project.output_run_time_dir 275 275 kwargs['bathy_file']=project.combined_dir_name+'.txt'
Note: See TracChangeset
for help on using the changeset viewer.