|
19 | 19 | logger = Log.setup_custom_logger('root') |
20 | 20 |
|
21 | 21 | num_procs = 1 |
| 22 | + |
| 23 | + N_s = 100 |
| 24 | + N_f = 125 |
22 | 25 |
|
23 | 26 | # This comes as read-in for the level class |
24 | 27 | lparams = {} |
25 | 28 | lparams['restol'] = 1E-12 |
26 | 29 |
|
27 | 30 | sparams = {} |
28 | | - sparams['maxiter'] = 2 |
| 31 | + sparams['maxiter'] = 4 |
29 | 32 |
|
30 | 33 | # This comes as read-in for the problem class |
31 | 34 | pparams = {} |
32 | | - pparams['lambda_s'] = 1j*np.linspace(0,3,100) |
33 | | - pparams['lambda_f'] = 1j*np.linspace(0,8,100) |
| 35 | + pparams['lambda_s'] = 1j*np.linspace(0.0, 4.0, N_s) |
| 36 | + pparams['lambda_f'] = 1j*np.linspace(0.0, 8.0, N_f) |
34 | 37 | pparams['u0'] = 1 |
35 | 38 |
|
36 | 39 | # Fill description dictionary for easy hierarchy creation |
|
40 | 43 | description['dtype_u'] = mesh |
41 | 44 | description['dtype_f'] = rhs_imex_mesh |
42 | 45 | description['collocation_class'] = collclass.CollGaussLobatto |
43 | | - description['num_nodes'] = [2] |
| 46 | + description['num_nodes'] = [3] |
| 47 | + description['do_LU'] = False |
44 | 48 | description['sweeper_class'] = imex_1st_order |
45 | 49 | description['level_params'] = lparams |
46 | 50 |
|
|
62 | 66 |
|
63 | 67 | uex = P.u_exact(Tend) |
64 | 68 |
|
65 | | - fig = plt.figure(figsize=(8,8)) |
66 | | - plt.pcolor(pparams['lambda_s'].imag, pparams['lambda_f'].imag, np.absolute(uend.values).T,vmin=1,vmax=1.01) |
| 69 | + fig = plt.figure(figsize=(4,4)) |
| 70 | + #pcol = plt.pcolor(pparams['lambda_s'].imag, pparams['lambda_f'].imag, np.absolute(uend.values).T, vmin=0.99, vmax=1.01) |
| 71 | + pcol = plt.pcolor(pparams['lambda_s'].imag, pparams['lambda_f'].imag, np.absolute(uend.values).T, vmin=1.0, vmax=2.0) |
67 | 72 | # plt.pcolor(np.imag(uend.values)) |
68 | | - plt.colorbar() |
69 | | - plt.xlabel('$\Delta t \lambda_{slow}$', fontsize=18, labelpad=20) |
| 73 | + pcol.set_edgecolor('face') |
| 74 | + plt.plot([0, 4], [0, 4], color='w', linewidth=2.5) |
| 75 | + #plt.colorbar() |
| 76 | + plt.gca().set_xticks([0.0, 1.0, 2.0, 3.0]) |
| 77 | + plt.xlabel('$\Delta t \lambda_{slow}$', fontsize=18, labelpad=0.0) |
70 | 78 | plt.ylabel('$\Delta t \lambda_{fast}$', fontsize=18) |
71 | 79 |
|
72 | | - plt.show() |
73 | | - |
| 80 | + #plt.show() |
| 81 | + fig.savefig('sdc-fwsw-stability-K'+str(sparams['maxiter'])+'-M'+str(description['num_nodes'][0])+'.pdf', bbox_inches='tight') |
74 | 82 | print('error at time %s: %s' %(Tend,np.linalg.norm(uex.values-uend.values,np.inf)/np.linalg.norm(uex.values, |
75 | 83 | np.inf))) |
76 | 84 |
|
0 commit comments