Changeset 4525 for anuga_work/production/test_dampier_2006/test.py
- Timestamp:
- Jun 1, 2007, 4:06:46 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_work/production/test_dampier_2006/test.py
r4288 r4525 3 3 import os 4 4 5 import project 5 #import project 6 #from Numeric import allclose 6 7 from anuga.pmesh.mesh_interface import create_mesh_from_regions 7 8 from anuga.shallow_water import Domain 8 9 from anuga.shallow_water import File_boundary 10 from time import localtime, strftime, gmtime 9 11 10 12 home = getenv('INUNDATIONHOME') #Sandpit's parent dir … … 13 15 state = 'western_australia' 14 16 scenario_name = 'dampier' 15 scenario = ' dampier_tsunami_scenario_2006'17 scenario = 'test_dampier' 16 18 an = 'anuga' 17 19 bo = 'boundaries' 20 topo = 'topographies' 21 out = 'outputs' 18 22 urs = 'urs' 19 23 gridded = '1_10000' 20 best_boundary_sww_file = 'o_test_8500_12000.sww' 24 #best_boundary_sww_file = 'o_test_8500_12000.sww' 25 best_boundary_sww_file = 'o_8500_12000_no_zone.sww' 26 27 time = strftime('%Y%m%d_%H%M%S',localtime()) #gets time for new dir 28 gtime = strftime('%Y%m%d_%H%M%S',gmtime()) #gets time for new dir 29 run_time = time+'_run' 30 print 'gtime: ', gtime 31 print 'time: ', time 32 21 33 22 34 mesh_filename = 'small.tsh' # this will be local 23 best_boundary_sww = os.path.join(data,state,scenario_name, 24 scenario,an,bo,best_boundary_sww_file) 35 best_boundary_sww = os.path.join(home,data,state,scenario,an,bo,best_boundary_sww_file) 36 #J:\inundation\data\western_australia\dampier_tsunami_scenario_2006\anuga\topographies 37 38 elevation_file = 'dampier_combined_elevation_smallest.txt' 39 smallest_elevation= os.path.join(home,data,state,scenario,an,topo,elevation_file) 40 41 output= os.path.join(home,data,state,scenario,an,out,run_time) 25 42 26 43 #pro_instance = project.Project([data,state,scenario_name], 27 44 # outputdir_name=outputdir_name) 28 45 29 poly_all = [[250000,7660000],[280000,7660000], 30 [280000,7630000]] 46 #poly_all = [[250000,7660000],[280000,7660000], [280000,7630000]] 47 poly_all = [[469000,7760000],[470000,7758000],[468000,7758000]] 48 49 print 'create mesh' 31 50 create_mesh_from_regions(poly_all, 32 51 boundary_tags={'back': [0,1,2]}, … … 38 57 print domain.statistics() 39 58 40 domain.set_quantity('stage', 0.0)59 domain.set_quantity('stage', 2.4) 41 60 domain.set_quantity('friction', 0.01) 61 domain.set_name(scenario_name) 62 domain.set_datadir(output) 63 64 print 'set elevation',smallest_elevation 65 42 66 domain.set_quantity('elevation', 43 # filename = project.combined_dir_name + '.pts', 44 # MUST USE TXT FILES FOR CACHING TO WORK! 45 filename = project.combined_smaller_dir_name + '.txt', 67 filename = smallest_elevation, 46 68 use_cache = True, 47 69 verbose = True, 48 70 alpha = 0.1) 49 71 72 73 print 'best_boundary_sww',best_boundary_sww 74 75 print 'get file boundary' 50 76 Bf = File_boundary(best_boundary_sww, 51 domain, use_cache=False, verbose=True) 77 domain, time_thinning=24, use_cache=False, verbose=True) 78 79 domain.set_boundary({'back': Bf}) 80 81 82 #t0 = time.time() 83 84 print 'evolve' 85 for t in domain.evolve(yieldstep = 120, finaltime = 3400): 86 domain.write_time() 87 domain.write_boundary_statistics(tags = 'back') 88 89 90 91
Note: See TracChangeset
for help on using the changeset viewer.