Ignore:
Timestamp:
Jul 25, 2008, 8:53:51 AM (15 years ago)
Author:
kristy
Message:

updated scripts for polyline boundary

File:
1 edited

Legend:

Unmodified
Added
Removed
  • anuga_work/production/perth/run_perth.py

    r5557 r5569  
    3030from anuga.shallow_water import Field_boundary
    3131from Numeric import allclose
    32 from anuga.shallow_water.data_manager import export_grid
     32from anuga.shallow_water.data_manager import export_grid, create_sts_boundary
    3333
    3434from anuga.pmesh.mesh_interface import create_mesh_from_regions
     
    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
     
    7071    print "Processor Name:",get_processor_name()
    7172
    72     # filenames
    73 #    meshes_dir_name = project.meshes_dir_name+'.msh'
    74 
    75     # creates copy of code in output dir
    76     print 'min triangles', project.trigs_min,
    77     print 'Note: This is generally about 20% less than the final amount'
    78 
     73   
     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], 'side': [N,N+4],'ocean': range(N)}
     91
     92   
    7993    #--------------------------------------------------------------------------
    8094    # Create the triangular mesh based on overall clipping polygon with a
     
    90104        print 'start create mesh from regions'
    91105
    92         create_mesh_from_regions(project.poly_all,
    93                              boundary_tags=project.boundary_tags,
     106        create_mesh_from_regions(bounding_polygon,
     107                             boundary_tags=boundary_tags,
    94108                             maximum_triangle_area=project.res_poly_all,
    95109                             interior_regions=project.interior_regions,
     
    168182    print 'domain id', id(domain)
    169183   
    170 
     184    boundary_urs_out=project.boundaries_dir_name
     185   
    171186    print 'Available boundary tags', domain.get_boundary_tags()
    172187    Bf = File_boundary(boundary_urs_out+'.sts',
     
    174189                   use_cache=True,
    175190                   verbose = True,
    176                    boundary_polygon=project.bounding_polygon)
     191                   boundary_polygon=bounding_polygon)
    177192
    178193    Br = Reflective_boundary(domain)
Note: See TracChangeset for help on using the changeset viewer.