Changeset 5575


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

Addition of Polyline information with sts files

Location:
anuga_work/production/busselton
Files:
1 added
3 edited

Legend:

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

    r5478 r5575  
    1717#time_dir = '20080707_164738_run_trial_0.6_exmouth_5120_kvanputt'
    1818#time_dir = '20080707_165101_run_trial_0.6_exmouth_5140_kvanputt'
    19 time_dir = '20080707_165619_run_trial_0.6_exmouth_5160_kvanputt'
     19#time_dir = '20080707_165619_run_trial_0.6_exmouth_5160_kvanputt'
     20#time_dir = '20080708_101451_run_trial_0.6_exmouth_4743_jsexton'
     21#time_dir = '20080708_101731_run_trial_0.6_exmouth_4777_jsexton'
     22#time_dir = '20080710_095410_run_trial_0.6_exmouth_4695_jsexton'
     23time_dir = '20080717_092900_run_final_0_exmouth_newExtent_kvanputt'
    2024
    2125
    2226cellsize = 25
    2327#cellsize = 150
    24 #timestep = 0
     28timestep = 0
    2529directory = project.output_dir
    2630name = directory+sep+'test'+sep+time_dir+sep+project.scenario_name
     
    3539print 'output dir:', name
    3640
    37 #var = [0,4]
     41var = [0,4]
    3842#var = [2,3] # depth and Speed
    39 var = [2,3,4] # elevation, depth and Speed
     43#var = [2,3,4] # elevation, depth and Speed
    4044
    4145
     
    8286        sww2dem(name, basename_out = outname,
    8387                    quantity = quantityname,
    84                     #timestep = timestep,
     88                    timestep = timestep,
    8589                    cellsize = cellsize,     
    8690                    #easting_min = project_grad.e_min_area,
  • anuga_work/production/busselton/project.py

    r5526 r5575  
    1010#from anuga.coordinate_transforms.redfearn import degminsec2decimal_degrees, convert_points_from_latlon_to_utm
    1111from anuga.utilities.system_tools import get_user_name, get_host_name
     12from anuga.utilities.polygon import read_polygon, plot_polygons, polygon_area, is_inside_polygon
    1213
    1314# file and system info
     
    1617
    1718home = getenv('INUNDATIONHOME') + sep +'data'+sep #Sandpit's parent dir   
     19muxhome = getenv('MUXHOME')
    1820user = get_user_name()
    1921host = get_host_name()
     
    3335scenario = 'busselton_tsunami_scenario'
    3436
    35 tide = 0
     37tide = 0.6
    3638
    3739alpha = 0.1
    3840friction=0.01
    3941starttime=0
    40 finaltime=50000 # changed for rev_number trial
     42finaltime=80000
    4143export_cellsize=25
    4244setup='final'
    43 source='exmouth'
     45source='polyline'
    4446
    4547
     
    135137#boundaries_source = '1'
    136138
    137 if source=='exmouth':
    138     boundaries_name = 'busselton_3103_30052008' #exmouth gun
    139     boundaries_in_dir = anuga_dir+'boundaries'+sep+'urs'+sep+'exmouth'+sep+'1_10000'+sep
    140 
    141 if source=='test':
    142     boundaries_name = 'other' #exmouth gun
    143     boundaries_in_dir = anuga_dir+'boundaries'+sep
    144 
     139##if source=='exmouth':
     140##    boundaries_name = 'busselton_3103_30052008' # exmouth gun
     141##    boundaries_in_dir = anuga_dir+'boundaries'+sep+'urs'+sep+'exmouth'+sep+'1_10000'+sep
     142##
     143##if source=='test':
     144##    boundaries_name = 'other' #exmouth gun
     145##    boundaries_in_dir = anuga_dir+'boundaries'+sep
     146##
    145147
    146148#boundaries locations
    147 boundaries_in_dir_name = boundaries_in_dir + boundaries_name
     149#boundaries_in_dir_name = boundaries_in_dir + boundaries_name
    148150boundaries_dir = anuga_dir+'boundaries'+sep
    149151boundaries_dir_name = boundaries_dir + scenario_name
     152boundaries_dir_mux = muxhome
    150153
    151154#output locations
    152155output_dir = anuga_dir+'outputs'+sep
    153 #output_build_time_dir = output_dir +'test'+sep + build_time + dir_comment + sep
    154156output_build_time_dir = output_dir +build_time + dir_comment + sep
    155 #output_run_time_dir = output_dir +run_time+dir_comment+sep
    156 output_run_time_dir = output_dir +'test'+sep + run_time + dir_comment +sep # take test out
     157output_run_time_dir = output_dir + run_time + dir_comment +sep
    157158output_run_time_dir_name = output_run_time_dir + scenario_name  #Used by post processing
    158159
     
    170171
    171172###############################
    172 # Domain definitions
     173# Interior region definitions
    173174###############################
    174175
    175 from anuga.utilities.polygon import read_polygon, plot_polygons, polygon_area, is_inside_polygon
    176 
    177 # bounding polygon for study area
     176# Initial bounding polygon for data clipping
    178177poly_all = read_polygon(polygons_dir+'poly_all_extend.csv')
    179178res_poly_all = 100000*res_factor
    180 
    181 
    182 ###############################
    183 # Interior region definitions
    184 ###############################
    185179
    186180#digitized polygons
     
    209203
    210204
    211 boundary_tags={'back': [3, 4, 5, 6, 7],
    212                'side': [2, 8], 'ocean': [0, 1, 9]}
    213 
    214205trigs_min = number_mesh_triangles(interior_regions, poly_all, res_poly_all)
     206print 'min number triangles', trigs_min
    215207
    216208poly_mainland=read_polygon(polygons_dir+'initial_condition.csv')
    217 
    218 print 'min number triangles', trigs_min
    219209
    220210
  • 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.