Changeset 6133


Ignore:
Timestamp:
Jan 9, 2009, 4:35:04 PM (10 years ago)
Author:
ole
Message:

Work towards buildings in Patong simulation

Location:
anuga_work/production/patong
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • anuga_work/production/patong/project.py

    r6028 r6133  
    4848finaltime=15000         # final time for simulation 15000
    4949
    50 setup='final'  # Final can be replaced with trial or basic.
     50setup='trial'  # Final can be replaced with trial or basic.
    5151               # Either will result in a coarser mesh that will allow a
    5252               # faster, but less accurate, simulation.
     
    191191trigs_min = number_mesh_triangles(interior_regions, poly_all, res_poly_all)
    192192print 'min estimated number of triangles', trigs_min
    193    
     193
     194#------------------------------------------------------------------------------
     195# Building polygons
     196#------------------------------------------------------------------------------
     197
     198building_polygon_file = polygons_dir+'buildings.csv'
     199
    194200#------------------------------------------------------------------------------
    195201# Clipping regions for export to asc and regions for clipping data
  • anuga_work/production/patong/run_patong.py

    r6028 r6133  
    3636from anuga.shallow_water import Field_boundary
    3737from Numeric import allclose
    38 from anuga.shallow_water.data_manager import export_grid, create_sts_boundary
     38from anuga.shallow_water.data_manager import export_grid, create_sts_boundary, csv2building_polygons
    3939from anuga.pmesh.mesh_interface import create_mesh_from_regions
    4040from anuga.shallow_water.data_manager import start_screen_catcher, copy_code_files,store_parameters
    41 from anuga_parallel.parallel_abstraction import get_processor_name
    4241from anuga.caching import myhash
    4342from anuga.damage_modelling.inundation_damage import add_depth_and_momentum2csv, inundation_damage
     
    5857    # output to file
    5958    #------------------------------------------------------------------------------
    60     print "Processor Name:",get_processor_name()
    6159
    6260    #copy script must be before screen_catcher
     
    7169    start_screen_catcher(kwargs['output_dir'], myid, numprocs)
    7270
    73     print "Processor Name:",get_processor_name()
    7471   
    7572    #-----------------------------------------------------------------------
     
    105102
    106103    create_mesh_from_regions(bounding_polygon,
    107                          boundary_tags=boundary_tags,
    108                          maximum_triangle_area=project.res_poly_all,
    109                          interior_regions=project.interior_regions,
    110                          filename=project.meshes_dir_name,
    111                          use_cache=True,
    112                          verbose=True)
     104                             boundary_tags=boundary_tags,
     105                             maximum_triangle_area=project.res_poly_all,
     106                             interior_regions=project.interior_regions,
     107                             filename=project.meshes_dir_name,
     108                             use_cache=True,
     109                             verbose=True)
    113110   
    114111    #-------------------------------------------------------------------------
     
    145142                        verbose = True,
    146143                        alpha = kwargs['alpha'])
     144
     145    # Add buildings from file
     146    building_polygons, building_heights = csv2building_polygons(project.building_polygon_file)
     147
     148    L = []
     149    for key in building_polygons:
     150        poly = building_polygons[key]
     151        elev = building_heights[key]
     152        L.append((poly, elev))
     153       
     154    #Q1 = domain.get_quantity('elevation')
     155    #Q2 = Quantity(domain) # Temporary quantity for buildings
     156    #Q2.set_values(Polygon_function(L, default=0.0))
     157    domain.add_quantity('elevation', Polygon_function(L, default=0.0))
     158   
    147159    print 'Finished Set quantity'
    148160
     
    217229    store_parameters(**kwargs)
    218230     
    219     print 'memory usage before del domain1',mem_usage()
    220231   
    221232   
Note: See TracChangeset for help on using the changeset viewer.