1 | |
---|
2 | from anuga.shallow_water.data_manager import sww2dem |
---|
3 | from os import sep |
---|
4 | wave = [-0.5] |
---|
5 | B = len(wave) |
---|
6 | for l in range(B): |
---|
7 | name = 'curved_down_slope_2' |
---|
8 | |
---|
9 | |
---|
10 | time_dir = str(name)+'_'+str(wave[l])+'_300000_150000' |
---|
11 | cellsize = 50 |
---|
12 | timestep = None |
---|
13 | output_dir = sep+'d'+sep+'sim'+sep+'1'+sep+'mpittard'+sep+'idealised_bathymetry_study'+sep |
---|
14 | directory = output_dir |
---|
15 | name = directory+time_dir+sep+str(name) |
---|
16 | is_parallel = False |
---|
17 | if is_parallel == True: nodes = 4 |
---|
18 | print 'output dir:', name |
---|
19 | |
---|
20 | #var = [0,2,3] # stage, depth and speed |
---|
21 | var = [0] |
---|
22 | |
---|
23 | for which_var in var: |
---|
24 | if which_var == 0: # Stage |
---|
25 | outname = name + '_stage' |
---|
26 | quantityname = 'stage' |
---|
27 | |
---|
28 | if which_var == 1: # Absolute Momentum |
---|
29 | outname = name + '_momentum_i1' |
---|
30 | quantityname = '(xmomentum**2 + ymomentum**2)**0.5' |
---|
31 | |
---|
32 | if which_var == 2: # Depth |
---|
33 | outname = name + '_depth' |
---|
34 | quantityname = 'stage-elevation' |
---|
35 | |
---|
36 | if which_var == 3: # Speed |
---|
37 | outname = name + '_speed' |
---|
38 | quantityname = '(xmomentum**2 + ymomentum**2)**0.5/(stage-elevation+1.e-6/(stage-elevation))' #Speed |
---|
39 | |
---|
40 | if which_var == 4: # Elevation |
---|
41 | outname = name + '_elevation' |
---|
42 | quantityname = 'elevation' #Elevation |
---|
43 | |
---|
44 | if is_parallel == True: |
---|
45 | # print 'is_parallel',is_parallel |
---|
46 | for i in range(0,nodes): |
---|
47 | namei = name + '_P%d_%d' %(i,nodes) |
---|
48 | outnamei = outname + '_P%d_%d' %(i,nodes) |
---|
49 | print 'start sww2dem for sww file %d' %(i) |
---|
50 | sww2dem(namei, basename_out = outnamei, |
---|
51 | quantity = quantityname, |
---|
52 | timestep = timestep, |
---|
53 | cellsize = cellsize, |
---|
54 | easting_min = 0, |
---|
55 | easting_max = 150000, |
---|
56 | northing_min = 0, |
---|
57 | northing_max = 400, |
---|
58 | reduction = max, |
---|
59 | verbose = True, |
---|
60 | format = 'asc') |
---|
61 | else: |
---|
62 | print 'start sww2dem' |
---|
63 | sww2dem(name, basename_out = outname, |
---|
64 | quantity = quantityname, |
---|
65 | timestep = timestep, |
---|
66 | cellsize = cellsize, |
---|
67 | ## easting_min = 0, |
---|
68 | ## easting_max = 150000, |
---|
69 | ## northing_min = 0, |
---|
70 | ## northing_max = 400, |
---|
71 | reduction = max, |
---|
72 | verbose = True, |
---|
73 | format = 'asc') |
---|
74 | |
---|