1 | """ |
---|
2 | Quick plot of the dam break outputs |
---|
3 | |
---|
4 | """ |
---|
5 | import util |
---|
6 | from matplotlib import pyplot as pyplot |
---|
7 | |
---|
8 | p_st = util.get_output('dam_break_20120305_124724/dam_break.sww') |
---|
9 | p2_st=util.get_centroids(p_st) |
---|
10 | |
---|
11 | p_dev = util.get_output('dam_break_20130219_202649/dam_break.sww', 0.001) |
---|
12 | p2_dev=util.get_centroids(p_dev, velocity_extrapolation=True) |
---|
13 | |
---|
14 | pyplot.clf() |
---|
15 | pyplot.ion() |
---|
16 | pyplot.plot(p2_st.x, p2_st.stage[10,:],'r-', label='standard') |
---|
17 | pyplot.plot(p2_st.x, p2_st.stage[50,:], 'r-') |
---|
18 | pyplot.plot(p2_st.x, p2_st.stage[100,:], 'r-') |
---|
19 | |
---|
20 | pyplot.plot(p2_dev.x, p2_dev.stage[10,:],'b-', label='devel') |
---|
21 | pyplot.plot(p2_dev.x, p2_dev.stage[50,:],'b-') |
---|
22 | pyplot.plot(p2_dev.x, p2_dev.stage[100,:],'b-') |
---|
23 | |
---|
24 | pyplot.title('Stage at several instants in time') |
---|
25 | |
---|
26 | pyplot.legend(loc=3) |
---|
27 | pyplot.savefig('stage_plot.png') |
---|
28 | |
---|
29 | pyplot.clf() |
---|
30 | pyplot.ion() |
---|
31 | pyplot.plot(p2_st.x, p2_st.xvel[10,:], 'r-', label='standard') |
---|
32 | pyplot.plot(p2_st.x, p2_st.xvel[50,:], 'r-') |
---|
33 | pyplot.plot(p2_st.x, p2_st.xvel[100,:],'r-') |
---|
34 | |
---|
35 | pyplot.plot(p2_dev.x, p2_dev.xvel[10,:],'b-', label='devel') |
---|
36 | pyplot.plot(p2_dev.x, p2_dev.xvel[50,:],'b-') |
---|
37 | pyplot.plot(p2_dev.x, p2_dev.xvel[100,:],'b-') |
---|
38 | |
---|
39 | pyplot.title('Velocity at several instants in time') |
---|
40 | |
---|
41 | pyplot.legend(loc=2) |
---|
42 | pyplot.savefig('xvel_plot.png') |
---|
43 | |
---|
44 | |
---|