Skip to content

Commit 078a4a0

Browse files
committed
add logos to acknowledge funding
1 parent 3274833 commit 078a4a0

File tree

7 files changed

+50
-88
lines changed

7 files changed

+50
-88
lines changed

img/BMBF_gefoerdert_2017_en.jpg

55.9 KB
Loading

img/EuroHPC.jpg

37.4 KB
Loading

img/LogoTime-X.png

29.2 KB
Loading

scripts/pseudo-spectrum/figure_9_10.py renamed to scripts/pseudo-spectrum/figure_11-12.py

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -11,35 +11,29 @@
1111
import matplotlib.pyplot as plt
1212
from subprocess import call
1313
from pylab import rcParams
14+
from parameter import parameter
1415

1516
from pseudo_spectral_radius import pseudo_spectral_radius
1617

1718

18-
Tend = 1.0
19-
nslices = 10
20-
tol = 0.0
21-
maxiter = 9
22-
nfine = 10
23-
ncoarse = 10
19+
par = parameter(dedalus = True)
20+
Tend, nslices, maxiter, nfine, ncoarse, tol, epsilon, ndof_f = par.getpar()
2421

25-
ndof_f = 32
2622
# for 24 DoF, Parareal diverges, for 30 DoF, you get convergence. Of course, speedup would be impossible here.
2723
try:
28-
figure = int(sys.argv[1]) # 9 generates figure_9, 10 generates figure_10
24+
figure = int(sys.argv[1])
2925
except:
30-
print("No or wrong command line argument provided, creating figure 9. Use 9 or 10 as command line argument.")
31-
figure = 9
26+
print("No or wrong command line argument provided, creating figure 11. Use 11 or 12 as command line argument.")
27+
figure = 11
3228

33-
if figure==9:
29+
if figure==11:
3430
ndof_c = 24
35-
filename = 'figure_9.pdf'
36-
elif figure==10:
31+
filename = 'figure_11.pdf'
32+
elif figure==12:
3733
ndof_c = 30
38-
filename = 'figure_10.pdf'
34+
filename = 'figure_12.pdf'
3935
else:
40-
sys.exit("Figure needs to be 9 or 10")
41-
42-
epsilon = 0.1
36+
sys.exit("Figure needs to be 11 or 12")
4337

4438
u0fine = solution_dedalus(np.zeros(ndof_f), ndof_f)
4539
u0coarse = solution_dedalus(np.zeros(ndof_c), ndof_c)

scripts/pseudo-spectrum/figure_1_2.py renamed to scripts/pseudo-spectrum/figure_13-14.py

Lines changed: 13 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,16 @@
1313
from solution_linear import solution_linear
1414
from get_matrix import get_upwind, get_centered
1515
from pseudo_spectral_radius import pseudo_spectral_radius
16+
from parameter import parameter
1617

1718
from pylab import rcParams
1819
import matplotlib.pyplot as plt
1920
from subprocess import call
2021

21-
Tend = 1.0
22-
nslices = 10
23-
tol = 0.0
24-
maxiter = 9
25-
nfine = 10
26-
ncoarse = 1
27-
28-
ndof_f = 32
22+
par = parameter(dedalus = False)
23+
Tend, nslices, maxiter, nfine, ncoarse, tol, epsilon, ndof_f = par.getpar()
2924
ndof_c = 24
3025

31-
epsilon = 0.1
32-
3326
xaxis_f = np.linspace(0.0, 2.0, ndof_f+1)[0:ndof_f]
3427
dx_f = xaxis_f[1] - xaxis_f[0]
3528

@@ -41,19 +34,19 @@
4134
try:
4235
figure = int(sys.argv[1]) # 1 generates figure_1, 2 generates figure_2
4336
except:
44-
print("No or wrong command line argument provided, creating figure 1. Use 1 or 2 as command line argument.")
45-
figure = 1
37+
print("No or wrong command line argument provided, creating figure 13. Use 13 or 14 as command line argument.")
38+
figure = 13
4639

47-
if figure==1:
40+
if figure==13:
4841
A_f = get_upwind(ndof_f, dx_f)
4942
A_c = get_upwind(ndof_c, dx_c)
50-
51-
elif figure==2:
43+
filename = 'figure_13.pdf'
44+
elif figure==14:
5245
A_f = get_centered(ndof_f, dx_f)
5346
A_c = get_centered(ndof_c, dx_c)
54-
47+
filename = 'figure_14.pdf'
5548
else:
56-
sys.exit("Figure should be set to 1 or 2")
49+
sys.exit("Figure should be set to 13 or 14")
5750

5851
D = A_f*A_f.H - A_f.H*A_f
5952
print("Normality number of the system matrix (this should be zero): %5.3f" % np.linalg.norm(D.todense()))
@@ -65,7 +58,7 @@
6558

6659
u0coarse = solution_linear(np.zeros(ndof_c), A_c)
6760

