Ignore:
Timestamp:
Jun 17, 2008, 9:03:30 AM (15 years ago)
Author:
kristy
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • anuga_work/production/busselton/run_busselton.py

    r5381 r5408  
    123123        from polygon import Polygon_function
    124124        #following sets the stage/water to be offcoast only
    125         IC = Polygon_function( [(project.poly_mainland, -1.0)], default = kwargs['tide'],
     125        IC = Polygon_function( [(project.poly_mainland, 0)], default = kwargs['tide'],
    126126                                 geo_reference = domain.geo_reference)
    127127        domain.set_quantity('stage', IC)
     
    173173    Br = Reflective_boundary(domain)
    174174    Bd = Dirichlet_boundary([kwargs['tide'],0,0])
    175     Bo = Dirichlet_boundary([kwargs['tide']+10.0,0,0])
    176 
    177     if project.source != 'test':
    178         print 'start reading boundary file'
    179        
    180         Bf = Field_boundary(kwargs['boundary_file'],
     175   
     176
     177    Bf = Field_boundary(kwargs['boundary_file'],
    181178                    domain, time_thinning=kwargs['time_thinning'], mean_stage=kwargs['tide'],
    182179                    use_cache=True, verbose=True)
    183         print 'finished reading boundary file'
    184         domain.set_boundary({'back': Br,
     180    print 'finished reading boundary file'
     181    domain.set_boundary({'back': Bd,
    185182                             'side': Bd,
    186183                             'ocean': Bf})
    187     else:
    188         print 'set ocean'               
    189         domain.set_boundary({'back': Br,
    190                              'side': Bd,
    191                              'ocean': Bd})
    192184
    193185    kwargs['input_start_time']=domain.starttime
     
    200192    t0 = time.time()
    201193
    202     for t in domain.evolve(yieldstep = 240, finaltime = kwargs['starttime']):
     194    for t in domain.evolve(yieldstep = 240, finaltime = kwargs['finaltime']):
    203195        domain.write_time()
    204196        domain.write_boundary_statistics(tags = 'ocean')     
    205 
    206         if allclose(t, 240):
    207             domain.set_boundary({'back': Br, 'side': Bd, 'ocean': Bo})
    208 
    209         if allclose(t, 1440):
    210             domain.set_boundary({'back': Br, 'side': Bd, 'ocean': Bd})
    211 
    212 #    for t in domain.evolve(yieldstep = kwargs['yieldstep'], finaltime = kwargs['midtime']
    213 #                       ,skip_initial_step = True):
    214 #        domain.write_time()
    215 #        domain.write_boundary_statistics(tags = 'ocean')     
    216 #   
    217 #    for t in domain.evolve(yieldstep = 240, finaltime = kwargs['finaltime']
    218 #                       ,skip_initial_step = True):
    219 #        domain.write_time()
    220 #        domain.write_boundary_statistics(tags = 'ocean')   
    221197
    222198    x, y = domain.get_maximum_inundation_location()
     
    235211   
    236212    print 'memory usage before del domain1',mem_usage()
    237    
    238 def export_model(**kwargs):   
    239     #store_parameters(**kwargs)
    240    
    241 #    print 'memory usage before del domain',mem_usage()
    242     #del domain
    243     print 'memory usage after del domain',mem_usage()
    244    
    245     swwfile = kwargs['output_dir']+kwargs['aa_scenario_name']
    246     print'swwfile',swwfile
    247    
    248     export_grid(swwfile, extra_name_out = 'town',
    249             quantities = ['speed','depth','elevation','stage'], # '(xmomentum**2 + ymomentum**2)**0.5' defaults to elevation
    250             #quantities = ['speed','depth'], # '(xmomentum**2 + ymomentum**2)**0.5' defaults to elevation
    251             timestep = None,
    252             reduction = max,
    253             cellsize = kwargs['export_cellsize'],
    254             NODATA_value = -9999,
    255             easting_min = project.eastingmin,
    256             easting_max = project.eastingmax,
    257             northing_min = project.northingmin,
    258             northing_max = project.northingmax,
    259             verbose = False,
    260             origin = None,
    261             datum = 'GDA94',
    262             format = 'asc')
    263            
    264     inundation_damage(swwfile+'.sww', project.buildings_filename,
    265                       project.buildings_filename_out)
    266    
    267 #-------------------------------------------------------------
     213
     214 #-------------------------------------------------------------
    268215if __name__ == "__main__":
    269216   
Note: See TracChangeset for help on using the changeset viewer.