Changeset 6832 for branches/numpy_anuga_validation
- Timestamp:
- Apr 17, 2009, 3:47:54 PM (16 years ago)
- Location:
- branches/numpy_anuga_validation/automated_validation_tests/patong_beach_validation
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/numpy_anuga_validation/automated_validation_tests/patong_beach_validation/run_model.py
r6788 r6832 45 45 from anuga.caching import cache 46 46 47 import anuga.utilities.log as log 48 47 49 # Application specific imports 48 50 from setup_model import project … … 65 67 #------------------------------------------------------------------------------- 66 68 67 print 'Create computational domain' 69 log.critical('Create computational domain') 68 70 69 71 # Create the STS file 70 print 'project.mux_data_folder=%s' % project.mux_data_folder 72 log.critical( 'project.mux_data_folder=%s' % project.mux_data_folder) 71 73 if not os.path.exists(project.event_sts + '.sts'): 72 74 bub.build_urs_boundary(project.mux_input_filename, project.event_sts) … … 103 105 use_cache=True, 104 106 verbose=True) 105 print domain.statistics()107 log.critical(domain.statistics()) 106 108 107 109 # FIXME(Ole): How can we make this more automatic? … … 117 119 #------------------------------------------------------------------------------- 118 120 119 print 'Setup initial conditions' 121 log.critical('Setup initial conditions') 120 122 121 123 # Set the initial stage in the offcoast region only … … 136 138 if project.use_buildings: 137 139 # Add buildings from file 138 print 'Reading building polygons'140 log.critical('Reading building polygons' ) 139 141 building_polygons, building_heights = csv2building_polygons(project.building_polygon) 140 142 #clipping_polygons=project.building_area_polygons) 141 143 142 print 'Creating %d building polygons' % len(building_polygons)144 log.critical('Creating %d building polygons' % len(building_polygons)) 143 145 def create_polygon_function(building_polygons, geo_reference=None): 144 146 L = [] 145 147 for i, key in enumerate(building_polygons): 146 if i%100==0: print i148 if i%100==0: log.critical(i) 147 149 poly = building_polygons[key] 148 150 elev = building_heights[key] … … 158 160 verbose=True) 159 161 160 print 'Adding buildings'162 log.critical('Adding buildings') 161 163 domain.add_quantity('elevation', 162 164 buildings, … … 169 171 #------------------------------------------------------------------------------- 170 172 171 print 'Set boundary - available tags:', domain.get_boundary_tags()173 log.critical('Set boundary - available tags:', domain.get_boundary_tags()) 172 174 173 175 Br = Reflective_boundary(domain) … … 196 198 for t in domain.evolve(yieldstep=2000, 197 199 finaltime=6000): 198 print domain.timestepping_statistics()199 print domain.boundary_statistics(tags='ocean')200 log.critical(domain.timestepping_statistics()) 201 log.critical(domain.boundary_statistics(tags='ocean')) 200 202 201 203 # Start detailed model … … 203 205 finaltime=project.finaltime, 204 206 skip_initial_step=True): 205 print domain.timestepping_statistics()206 print domain.boundary_statistics(tags='ocean')207 log.critical(domain.timestepping_statistics()) 208 log.critical(domain.boundary_statistics(tags='ocean')) 207 209 208 print 'Simulation took %.2f seconds' %(time.time()-t0)210 log.critical('Simulation took %.2f seconds' %(time.time()-t0)) 209 211 -
branches/numpy_anuga_validation/automated_validation_tests/patong_beach_validation/validate_patong.py
r6828 r6832 143 143 return False 144 144 145 # unpack *.tgz files146 for data_object in Local_Data_Objects:147 tar_path = os.path.join(Local_Data_Directory, data_object+'.tgz')148 log.info('Untarring %s in directory %s ...'149 % (tar_path, Local_Data_Directory))150 untar_file(tar_path, target_dir=Local_Data_Directory)151 152 145 log.info('Local data has been refreshed.') 153 146 return True … … 185 178 log.critical('You have the required files.') 186 179 187 # now untar file/directory objects188 for data_object in Local_Data_Objects:189 tar_path = os.path.join(Local_Data_Directory, data_object+'.tgz')190 log.info('Untarring %s in directory %s ...'191 % (tar_path, Local_Data_Directory))192 untar_file(tar_path, target_dir=Local_Data_Directory)193 194 180 return True 195 181 … … 198 184 '''Run the Patong simulation.''' 199 185 186 ## # now untar file/directory objects 187 ## for data_object in Local_Data_Objects: 188 ## tar_path = os.path.join(Local_Data_Directory, data_object+'.tgz') 189 ## log.info('Untarring %s in directory %s ...' 190 ## % (tar_path, Local_Data_Directory)) 191 ## untar_file(tar_path, target_dir=Local_Data_Directory) 192 200 193 # modify environment so we use the local data 201 194 new_inundationhome = os.path.join(Local_Data_Directory, '') … … 325 318 326 319 # clean up 327 teardown()320 #teardown()
Note: See TracChangeset
for help on using the changeset viewer.