|
12 | 12 | from solution_dedalus import solution_dedalus |
13 | 13 | from solution_linear import solution_linear |
14 | 14 |
|
15 | | -from get_matrix import get_upwind, get_centered, get_diffusion |
| 15 | +from get_matrix import get_upwind, get_centered, get_diffusion, get_desterck |
16 | 16 | from impeuler import impeuler |
17 | 17 | from intexact import intexact |
18 | 18 | from trapezoidal import trapezoidal |
|
29 | 29 | except: |
30 | 30 | print("No or wrong command line argument provided, creating figure 13. Use 13, 14, 15 or 16 as command line argument.") |
31 | 31 | figure = 5 |
32 | | -assert 13<= figure <= 16 or figure==0, "Figure should be 13, 14, 15 or 16" |
| 32 | +assert 13<= figure <= 16 or figure==0 or figure==-1, "Figure should be 13, 14, 15 or 16" |
33 | 33 |
|
34 | | -if figure==13 or figure==14 or figure==0: |
| 34 | +if figure==13 or figure==14 or figure==0 or figure==-1: |
35 | 35 | par = parameter(dedalus = False) |
36 | 36 | ndof_c = 24 |
37 | 37 | elif figure==15: |
|
91 | 91 | para = parareal(0.0, Tend, nslices, impeuler, impeuler, nfine, ncoarse, tol, maxiter, u0fine, u0coarse) |
92 | 92 | filename = 'figure_00.pdf' |
93 | 93 | D = A_f*A_f.H - A_f.H*A_f |
94 | | - print("Normality number of the system matrix (this should be zero): %5.3f" % np.linalg.norm(D.todense())) |
| 94 | + print("Normality number of the system matrix (this should be zero): %5.3f" % np.linalg.norm(D.todense())) |
| 95 | +elif figure==-1: |
| 96 | + p = 5 |
| 97 | + xaxis_f = np.linspace(0.0, 1.0, ndof_f+1)[0:ndof_f] |
| 98 | + dx_f = xaxis_f[1] - xaxis_f[0] |
| 99 | + xaxis_c = np.linspace(0.0, 1.0, ndof_c+1)[0:ndof_c] |
| 100 | + dx_c = xaxis_c[1] - xaxis_c[0] |
| 101 | + A_f = get_desterck(ndof_f, dx_f, p) |
| 102 | + A_c = get_desterck(ndof_c, dx_c, p) |
| 103 | + u0fine = solution_linear(np.zeros(ndof_f), A_f) |
| 104 | + u0coarse = solution_linear(np.zeros(ndof_c), A_c) |
| 105 | + para = parareal(0.0, Tend, nslices, impeuler, impeuler, nfine, ncoarse, tol, maxiter, u0fine, u0coarse) |
| 106 | + filename = ('figure_conv_desterck_%i.pdf' % p) |
95 | 107 | else: |
96 | 108 | sys.exit("Wrong value for figure") |
97 | 109 |
|
|
0 commit comments