|
131 | 131 | print ('Maximum pressure in RK-IMEX: %5.3e' % np.linalg.norm(pnew_imex, np.inf)) |
132 | 132 |
|
133 | 133 | #plt.plot(P.mesh, pnew_tp, '-', color='c', label='Trapezoidal') |
134 | | - if np.linalg.norm(pnew_imex, np.inf)<=2: |
135 | | - plt.plot(P.mesh, pnew_imex, '-', color='c', label='IMEX('+str(rkimex.order)+')') |
136 | | - plt.plot(P.mesh, uend.values[1,:], '--', color='b', label='SDC('+str(sparams['maxiter'])+')') |
137 | 134 | if dirk.order==2: |
138 | | - plt.plot(P.mesh, pnew_bdf, '-', color='r', label='BDF-2') |
139 | | - plt.plot(P.mesh, pnew_dirk, color='g', label='DIRK('+str(dirk.order)+')') |
| 135 | + plt.plot(P.mesh, pnew_bdf, 'd-', color='c', label='BDF-2',markevery=(50,75)) |
| 136 | + p_slow = np.exp(-np.square( np.mod( P.mesh-pparams['cadv']*Tend, 1.0 ) -x_0 )/(sigma_0*sigma_0)) |
| 137 | + plt.plot(P.mesh, p_slow, '--', color='k', markersize=fs-2, label='Slow mode', dashes=(10,2)) |
| 138 | + if np.linalg.norm(pnew_imex, np.inf)<=2: |
| 139 | + plt.plot(P.mesh, pnew_imex, '+-', color='r', label='IMEX('+str(rkimex.order)+')',markevery=(1,75),mew=1.0) |
| 140 | + plt.plot(P.mesh, uend.values[1,:], 'o-', color='b', label='SDC('+str(sparams['maxiter'])+')',markevery=(25,75)) |
| 141 | + plt.plot(P.mesh, pnew_dirk, '-', color='g', label='DIRK('+str(dirk.order)+')') |
140 | 142 | #plt.plot(P.mesh, uex.values[1,:], '+', color='r', label='p (exact)') |
141 | 143 | #plt.plot(P.mesh, uend.values[1,:], '-', color='b', linewidth=2.0, label='p (SDC)') |
142 | 144 |
|
143 | | - p_slow = np.exp(-np.square( np.mod( P.mesh-pparams['cadv']*Tend, 1.0 ) -x_0 )/(sigma_0*sigma_0)) |
144 | | - plt.plot(P.mesh, p_slow, '+', color='k', markersize=fs-2, label='Slow mode', markevery=10) |
145 | 145 | plt.xlabel('x', fontsize=fs, labelpad=0) |
146 | 146 | plt.ylabel('Pressure', fontsize=fs, labelpad=0) |
147 | 147 | fig.gca().set_xlim([0, 1.0]) |
148 | 148 | fig.gca().set_ylim([-0.5, 1.1]) |
149 | 149 | fig.gca().tick_params(axis='both', labelsize=fs) |
150 | | - plt.legend(loc='upper left', fontsize=fs, prop={'size':fs}) |
| 150 | + plt.legend(loc='upper left', fontsize=fs, prop={'size':fs}, handlelength=3) |
151 | 151 | fig.gca().grid() |
152 | 152 | #plt.show() |
153 | 153 | filename = 'sdc-fwsw-multiscale-K'+str(sparams['maxiter'])+'-M'+str(description['num_nodes'])+'.pdf' |
|
0 commit comments