Changeset 2456


Ignore:
Timestamp:
Feb 28, 2006, 10:28:16 AM (19 years ago)
Author:
sexton
Message:

Removing the creation of the interior regions from polygons (to come later). Include new mesh interface.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • production/sydney_2006/run_sydney_smf.py

    r2420 r2456  
    6363                                 project.combineddemname + '.pts')
    6464
     65#from pmesh.create_mesh import create_mesh_from_regions
     66# new interface
     67from pmesh.mesh_interface import create_mesh_from_regions
    6568
    66 #-------------------------------------------------------------------------------                                 
    67 # Create the triangular mesh based on overall clipping polygon with a tagged
    68 # boundary and interior regions defined in project.py along with
    69 # resolutions (maximal area of per triangle) for each polygon
    70 #-------------------------------------------------------------------------------
    71 
    72 #def get_polygon_from_file(filename):
    73 #    fid = open(filename)
    74 #    lines = fid.readlines()
    75 #    fid.close()
    76    
    77 #    polygon = []
    78 #    for line in lines[1:]:
    79 #       fields = line.split(',')
    80 #        x = float(fields[3])
    81 #        y = float(fields[4])
    82 #        polygon.append([x, y])
    83        
    84 #    return interior_polygon
    85 
    86 from pmesh.create_mesh import create_mesh_from_regions
    87 
    88 num_polygons = 1
    89 filelist = []
    90 fileext = '.csv'
    91 filename = project.polygonptsfile
    92 interior_res = 50000
    93 
    94 for p in range(1, num_polygons+1):
    95     thefilename = filename + str(p) + fileext
    96     interior_polygon = get_polygon_from_file(thefilename)
    97     interior_regions.append([interior_polygon, interior_res])
    98    
    99 # test
    100 #interior_regions = [[project.poly1, interior_res],
    101 #                    [project.poly2, interior_res]]
    10269# original
    103 #interior_regions = [[project.harbour_polygon_2, interior_res],
    104 #                    [project.botanybay_polygon_2, interior_res]]
     70interior_res = 5000
     71interior_regions = [[project.harbour_polygon_2, interior_res],
     72                    [project.botanybay_polygon_2, interior_res]]
    10573
    10674#FIXME: Fix caching of this one once the mesh_interface is ready
    10775from caching import cache
     76
    10877_ = cache(create_mesh_from_regions,
    10978          project.diffpolygonall,
     
    11281                             'right2': [3], 'top': [4], 'left1': [5],
    11382                             'left2': [6], 'left3': [7]},
    114            'resolution': 100000,
     83           'maximum_triangle_area': 100000,
    11584           'filename': meshname,           
    116            'interior_regions': interior_regions,
    117            'UTM': True,
    118            'refzone': project.refzone},
     85           'interior_regions': interior_regions},
    11986          verbose = True)
    12087
     
    157124
    158125domain.set_quantity('stage', tsunami_source)
    159 domain.set_quantity('friction', 0.03) # supplied by Benfield
     126domain.set_quantity('friction', 0.0)
    160127domain.set_quantity('elevation',
    161128                    filename = project.combineddemname + '.pts',
Note: See TracChangeset for help on using the changeset viewer.