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

Work towards buildings in Patong simulation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.