Skip to content

Commit 437b2c4

Browse files
committed
minor fixes for GS plots
1 parent 0c9d221 commit 437b2c4

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

examples/fault_tolerance/postproc_grayscott.py

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
ref = 'PFASST_GRAYSCOTT_stats_hf_SPREAD_P32.npz'
2020

2121
# list files, strategy names, colors, markers
22-
# list = [('PFASST_GRAYSCOTT_stats_hf_INTERP_PREDICT_P32.npz','2-sided+corr','green','o')]
22+
# list = [('PFASST_GRAYSCOTT_stats_hf_NOFAULT_P32.npz','NOFAULT','no fault','green','o')]
2323
list = [ ('PFASST_GRAYSCOTT_stats_hf_SPREAD_P32.npz','SPREAD','1-sided','red','s'),
2424
('PFASST_GRAYSCOTT_stats_hf_INTERP_P32.npz','INTERP','2-sided','orange','o'),
2525
('PFASST_GRAYSCOTT_stats_hf_SPREAD_PREDICT_P32.npz','SPREAD_PREDICT','1-sided+corr','blue','^'),
@@ -35,19 +35,17 @@
3535
# minstep = 0
3636
# maxstep = 640
3737

38-
# find boundaries
38+
# find/define boundaries
3939
nsteps = 0
40-
maxiter = 0
40+
maxiter = 14
41+
vmin = -9
42+
vmax = -1
43+
4144
for file,strategy,label,color,marker in list:
4245

4346
data = np.load(file)
4447

4548
iter_count = data['iter_count'][minstep:maxstep]
46-
residual = data['residual'][:,minstep:maxstep]
47-
48-
residual = np.where(residual > 0, np.log10(residual), -99)
49-
vmin = -9
50-
vmax = int(np.amax(residual))
5149

5250
maxiter = max(maxiter,int(max(iter_count)))
5351
nsteps = max(nsteps,len(iter_count))
@@ -96,13 +94,16 @@
9694
# generate heatmaps steps vs. iterations with xxx for the faults
9795
for file,strategy,label,color,marker in list:
9896

97+
residual = np.zeros((maxiter,nsteps))
98+
residual[:] = -99
99+
99100
data = np.load(file)
100101

101102
iter_count = data['iter_count'][minstep:maxstep]
102-
residual = data['residual'][:,minstep:maxstep]
103+
input = data['residual'][:,minstep:maxstep]
103104
stats = data['hard_stats']
104105

105-
residual = np.where(residual > 0, np.log10(residual), -99)
106+
residual[0:len(input[:,0]),0:len(input[0,:])] = np.where(input > 0, np.log10(input), -99)
106107

107108
fig, ax = plt.subplots(figsize=(20,7))
108109

0 commit comments

Comments
 (0)