1 | import project_slide, os |
---|
2 | import sys |
---|
3 | |
---|
4 | from anuga.shallow_water.data_manager import sww2dem |
---|
5 | from os import sep |
---|
6 | |
---|
7 | # first run |
---|
8 | #time_dir = '20061211_060105' #bulli |
---|
9 | #time_dir = '20061212_012715' #shovel |
---|
10 | #time_dir = '20061212_064735' #yacaaba |
---|
11 | |
---|
12 | # second run |
---|
13 | #time_dir = '20070121_213616' #yacaaba |
---|
14 | #time_dir = '20070121_213550' #bulli |
---|
15 | #time_dir = '20070119_055620' #shovel |
---|
16 | |
---|
17 | # timing run - flux limiter in place |
---|
18 | time_dir = '20070208_045514' # bulli |
---|
19 | #time_dir = '20070208_044802' # for version without new flux limiter |
---|
20 | |
---|
21 | directory = project_slide.outputdir |
---|
22 | name = directory + time_dir + sep + project_slide.basename |
---|
23 | |
---|
24 | is_parallel = False |
---|
25 | if is_parallel == True: nodes = 4 |
---|
26 | print 'output dir:', name |
---|
27 | |
---|
28 | which_var = 2 |
---|
29 | if which_var == 0: # Stage |
---|
30 | outname = name + '_stage' |
---|
31 | quantityname = 'stage' |
---|
32 | |
---|
33 | if which_var == 1: # Absolute Momentum |
---|
34 | outname = name + '_momentum_i1' |
---|
35 | quantityname = '(xmomentum**2 + ymomentum**2)**0.5' |
---|
36 | |
---|
37 | if which_var == 2: # Depth |
---|
38 | outname = name + '_depth-bulli-fluxlimiter' |
---|
39 | quantityname = 'stage-elevation' |
---|
40 | |
---|
41 | if which_var == 3: # Speed |
---|
42 | outname = name + '_speed_i0' |
---|
43 | #quantityname = '((xmomentum/(stage-elevation))**2 + (ymomentum/(stage-elevation))**2)**0.5' #Speed |
---|
44 | quantityname = '(xmomentum**2 + ymomentum**2)**0.5/(stage-elevation+1.e-30)' #Speed |
---|
45 | |
---|
46 | if which_var == 4: # Elevation |
---|
47 | outname = name + '_elevation' |
---|
48 | quantityname = 'elevation' #Elevation |
---|
49 | |
---|
50 | if is_parallel == True: |
---|
51 | for i in range(0,nodes): |
---|
52 | namei = name + '_P%d_%d' %(i,nodes) |
---|
53 | outnamei = outname + '_P%d_%d' %(i,nodes) |
---|
54 | print 'start sww2dem for sww file %d' %(i) |
---|
55 | sww2dem(namei, basename_out = outnamei, |
---|
56 | quantity = quantityname, |
---|
57 | timestep = 1, |
---|
58 | cellsize = 100, |
---|
59 | #easting_min = project.e_min_area, |
---|
60 | #easting_max = project.e_max_area, |
---|
61 | #northing_min = project.n_min_area, |
---|
62 | #northing_max = project.n_max_area, |
---|
63 | reduction = max, |
---|
64 | verbose = True, |
---|
65 | format = 'asc') |
---|
66 | else: |
---|
67 | print 'start sww2dem' |
---|
68 | sww2dem(name, basename_out = outname, |
---|
69 | quantity = quantityname, |
---|
70 | cellsize = 20, |
---|
71 | easting_min = project_slide.eastingmin, |
---|
72 | easting_max = project_slide.eastingmax, |
---|
73 | northing_min = project_slide.northingmin, |
---|
74 | northing_max = project_slide.northingmax, |
---|
75 | reduction = max, |
---|
76 | verbose = True, |
---|
77 | format = 'asc') |
---|