|
15 | 15 | list = [ ('PFASST_BOUSSINESQ_stats_hf_SPREAD_P16.npz','SPREAD','1-sided','red','s'), |
16 | 16 | ('PFASST_BOUSSINESQ_stats_hf_INTERP_P16.npz','INTERP','2-sided','orange','o'), |
17 | 17 | ('PFASST_BOUSSINESQ_stats_hf_SPREAD_PREDICT_P16.npz','SPREAD_PREDICT','1-sided+corr','blue','^'), |
18 | | - ('PFASST_BOUSSINESQ_stats_hf_INTERP_PREDICT_P16.npz','INTERP_PREDICT','2-sided+corr','green','d') ] |
| 18 | + ('PFASST_BOUSSINESQ_stats_hf_INTERP_PREDICT_P16.npz','INTERP_PREDICT','2-sided+corr','green','d'), |
| 19 | + ('PFASST_BOUSSINESQ_stats_hf_NOFAULT_P16.npz','NOFAULT','no fault','black','v')] |
19 | 20 |
|
20 | 21 | nprocs = 16 |
21 | 22 |
|
|
31 | 32 | # maxiter = 14 |
32 | 33 | nsteps = 0 |
33 | 34 | maxiter = 0 |
| 35 | + vmax = -99 |
| 36 | + vmin = -8 |
34 | 37 | for file,strategy,label,color,marker in list: |
35 | 38 |
|
36 | 39 | data = np.load(file) |
37 | 40 |
|
38 | 41 | iter_count = data['iter_count'][minstep:maxstep] |
39 | 42 | residual = data['residual'][:,minstep:maxstep] |
40 | 43 |
|
41 | | - residual = np.where(residual > 0, np.log10(residual), -99) |
42 | | - vmin = -9 |
43 | | - vmax = int(np.amax(residual)) |
| 44 | + residual[residual <= 0] = 1E-99 |
| 45 | + residual = np.log10(residual) |
| 46 | + vmax = max(vmax,int(np.amax(residual))) |
44 | 47 |
|
45 | 48 | maxiter = max(maxiter,int(max(iter_count))) |
46 | 49 | nsteps = max(nsteps,len(iter_count)) |
47 | 50 |
|
| 51 | + print(vmin,vmax) |
48 | 52 | data = np.load(ref) |
49 | 53 | ref_iter_count = data['iter_count'][nprocs-1::nprocs] |
50 | 54 |
|
|
90 | 94 | residual = data['residual'][:,minstep:maxstep] |
91 | 95 | stats = data['hard_stats'] |
92 | 96 |
|
93 | | - residual = np.where(residual > 0, np.log10(residual), -99) |
| 97 | + residual[residual <= 0] = 1E-99 |
| 98 | + residual = np.log10(residual) |
94 | 99 |
|
95 | 100 | rcParams['figure.figsize'] = 6.0, 2.5 |
96 | 101 | fig, ax = plt.subplots() |
|
99 | 104 | pcol = plt.pcolor(residual,cmap=cmap,vmin=vmin,vmax=vmax) |
100 | 105 | pcol.set_edgecolor('face') |
101 | 106 |
|
102 | | - for item in stats: |
103 | | - if item[0] in range(minstep,maxstep): |
104 | | - plt.text(item[0]+0.5-(maxstep-nsteps),item[1]-1+0.5,'x',horizontalalignment='center',verticalalignment='center') |
| 107 | + if not file is ref: |
| 108 | + for item in stats: |
| 109 | + if item[0] in range(minstep,maxstep): |
| 110 | + plt.text(item[0]+0.5-(maxstep-nsteps),item[1]-1+0.5,'x',horizontalalignment='center',verticalalignment='center') |
105 | 111 |
|
106 | 112 | plt.axis([0,nsteps,0,maxiter]) |
107 | 113 |
|
108 | | - ticks = np.arange(vmin,vmax+1,2) |
| 114 | + ticks = np.arange(vmin,vmax+1) |
109 | 115 | tickpos = np.linspace(ticks[0]+0.5, ticks[-1]-0.5, len(ticks)) |
110 | 116 | cax = plt.colorbar(pcol, ticks=tickpos, pad=0.02) |
111 | 117 | cax.set_ticklabels(ticks) |
|
0 commit comments