source: anuga_work/production/test_dampier_2006/test.py @ 7614

Last change on this file since 7614 was 4525, checked in by nick, 17 years ago

update run

File size: 2.9 KB
Line 
1
2from os import sep, environ, getenv, getcwd
3import os
4
5#import project
6#from Numeric import allclose
7from anuga.pmesh.mesh_interface import create_mesh_from_regions
8from anuga.shallow_water import Domain
9from anuga.shallow_water import File_boundary
10from time import localtime, strftime, gmtime
11
12home = getenv('INUNDATIONHOME') #Sandpit's parent dir   
13#user = get_user_name()
14data = 'data'
15state = 'western_australia'
16scenario_name = 'dampier'
17scenario = 'test_dampier'
18an = 'anuga'
19bo = 'boundaries'
20topo = 'topographies'
21out = 'outputs'
22urs = 'urs'
23gridded = '1_10000'
24#best_boundary_sww_file = 'o_test_8500_12000.sww'
25best_boundary_sww_file = 'o_8500_12000_no_zone.sww'
26
27time = strftime('%Y%m%d_%H%M%S',localtime()) #gets time for new dir
28gtime = strftime('%Y%m%d_%H%M%S',gmtime()) #gets time for new dir
29run_time = time+'_run'
30print 'gtime: ', gtime
31print 'time: ', time
32
33
34mesh_filename = 'small.tsh' # this will be local
35best_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                                 
38elevation_file = 'dampier_combined_elevation_smallest.txt'
39smallest_elevation= os.path.join(home,data,state,scenario,an,topo,elevation_file)
40
41output= os.path.join(home,data,state,scenario,an,out,run_time)
42
43#pro_instance = project.Project([data,state,scenario_name],
44#                                       outputdir_name=outputdir_name)
45
46#poly_all = [[250000,7660000],[280000,7660000], [280000,7630000]]
47poly_all = [[469000,7760000],[470000,7758000],[468000,7758000]]
48
49print 'create mesh'
50create_mesh_from_regions(poly_all,
51                             boundary_tags={'back': [0,1,2]},
52                             maximum_triangle_area=100000000000000000000,
53                             filename=mesh_filename,
54                             use_cache=False,
55                             verbose=True)
56domain = Domain( mesh_filename, verbose=True)
57print domain.statistics()
58
59domain.set_quantity('stage', 2.4)
60domain.set_quantity('friction', 0.01)
61domain.set_name(scenario_name)
62domain.set_datadir(output)
63
64print 'set elevation',smallest_elevation
65
66domain.set_quantity('elevation', 
67                    filename = smallest_elevation,
68                    use_cache = True,
69                    verbose = True,
70                    alpha = 0.1)
71                   
72
73print 'best_boundary_sww',best_boundary_sww
74
75print 'get file boundary'
76Bf = File_boundary(best_boundary_sww,
77                  domain,  time_thinning=24, use_cache=False, verbose=True)
78                 
79domain.set_boundary({'back': Bf})
80                     
81                     
82#t0 = time.time()
83
84print 'evolve'
85for 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 TracBrowser for help on using the repository browser.