68-
if figure==1:
61+
if figure==13:
6962
para = parareal(0.0, Tend, nslices, impeuler, impeuler, nfine, ncoarse, tol, maxiter, u0fine, u0coarse)
7063
else:
7164
para = parareal(0.0, Tend, nslices, trapezoidal, trapezoidal, nfine, ncoarse, tol, maxiter, u0fine, u0coarse)
@@ -99,8 +92,8 @@
9992
ms = 4
10093
fig = plt.figure(1)
10194
plt.semilogy(range(1,maxiter+1), defect_l2[0,:], 'bo-', markersize=ms, label=r'$|| e^k ||$')
102-
plt.semilogy(range(1,5), [E_norm**(val-1)*1.1*defect_l2[0,0] for val in range(1,5)], 'b--', label=r'$|| E ||_2^k$')
103-
plt.semilogy(range(1,5), [psr**(val-1)*1.1*defect_l2[0,0] for val in range(1,5)], 'r-.', label=r'$\sigma_{\epsilon}(E)^k$')
95+
plt.semilogy(range(1,5), [E_norm**(val-1)*2.0*defect_l2[0,0] for val in range(1,5)], 'b-.', label=r'$|| E ||_2^k$', linewidth=2)
96+
plt.semilogy(range(1,5), [psr**(val-1)*2.0*defect_l2[0,0] for val in range(1,5)], 'r--', label=r'$\sigma_{\epsilon}(E)^k$', linewidth=2)
10497
plt.legend(loc='upper right', fontsize=fs, prop={'size':fs-2}, handlelength=3)
10598
plt.xlim([1, maxiter+1])
10699
plt.ylim([1e-5, 1e3])
@@ -110,12 +103,6 @@
110103
#plt.ylim([1e-15, 1e1])
111104
plt.xlim([1, maxiter+1])
112105
plt.xticks(range(2,maxiter,2))
113-
if figure==1:
114-
filename = 'figure_1.pdf'
115-
elif figure==2:
116-
filename = 'figure_2.pdf'
117-
else:
118-
quit()
119106
plt.gcf().savefig(filename, bbox_inches='tight')
120107
call(["pdfcrop", filename, filename])
121108
plt.show()

scripts/pseudo-spectrum/figure_3_4.py renamed to scripts/pseudo-spectrum/figure_15-16.py

Lines changed: 13 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -11,36 +11,33 @@
1111
from solution_dedalus import solution_dedalus
1212

1313
from pseudo_spectral_radius import pseudo_spectral_radius
14+
from parameter import parameter
1415

1516
from pylab import rcParams
1617
import matplotlib.pyplot as plt
1718
from subprocess import call
1819

19-
Tend = 1.0
20-
nslices = 10
21-
tol = 0.0
22-
maxiter = 9
23-
nfine = 10
20+
par = parameter(dedalus = True)
21+
Tend, nslices, maxiter, nfine, ncoarse, tol, epsilon, ndof_f = par.getpar()
2422
ncoarse = 10
2523

26-
ndof_f = 32
2724

2825
# for 24 DoF, Parareal diverges, for 30 DoF, you get convergence. Of course, speedup would be impossible here.
2926
try:
3027
figure = int(sys.argv[1]) # 3 generates figure_3, 4 generates figure_4
3128
except:
32-
print("No or wrong command line argument provided, creating figure 3. Use 3 or 4 as command line argument.")
33-
figure = 3
29+
print("No or wrong command line argument provided, creating figure 15. Use 15 or 16 as command line argument.")
30+
figure = 15
3431

35-
if figure==3:
32+
if figure==15:
3633
ndof_c = 24
37-
elif figure==4:
34+
filename = 'figure_15.pdf'
35+
elif figure==16:
3836
ndof_c = 30
37+
filename = 'figure_16.pdf'
3938
else:
40-
sys.exit("Set figure to 1 or 2")
39+
sys.exit("Set figure to 15 or 16")
4140

