Ignore:
Timestamp:
Jul 25, 2008, 4:17:26 PM (14 years ago)
Author:
kristy
Message:

Addition of Polyline information with sts files

File:
1 edited

Legend:

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

    r5480 r5575  
    3939from anuga.damage_modelling.inundation_damage import add_depth_and_momentum2csv, inundation_damage
    4040from anuga.fit_interpolate.benchmark_least_squares import mem_usage
     41from anuga.utilities.polygon import read_polygon, plot_polygons, polygon_area, is_inside_polygon
    4142
    4243# Application specific imports
     
    7172    print "Processor Name:",get_processor_name()
    7273
    73     # filenames
    74 #    meshes_dir_name = project.meshes_dir_name+'.msh'
    75 
    76     # creates copy of code in output dir
    77     print 'min triangles', project.trigs_min,
    78     print 'Note: This is generally about 20% less than the final amount'
    79 
     74    #-----------------------------------------------------------------------
     75    # Domain definitions
     76    #-----------------------------------------------------------------------
     77
     78    # Read in boundary from ordered sts file
     79    urs_bounding_polygon=create_sts_boundary(project.scenario_name)
     80
     81    # Reading the landward defined points, this incorporates the original clipping
     82    # polygon minus the 100m contour
     83    landward_bounding_polygon = read_polygon(project.polygons_dir+'landward_bounding_polygon.txt')
     84
     85    # Combine sts polyline with landward points
     86    bounding_polygon = urs_bounding_polygon + landward_bounding_polygon
     87   
     88    # counting segments
     89    N = len(urs_bounding_polygon)-1
     90    boundary_tags={'back': [N+1,N+2,N+3,N+4, N+5], 'side': [N,N+6],'ocean': range(N)}
     91
     92   
    8093    #--------------------------------------------------------------------------
    8194    # Create the triangular mesh based on overall clipping polygon with a
     
    106119    print 'Setup computational domain'
    107120
    108     #domain = cache(Domain, (meshes_dir_name), {'use_cache':True, 'verbose':True}, verbose=True)
    109     #above don't work
    110121    domain = Domain(project.meshes_dir_name+'.msh', use_cache=False, verbose=True)
    111122    print 'memory usage before del domain',mem_usage()
     
    168179    print 'Available boundary tags', domain.get_boundary_tags()
    169180    print 'domain id', id(domain)
    170     #print 'Reading Boundary file',project.boundaries_dir_namea + '.sww'
    171 
     181   
    172182    print'set_boundary'
    173183
     184    boundary_urs_out=project.boundaries_dir_name
     185   
     186    print 'Available boundary tags', domain.get_boundary_tags()
     187    Bf = File_boundary(boundary_urs_out+'.sts',
     188                   domain, time_thinning=1,
     189                   use_cache=True,
     190                   verbose = True,
     191                   boundary_polygon=bounding_polygon)
     192   
    174193    Br = Reflective_boundary(domain)
    175194    Bd = Dirichlet_boundary([kwargs['tide'],0,0])
    176     Bw = Dirichlet_boundary([kwargs['tide']+10.0,0,0]) # To be deleted for FESA runs
    177 
    178     Bf = Field_boundary(kwargs['boundary_file'],
    179                     domain, time_thinning=kwargs['time_thinning'], mean_stage=kwargs['tide'],
    180                     use_cache=True, verbose=True)
     195    #Bw = Dirichlet_boundary([kwargs['tide']+10.0,0,0]) # To be deleted for FESA runs
     196
    181197    print 'finished reading boundary file'
     198
    182199    domain.set_boundary({'back': Bd,
    183                              'side': Bd,
    184                              'ocean': Bd}) #changed from Bf to Bd for large wave
     200                         'side': Bd,
     201                         'ocean': Bf}) #changed from Bf to Bd for large wave
    185202
    186203    kwargs['input_start_time']=domain.starttime
     
    198215        domain.write_boundary_statistics(tags = 'ocean')
    199216
    200         # To be deleted for FESA runs
    201         if allclose(t, 240):
    202             domain.set_boundary({'back': Br, 'side': Bd, 'ocean': Bw})
    203 
    204         if allclose(t, 1440):
    205             domain.set_boundary({'back': Br, 'side': Bd, 'ocean': Bd})
     217##        # To be deleted for FESA runs
     218##        if allclose(t, 240):
     219##            domain.set_boundary({'back': Br, 'side': Bd, 'ocean': Bw})
     220##
     221##        if allclose(t, 1440):
     222##            domain.set_boundary({'back': Br, 'side': Bd, 'ocean': Bd})
    206223
    207224
Note: See TracChangeset for help on using the changeset viewer.