Changeset 6264
- Timestamp:
- Feb 3, 2009, 6:22:23 PM (16 years ago)
- Location:
- anuga_work/production/patong
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_work/production/patong/project.py
r6233 r6264 48 48 finaltime=15000 # final time for simulation 15000 49 49 50 setup=' basic' # Final can be replaced with trial or basic.50 setup='final' # Final can be replaced with trial or basic. 51 51 # Either will result in a coarser mesh that will allow a 52 52 # faster, but less accurate, simulation. … … 68 68 yieldstep=10 69 69 70 use_buildings = True 71 70 72 #------------------------------------------------------------------------------ 71 73 # Output Filename … … 73 75 # Important to distinguish each run - ensure str(user) is included! 74 76 # Note, the user is free to include as many parameters as desired 75 dir_comment='_'+setup+'_'+str(tide)+'_buildings_'+str(user) 77 if use_buildings: 78 dir_comment='_'+setup+'_'+str(tide)+'_buildings_'+str(user) 79 else: 80 dir_comment='_'+setup+'_'+str(tide)+'_nobuildings_'+str(user) 76 81 77 82 #------------------------------------------------------------------------------ … … 170 175 # Initial bounding polygon for data clipping 171 176 poly_all = read_polygon(polygons_dir+'poly_all.csv') 172 res_poly_all = 100000*res_factor 177 res_poly_all = 150000*res_factor 178 179 180 # Inundation area 181 poly_ia = read_polygon(polygons_dir+'inundation_area.csv') 182 res_ia = 75*res_factor 183 poly_saddle = read_polygon(polygons_dir+'saddle_10m.txt') 173 184 174 185 # Area of Interest 1 elevation from -10m to 20m … … 178 189 # Area of Significance 1 elevation from -20m to a 200m buffer of the 20m contour 179 190 poly_aos1 = read_polygon(polygons_dir+'aos.csv') 180 res_aos1 = 700*res_factor 191 res_aos1 = 900*res_factor 192 181 193 182 194 # Area of Shallow water and coastal land that needs a finer res than 1000000 183 # This is a rectangle.184 195 poly_sw = read_polygon(polygons_dir+'sw.csv') 185 196 res_sw = 6000*res_factor 197 186 198 187 199 … … 198 210 199 211 # Combined all regions, must check that all are included! 200 interior_regions = [[poly_aoi1,res_aoi1], 212 interior_regions = [[poly_ia, res_ia], 213 #[poly_saddle, res_ia], 214 [poly_aoi1,res_aoi1], 201 215 [poly_aos1,res_aos1], 202 216 [poly_sw,res_sw], -
anuga_work/production/patong/run_patong.py
r6233 r6264 28 28 from anuga.interface import create_domain_from_regions 29 29 from anuga.interface import Dirichlet_boundary 30 from anuga.interface import Transmissive_stage_zero_momentum_boundary 30 31 from anuga.interface import Reflective_boundary 31 32 from anuga.interface import Field_boundary … … 122 123 verbose=True) 123 124 124 125 # Add buildings from file126 print 'Reading building polygons'127 building_polygons, building_heights = csv2building_polygons(project.building_polygon_file)128 129 130 print 'Creating %d building polygons' % len(building_polygons)131 def create_polygon_function(building_polygons, geo_reference=None):132 L = []133 for i, key in enumerate(building_polygons):134 if i%100==0: print i135 poly = building_polygons[key]136 elev = building_heights[key]137 L.append((poly, elev))138 139 buildings = Polygon_function(L, default=0.0,140 geo_reference=geo_reference)141 return buildings142 143 buildings = cache(create_polygon_function,144 building_polygons,145 {'geo_reference': domain.geo_reference},146 verbose=True)147 148 print 'Adding buildings'149 domain.add_quantity('elevation',150 buildings,151 use_cache=True,152 verbose=True)125 if project.use_buildings: 126 # Add buildings from file 127 print 'Reading building polygons' 128 building_polygons, building_heights = csv2building_polygons(project.building_polygon_file) 129 #clipping_polygons=project.building_area_polygons) 130 131 print 'Creating %d building polygons' % len(building_polygons) 132 def create_polygon_function(building_polygons, geo_reference=None): 133 L = [] 134 for i, key in enumerate(building_polygons): 135 if i%100==0: print i 136 poly = building_polygons[key] 137 elev = building_heights[key] 138 L.append((poly, elev)) 139 140 buildings = Polygon_function(L, default=0.0, 141 geo_reference=geo_reference) 142 return buildings 143 144 buildings = cache(create_polygon_function, 145 building_polygons, 146 {'geo_reference': domain.geo_reference}, 147 verbose=True) 148 149 print 'Adding buildings' 150 domain.add_quantity('elevation', 151 buildings, 152 use_cache=True, 153 verbose=True) 153 154 154 155 … … 175 176 176 177 Br = Reflective_boundary(domain) 177 Bd = Dirichlet_boundary([project.tide,0,0]) 178 #Bd = Dirichlet_boundary([project.tide,0,0]) 179 Bs = Transmissive_stage_zero_momentum_boundary(domain) 178 180 Bf = Field_boundary(urs_boundary_name+'.sts', 179 181 domain, 180 182 mean_stage= project.tide, 181 183 time_thinning=project.time_thinning, 182 default_boundary=B d,184 default_boundary=Bs, 183 185 use_cache=True, 184 186 verbose=True, … … 186 188 187 189 domain.set_boundary({'back': Br, 188 'side': B d,190 'side': Bs, 189 191 'ocean': Bf}) 190 192 … … 195 197 t0 = time.time() 196 198 199 # Skip over the first 5000 seconds 200 for t in domain.evolve(yieldstep=500, 201 finaltime=5000): 202 print domain.timestepping_statistics() 203 print domain.boundary_statistics(tags='ocean') 204 205 # Start detailed model 197 206 for t in domain.evolve(yieldstep=project.yieldstep, 198 finaltime=project.finaltime): 207 finaltime=project.finaltime, 208 skip_initial_step=True): 199 209 print domain.timestepping_statistics() 200 210 print domain.boundary_statistics(tags='ocean')
Note: See TracChangeset
for help on using the changeset viewer.