Changeset 3043


Ignore:
Timestamp:
Jun 1, 2006, 5:07:35 PM (18 years ago)
Author:
ole
Message:

Got run_flagstaff going with buildings

Location:
production/wollongong_2006
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • production/wollongong_2006/project.py

    r3040 r3043  
    1414
    1515# Parameters
    16 base_resolution = 100
     16base_resolution = 10  #5
    1717initial_sealevel = 0.0
    1818   
     
    6464                    point6]   
    6565   
    66 
    67 #bounding_tags = ['exterior',
    68 #                 'exterior',
    69 #                 'side',                           
    70 #                 'ocean',
    71 #                 'side',                                 
    72 #                 'exterior',                           
    73 #                 'exterior']
    7466boundary_tags = {'exterior': [0,1,5,6], 'side': [2,4], 'ocean': [3]}
    7567
    7668interior_regions = []
    7769       
    78 # Make refined area around built-up area
    79 # FIXME: TODO
    80 
    81 # Now read building footprints from wgong.asc (in this directory) and
    82 # tag for reflective bdry
    83 # Segment.set_default_tag('wall') # this will be reflective
    84 # dict = importUngenerateFile('wgong.asc')
    85 # m.addVertsSegs(dict)   
    86    
    87    
  • production/wollongong_2006/run_flagstaff.py

    r3040 r3043  
    2424# Related major packages
    2525from pyvolution.shallow_water import Domain
    26 from pyvolution.shallow_water import Dirichlet_boundary, Time_boundary, Reflective_boundary
     26from pyvolution.shallow_water import Dirichlet_boundary
     27from pyvolution.shallow_water import Time_boundary
     28from pyvolution.shallow_water import Reflective_boundary
    2729from pyvolution.data_manager import convert_dem_from_ascii2netcdf, dem2pts
    2830from pmesh.mesh_interface import create_mesh_from_regions
    29 from pmesh.mesh import importUngenerateFile
     31from pmesh.mesh import importUngenerateFile, Segment
    3032
    3133# Application specific imports
     
    6062# Generate basic mesh
    6163mesh = create_mesh_from_regions(project.bounding_polygon,
    62                                 boundary_tags = project.boundary_tags,
    63                                 maximum_triangle_area = project.base_resolution,
    64                                 interior_regions = project.interior_regions)
     64                                boundary_tags=project.boundary_tags,
     65                                maximum_triangle_area=project.base_resolution,
     66                                interior_regions=project.interior_regions)
    6567
    6668# Add buildings
    67 # FIXME (Ole): Duncan, can you do your magic again?
    6869dict = importUngenerateFile(project.buildings_filename)
    69 #mesh.add_region_from_polygon( ??? )
    70 #mesh.generate_mesh(maximum_triangle_area=project.base_resolution)
     70Segment.set_default_tag('wall') # This should bind to a Reflective boundary
     71mesh.addVertsSegs(dict)
    7172
    72 # Write mesh to file
     73# Generate and write mesh to file
     74mesh.generate_mesh(maximum_triangle_area=project.base_resolution,
     75                   verbose=True)
     76
    7377mesh.export_mesh_file(project.mesh_filename)
     78
    7479
    7580#------------------------------------------------------------------------------
     
    101106#------------------------------------------------------------------------------
    102107
    103 print 'Available boundary tags', domain.get_boundary_tags()
    104 
    105108D = Dirichlet_boundary([project.initial_sealevel, 0, 0])
    106109R = Reflective_boundary(domain)
     110W = Time_boundary(domain = domain,
     111                  f=lambda t: [project.initial_sealevel + (10<t<480)*6, 0, 0])
    107112
    108 # 7 min square wave starting at 1 min, 6m high
    109 W = Time_boundary(domain = domain,
    110                   f=lambda t: [project.initial_sealevel + (60<t<480)*6, 0, 0])
    111 
    112 print 'Available boundary tags are', domain.get_boundary_tags()
    113113domain.set_boundary({'exterior': D,
    114114                     'side': D,
    115                      #'wall': R,
     115                     'wall': R,
    116116                     'ocean': W})
    117117
Note: See TracChangeset for help on using the changeset viewer.