42-
epsilon = 0.1
43-
4441
u0fine = solution_dedalus(np.zeros(ndof_f), ndof_f)
4542
u0coarse = solution_dedalus(np.zeros(ndof_c), ndof_c)
4643
para = parareal(0.0, Tend, nslices, integrator_dedalus, integrator_dedalus, nfine, ncoarse, tol, maxiter, u0fine, u0coarse)
@@ -79,9 +76,9 @@
7976
ms = 4
8077
fig = plt.figure(1)
8178
plt.semilogy(range(1,maxiter+1), defect_l2[0,:], 'bo-', markersize=ms, label=r'$|| e^k ||$')
82-
plt.semilogy(range(1,5), [E_norm**(val-1)*1.1*defect_l2[0,0] for val in range(1,5)], 'b--', label=r'$|| E ||_2^k$')
83-
plt.semilogy(range(1,5), [psr**(val-1)*1.1*defect_l2[0,0] for val in range(1,5)], 'r-.', label=r'$\sigma_{\epsilon}(E)^k$')
84-
if figure==3:
79+
plt.semilogy(range(1,5), [E_norm**(val-1)*2.0*defect_l2[0,0] for val in range(1,5)], 'b-.', label=r'$|| E ||_2^k$', linewidth=2)
80+
plt.semilogy(range(1,5), [psr**(val-1)*2.0*defect_l2[0,0] for val in range(1,5)], 'r--', label=r'$\sigma_{\epsilon}(E)^k$', linewidth=2)
81+
if figure==15:
8582
plt.legend(loc='lower right', fontsize=fs, prop={'size':fs-2}, handlelength=3)
8683
else:
8784
plt.legend(loc='upper right', fontsize=fs, prop={'size':fs-2}, handlelength=3)
@@ -94,12 +91,6 @@
9491
#plt.ylim([1e-15, 1e1])
9592
plt.xlim([1, maxiter+1])
9693
plt.xticks(range(2,maxiter,2))
97-
if figure==3:
98-
filename = 'figure_3.pdf'
99-
elif figure==4:
100-
filename = 'figure_4.pdf'
101-
else:
102-
quit()
10394
plt.gcf().savefig(filename, bbox_inches='tight')
10495
call(["pdfcrop", filename, filename])
10596
plt.show()

scripts/pseudo-spectrum/figure_7_8.py renamed to scripts/pseudo-spectrum/figure_9-10.py

Lines changed: 13 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import scipy.sparse as sparse
1313
from scipy.linalg import svdvals
1414
import math
15+
from parameter import parameter
1516

1617
import matplotlib.pyplot as plt
1718
from subprocess import call
@@ -20,14 +21,9 @@
2021
from pseudo_spectral_radius import pseudo_spectral_radius
2122

2223

23-
Tend = 1.0
24-
nslices = 10
25-
tol = 0.0
26-
maxiter = 9
27-
nfine = 10
28-
ncoarse = 1
24+
par = parameter(dedalus = False)
25+
Tend, nslices, maxiter, nfine, ncoarse, tol, epsilon, ndof_f = par.getpar()
2926

30-
ndof_f = 32
3127
ndof_c = 24
3228

3329
epsilon = 0.1
@@ -43,28 +39,28 @@
4339
try:
4440
figure = int(sys.argv[1]) # 7 generates figure_7, 8 generates figure_8
4541
except:
46-
print("No or wrong command line argument provided, creating figure 7. Use 7 or 8 as command line argument.")
47-
figure = 7
42+
print("No or wrong command line argument provided, creating figure 9. Use 9 or 10 as command line argument.")
43+
figure = 9
4844

49-
if figure==7:
45+
if figure==9:
5046
A_f = get_upwind(ndof_f, dx_f)
5147
A_c = get_upwind(ndof_c, dx_c)
52-
53-
elif figure==8:
48+
filename = 'figure_9.pdf'
49+
elif figure==10:
5450
A_f = get_centered(ndof_f, dx_f)
5551
A_c = get_centered(ndof_c, dx_c)
56-
52+
filename = 'figure_10.pdf'
5753
else:
58-
quit()
54+
sys.exit("Wrong value for figure")
5955

6056
D = A_f*A_f.H - A_f.H*A_f
6157
print("Normality number of the system matrix (this should be zero): %5.3f" % np.linalg.norm(D.todense()))
6258
u0fine = solution_linear(np.zeros(ndof_f), A_f)
6359
u0coarse = solution_linear(np.zeros(ndof_c), A_c)
6460

65-
if figure==7:
61+
if figure==9:
6662
para = parareal(0.0, Tend, nslices, impeuler, impeuler, nfine, ncoarse, tol, maxiter, u0fine, u0coarse)
67-
elif figure==8:
63+
elif figure==10:
6864
para = parareal(0.0, Tend, nslices, trapezoidal, trapezoidal, nfine, ncoarse, tol, maxiter, u0fine, u0coarse)
6965
Pmat, Bmat = para.get_parareal_matrix()
7066

@@ -91,7 +87,7 @@
9187
sigmin[j,i] = np.min(sv)
9288
circs[j,i] = np.sqrt(lambda_real[i]**2 + lambda_imag[j]**2)
9389
if np.min(sv) > abs(z):
94-
print("You were wrong!!!")
90+
print("This should not happen")
9591
print("sv-min: %5.3e" % np.min(sv))
9692
print("abs(z): %5.3e" % abs(z))
9793

@@ -106,12 +102,6 @@
106102
plt.ylabel(r'Imaginary part', fontsize=fs)
107103
plt.title(r'$1/|| (z - E)^{-1} \||_2$')
108104
ax.plot(0.0, 0.0, 'k+', markersize=fs)
109-
if figure==7:
110-
filename = 'figure_7.pdf'
111-
elif figure==8:
112-
filename = 'figure_8.pdf'
113-
else:
114-
quit()
115105
plt.gcf().savefig(filename, bbox_inches='tight')
116106
call(["pdfcrop", filename, filename])
117107
plt.show()

0 commit comments

Comments
 (0)