Changeset 2456
- Timestamp:
- Feb 28, 2006, 10:28:16 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
production/sydney_2006/run_sydney_smf.py
r2420 r2456 63 63 project.combineddemname + '.pts') 64 64 65 #from pmesh.create_mesh import create_mesh_from_regions 66 # new interface 67 from pmesh.mesh_interface import create_mesh_from_regions 65 68 66 #-------------------------------------------------------------------------------67 # Create the triangular mesh based on overall clipping polygon with a tagged68 # boundary and interior regions defined in project.py along with69 # resolutions (maximal area of per triangle) for each polygon70 #-------------------------------------------------------------------------------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_polygon85 86 from pmesh.create_mesh import create_mesh_from_regions87 88 num_polygons = 189 filelist = []90 fileext = '.csv'91 filename = project.polygonptsfile92 interior_res = 5000093 94 for p in range(1, num_polygons+1):95 thefilename = filename + str(p) + fileext96 interior_polygon = get_polygon_from_file(thefilename)97 interior_regions.append([interior_polygon, interior_res])98 99 # test100 #interior_regions = [[project.poly1, interior_res],101 # [project.poly2, interior_res]]102 69 # original 103 #interior_regions = [[project.harbour_polygon_2, interior_res], 104 # [project.botanybay_polygon_2, interior_res]] 70 interior_res = 5000 71 interior_regions = [[project.harbour_polygon_2, interior_res], 72 [project.botanybay_polygon_2, interior_res]] 105 73 106 74 #FIXME: Fix caching of this one once the mesh_interface is ready 107 75 from caching import cache 76 108 77 _ = cache(create_mesh_from_regions, 109 78 project.diffpolygonall, … … 112 81 'right2': [3], 'top': [4], 'left1': [5], 113 82 'left2': [6], 'left3': [7]}, 114 ' resolution': 100000,83 'maximum_triangle_area': 100000, 115 84 'filename': meshname, 116 'interior_regions': interior_regions, 117 'UTM': True, 118 'refzone': project.refzone}, 85 'interior_regions': interior_regions}, 119 86 verbose = True) 120 87 … … 157 124 158 125 domain.set_quantity('stage', tsunami_source) 159 domain.set_quantity('friction', 0.0 3) # supplied by Benfield126 domain.set_quantity('friction', 0.0) 160 127 domain.set_quantity('elevation', 161 128 filename = project.combineddemname + '.pts',
Note: See TracChangeset
for help on using the changeset viewer.