Changeset 6264 for anuga_work/production/patong/run_patong.py
- Timestamp:
- Feb 3, 2009, 6:22:23 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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.