Changeset 3615
- Timestamp:
- Sep 18, 2006, 5:19:25 PM (18 years ago)
- Location:
- anuga_work/production/hobart_2006
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_work/production/hobart_2006/project.py
r3559 r3615 2 2 """Common filenames and locations for topographic data, meshes and outputs. 3 3 """ 4 5 6 4 7 5 from os import sep, environ, getenv, getcwd … … 67 65 68 66 onshore_dem_name = datadir + onshore_name 69 offshore_dem_name = datadir + offshore_name 67 offshore_dem_name_local = datadir + offshore_name_local 68 offshore_dem_name_aho = datadir + offshore_name_fairsheets 70 69 coast_dem_name = datadir + coast_name 71 70 combined_dem_name = datadir + 'hobart_combined_elevation' … … 73 72 outputname = outputtimedir + basename #Used by post processing 74 73 75 from anuga.coordinate_transforms.redfearn import degminsec2decimal_degrees 76 from anuga.coordinate_transforms.redfearn import redfearn 74 # region to export 75 e_min_area = 500000 76 e_max_area = 540000 77 n_min_area = 5220000 78 n_max_area = 5275000 77 79 80 from anuga.coordinate_transforms.redfearn import degminsec2decimal_degrees, 81 convert_points_from_latlon_to_utm 82 78 83 # bounding box 79 84 south = degminsec2decimal_degrees(-43,45,0) … … 82 87 east = degminsec2decimal_degrees(148,15,0) 83 88 84 ''' 85 # region for visualisation 86 eminviz = 260000 87 emaxviz = 320000 88 nminviz = 7590000 89 nmaxviz = 7630000 90 ''' 91 # region to export 89 #Main Domain of Hobart: first run JS 18/9/06 90 d0 = [south, west] 91 d1 = [south, east] 92 d2 = [north, east] 93 d3 = [north, west] 92 94 93 e_min_area = 300000 94 e_max_area = 310000 95 n_min_area = 7600000 96 n_max_area = 7610000 95 polyAll, zone = convert_points_from_latlon_to_utm([d0, d1, d2, d3]) 96 refzone = zone 97 97 98 99 #Main Domain of Hobart: first run JS 15/9/06 100 zone, e0, n0 = redfearn(south, west) 101 zone, e1, n1 = redfearn(south, east) 102 zone, e2, n2 = redfearn(north, east) 103 zone, e3, n3 = redfearn(north, west) 104 refzone = zone 105 d0 = [e0, n0] 106 d1 = [e1, n1] 107 d2 = [e2, n2] 108 d3 = [e3, n3] 109 110 polyAll = [d0, d1, d2, d3] 111 112 #Interior region - Hobart city area 113 #from anuga.utilities.polygon import read_polygon 114 polygonptsfile0 = polygondir + 'poly1 115 polygonptsfile1 = polygondir + 'poly2 116 northern_polygon = read_polygon(polygonptsfile0 + '.csv') 117 southern_polygon = read_polygon(polygonptsfile1 + '.csv') 118 119 i0 = [304000, 7607000] 120 i1 = [302000, 7605000] 121 i2 = [304000, 7603000] 122 i3 = [307000, 7602000] 123 i4 = [309000, 7603000] 124 i5 = [307000, 7606000] 98 #Interior region - Hobart city area + glenorchy, Kingston 99 i0 = [517000, 5267000] 100 i1 = [517000, 5255000] 101 i2 = [520000, 5250000] 102 i3 = [522000, 5239000] 103 i4 = [524000, 5238000] 104 i5 = [526000, 5236000] 105 i6 = [530000, 5244000] 106 i7 = [530000, 5250000] 107 i7 = [534000, 5254000] 108 i7 = [520000, 5270000] 125 109 126 110 poly_hobart = [i0, i1, i2, i3, i4, i5] 127 111 128 #med res around Hobart 129 l0 = [300000, 7610000] 130 l1 = [285000, 7600000] 131 l2 = [300000, 7597500] 132 l3 = [310000, 7600000] 133 l4 = [315000, 7610000] 112 # Tasman Peninsula 113 l0 = [550000, 5247000] 114 l1 = [550000, 5211000] 115 l2 = [583000, 5211000] 116 l3 = [583000, 5247000] 134 117 135 poly_coast = [l0, l1, l2, l3, l4] 136 137 #general coast and local area to Hobart region 138 m0 = [270000, 7581000] 139 m1 = [300000, 7591000] 140 m2 = [339000, 7610000] 141 m3 = [330000, 7630000] 142 m4 = [290000, 7640000] 143 m5 = [260000, 7600000] 144 145 poly_region = [m0, m1, m2, m3, m4, m5] 118 poly_tasman_peninsula = [l0, l1, l2, l3] 146 119 147 120 # Bruny Island 148 poly_bruny = [b0, b1, b2, b3, b4] 121 from anuga.utilities.polygon import read_polygon 122 poly_bruny = read_polygon(polygondir+'bruny.csv') -
anuga_work/production/hobart_2006/run_hobart.py
r3559 r3615 6 6 7 7 The scenario is defined by a triangular mesh created from project.polygon, 8 the elevation data and a simulated submarine landslide.8 the elevation data and a tsunami wave generated by MOST. 9 9 10 10 Ole Nielsen and Duncan Gray, GA - 2005 and Nick Bartzis, GA - 2006 11 11 """ 12 13 14 12 #-------------------------------------------------------------------------------# Import necessary modules 15 13 #------------------------------------------------------------------------------- … … 67 65 # filenames 68 66 onshore_dem_name = project.onshore_dem_name 69 coast_points = project.coast_dem_name70 offshore_points = project.offshore_dem_name71 67 meshname = project.meshname+'.msh' 72 68 source_dir = project.boundarydir … … 81 77 82 78 #creates pts file for onshore DEM 83 dem2pts(onshore_dem_name, 84 easting_min=project.eastingmin, 85 easting_max=project.eastingmax, 86 northing_min=project.northingmin, 87 northing_max= project.northingmax, 88 use_cache=True, 89 verbose=True) 90 91 convert_dem_from_ascii2netcdf(islands_dem_name, use_cache=True, verbose=True) 92 93 #creates pts file for islands DEM 94 dem2pts(islands_dem_name, use_cache=True, verbose=True) 79 dem2pts(onshore_dem_name, use_cache=True, verbose=True) 95 80 96 81 print'create G1' 97 G1 = Geospatial_data(file_name = project.offshore_dem_name + '.xya')82 G1 = Geospatial_data(file_name = project.offshore_dem_name_local + '.xya') 98 83 print'create G2' 99 G2 = Geospatial_data(file_name = project.o nshore_dem_name + '.pts')84 G2 = Geospatial_data(file_name = project.offshore_dem_name_aho + '.xya') 100 85 print'create G3' 101 G3 = Geospatial_data(file_name = project.coast_dem_name + '.xya') 102 print'add G1+G2+G3' 103 G = G1 + G2 + G3 86 G3 = Geospatial_data(file_name = project.onshore_dem_name + '.pts') 87 print'create G4' 88 G4 = Geospatial_data(file_name = project.coast_dem_name + '.xya') 89 print'add G1+G2+G3+G4' 90 G = G1 + G2 + G3 + G4 104 91 print'export G' 105 92 G.export_points_file(project.combined_dem_name + '.pts') … … 113 100 from anuga.pmesh.mesh_interface import create_mesh_from_regions 114 101 115 # new116 region_res = 200000117 coast_res = 25000118 hobart_res = 5000102 # use 75 for onshore components (12.5m DEM) 103 island_res = 10000 104 hobart_res = 10000 105 peninsular_res = 10000 119 106 interior_regions = [[project.poly_hobart, hobart_res], 120 [project.poly_ coast, coast_res],121 [project.poly_ region, region_res]]107 [project.poly_tasman_peninsula, peninsula_res], 108 [project.poly_bruny, island_res]] 122 109 123 110 print 'number of interior regions', len(interior_regions) … … 126 113 _ = cache(create_mesh_from_regions, 127 114 project.polyAll, 128 {'boundary_tags': {'top': [0], 'topleft': [1], 129 'topleft1': [2], 'bottomleft': [3], 130 'bottom': [4], 'bottomright': [5], 131 'topright':[6]}, 115 {'boundary_tags': {'bottom': [0], 'right': [1], 116 'top': [2], 'left': [3]}, 132 117 'maximum_triangle_area': 100000, 133 118 'filename': meshname, … … 177 162 print 'start ferret2sww' 178 163 from anuga.pyvolution.data_manager import ferret2sww 179 164 ''' 180 165 south = project.south 181 166 north = project.north … … 209 194 dependencies = source_dir + project.boundary_basename + '.sww') 210 195 211 196 ''' 212 197 print 'Available boundary tags', domain.get_boundary_tags() 213 198 214 Bf = File_boundary(source_dir + project.boundary_basename + '.sww',199 #Bf = File_boundary(source_dir + project.boundary_basename + '.sww', 215 200 domain, verbose = True) 216 201 Br = Reflective_boundary(domain) … … 222 207 f=lambda t: [(60<t<480)*6, 0, 0]) 223 208 224 domain.set_boundary( {'top': Bf, 'topleft': Bf, 225 'topleft1': Bf, 'bottomleft': Bd, 226 'bottom': Br, 'bottomright': Br, 'topright': Bd} ) 209 # for MOST BC 210 #domain.set_boundary( {'top': Bd, 'left': Bd, 211 # 'bottom': Bf, 'right': Bf} ) 212 213 # for testing 214 domain.set_boundary( {'top': Bd, 'left': Bd, 215 'bottom': Bd, 'right': Bw} ) 227 216 228 217 #------------------------------------------------------------------------------- … … 234 223 for t in domain.evolve(yieldstep = 240, finaltime = 7200): 235 224 domain.write_time() 236 domain.write_boundary_statistics(tags = ' top')225 domain.write_boundary_statistics(tags = 'bottom') 237 226 238 227 for t in domain.evolve(yieldstep = 120, finaltime = 12600 239 228 ,skip_initial_step = True): 240 229 domain.write_time() 241 domain.write_boundary_statistics(tags = 'top') 242 243 for t in domain.evolve(yieldstep = 60, finaltime = 19800 244 ,skip_initial_step = True): 245 domain.write_time() 246 domain.write_boundary_statistics(tags = 'top') 247 248 for t in domain.evolve(yieldstep = 120, finaltime = 25200 249 ,skip_initial_step = True): 250 domain.write_time() 251 domain.write_boundary_statistics(tags = 'top') 252 253 for t in domain.evolve(yieldstep = 240, finaltime = 36000 254 ,skip_initial_step = True): 255 domain.write_time() 256 domain.write_boundary_statistics(tags = 'top') 230 domain.write_boundary_statistics(tags = 'bottom') 257 231 258 232 print 'That took %.2f seconds' %(time.time()-t0)
Note: See TracChangeset
for help on using the changeset viewer.