- Timestamp:
- Jun 30, 2009, 2:07:41 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_validation/automated_validation_tests/patong_beach_validation/run_model.py
r6927 r7276 28 28 # Related major packages 29 29 from Scientific.IO.NetCDF import NetCDFFile 30 import Numericas num30 #import numpy as num 31 31 32 32 from anuga.interface import create_domain_from_regions … … 44 44 from anuga.utilities.polygon import read_polygon, Polygon_function 45 45 from anuga.caching import cache 46 47 import anuga.utilities.log as log 46 48 47 49 # Application specific imports … … 70 72 #------------------------------------------------------------------------------- 71 73 72 print 'Create computational domain' 74 log.critical('Create computational domain') 73 75 74 76 # Create the STS file … … 76 78 # We need to use caching instead! 77 79 78 print 'project.mux_data_folder=%s' % project.mux_data_folder 80 log.critical( 'project.mux_data_folder=%s' % project.mux_data_folder) 79 81 if not os.path.exists(project.event_sts + '.sts'): 80 82 bub.build_urs_boundary(project.mux_input_filename, project.event_sts) … … 111 113 use_cache=True, 112 114 verbose=True) 113 print domain.statistics()115 log.critical(domain.statistics()) 114 116 115 117 # FIXME(Ole): How can we make this more automatic? … … 125 127 #------------------------------------------------------------------------------- 126 128 127 print 'Setup initial conditions' 129 log.critical('Setup initial conditions') 128 130 129 131 # Set the initial stage in the offcoast region only … … 144 146 if project.use_buildings: 145 147 # Add buildings from file 146 print 'Reading building polygons'148 log.critical('Reading building polygons') 147 149 building_polygons, building_heights = csv2building_polygons(project.building_polygon) 148 150 #clipping_polygons=project.building_area_polygons) 149 151 150 print 'Creating %d building polygons' % len(building_polygons)152 log.critical('Creating %d building polygons' % len(building_polygons)) 151 153 def create_polygon_function(building_polygons, geo_reference=None): 152 154 L = [] 153 155 for i, key in enumerate(building_polygons): 154 if i%100==0: print i156 if i%100==0: log.critical(i) 155 157 poly = building_polygons[key] 156 158 elev = building_heights[key] … … 161 163 return buildings 162 164 163 print 'Creating %d building polygons' % len(building_polygons)165 log.critical('Creating %d building polygons' % len(building_polygons)) 164 166 buildings = cache(create_polygon_function, 165 167 building_polygons, … … 167 169 verbose=True) 168 170 169 print 'Adding buildings'171 log.critical('Adding buildings') 170 172 domain.add_quantity('elevation', 171 173 buildings, … … 178 180 #------------------------------------------------------------------------------- 179 181 180 print 'Set boundary - available tags:', domain.get_boundary_tags()182 log.critical('Set boundary - available tags:' % domain.get_boundary_tags()) 181 183 182 184 Br = Reflective_boundary(domain) … … 204 206 for t in domain.evolve(yieldstep=2000, 205 207 finaltime=6000): 206 print domain.timestepping_statistics()207 print domain.boundary_statistics(tags='ocean')208 log.critical(domain.timestepping_statistics()) 209 log.critical(domain.boundary_statistics(tags='ocean')) 208 210 209 211 # Start detailed model … … 211 213 finaltime=project.finaltime, 212 214 skip_initial_step=True): 213 print domain.timestepping_statistics()214 print domain.boundary_statistics(tags='ocean')215 log.critical(domain.timestepping_statistics()) 216 log.critical(domain.boundary_statistics(tags='ocean')) 215 217 216 print 'Simulation took %.2f seconds' %(time.time()-t0)218 log.critical('Simulation took %.2f seconds' %(time.time()-t0)) 217 219
Note: See TracChangeset
for help on using the changeset viewer.