Skip to content

Commit 7ff1610

Browse files
committed
TL: updated figures scripts
1 parent a3f55b8 commit 7ff1610

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

outputs/01_SISC/fig_comparison.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@
3030
nodesType='EQUID',
3131
qType='LOBATTO')]
3232

33-
algos = ['GaussSeidel', 'Jacobi', 'Parareal',
34-
'STMG', 'PFASST', 'ATMG', 'TFASST']
35-
labels = ['ABGS', 'ABJ', 'Parareal-1',
36-
'Parareal-2', 'PFASST', 'Parareal-3', 'TMG$_f$']
33+
algos = ['STMG', 'TFASST', 'Parareal', 'GaussSeidel', 'Jacobi',
34+
'ATMG', 'PFASST', ]
35+
labels = ['Parareal-1 (TMG)', 'TMG$_f$', 'Parareal-2', 'ABGS', 'ABJ',
36+
'Parareal-3 (TMG$_c$)', 'PFASST']
3737
symbols = ['p', 's', '>', 'o', '^', '+', '<']
3838

3939
iFig = 1

outputs/01_SISC/fig_parareal.py

+14
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,14 @@
3131
M=1, method=fineMethod, nodes=nodesType, qType=qType,
3232
nStepPerNode=10)
3333
s.setPhiDelta(deltaMethod, nStepPerNode=5)
34+
35+
t, uExact = s.getU('Exact', times=True)
36+
uDelta = s.getU('Delta')
3437
uFine = s.getU('Fine')
38+
errFine = np.max(np.abs(uExact-uFine))
39+
errCoarse = np.max(np.abs(uExact-uDelta))
40+
print(f'ErrFine : {errFine:1.2e}')
41+
print(f'ErrCoarse : {errCoarse:1.2e}')
3542

3643
algo = 'Parareal'
3744
# Initialization
@@ -61,7 +68,14 @@
6168
plt.ylim(1e-13, 10)
6269
if i == 2:
6370
plt.ylim(1e-2, 1e4)
71+
textArgs = dict(
72+
bbox=dict(boxstyle="round",
73+
ec=(0.5, 0.5, 0.5),
74+
fc=(0.8, 0.8, 0.8)))
75+
plt.text(0, 0.02, 'Max. abs. err. fine: $8.35e^{-4}$', **textArgs)
6476
if i == 3:
6577
plt.ylim(1e-13, 10)
78+
plt.hlines([errFine, errCoarse], 0, nIter,
79+
colors='gray', linestyles='--', linewidth=1.5)
6680
setFig('Iteration', 'Error vs. fine solution',
6781
fileName=f'fig_Parareal_{i}.pdf')

0 commit comments

Comments
 (0)