Skip to content

Commit fd177a9

Browse files
author
Daniel Ruprecht
committed
fixed run.py to always use ncoarse=1 if an artifically constructed coarse propagator is used
1 parent 6ec9004 commit fd177a9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

example/run.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
# 0 = normal backward Euler method
5959
# 1 = artificially constructed method with phase error from backward Euler and exact amplification factor
6060
# 2 = artificially constructed method with exact phase and amplification factor from backward Euler
61-
artificial_coarse = 0
61+
artificial_coarse = 2
6262

6363
artificial_fine = 0
6464

@@ -110,14 +110,14 @@ def run_parareal(uhat, D, k):
110110
# stability matrix
111111
if not artificial_coarse == 0:
112112
stab_tailor = sp.csc_matrix(np.array([stab_tailor], dtype='complex'))
113-
para = parareal(tstart=0.0, tend=tmax, nslices=nproc, fine=intexact, coarse=stab_tailor, nsteps_fine=nfine, nsteps_coarse=ncoarse, tolerance=0.0, iter_max=k, u0 = sol)
113+
para = parareal(tstart=0.0, tend=tmax, nslices=nproc, fine=intexact, coarse=stab_tailor, nsteps_fine=nfine, nsteps_coarse=1, tolerance=0.0, iter_max=k, u0 = sol)
114114

115115
if artificial_fine==1:
116116
assert artificial_coarse==0, "Using artifical coarse and fine propagators together is not implemented and probably not working correctly"
117117
stab_fine = abs(stab_ex)*np.exp(1j*np.angle(stab_coarse[0,0]))
118118
stab_fine = sp.csc_matrix(np.array([stab_fine], dtype='complex'))
119119
# Must use nfine=1 in this case
120-
para = parareal(tstart=0.0, tend=tmax, nslices=nproc, fine=stab_fine, coarse=impeuler, nsteps_fine=nfine, nsteps_coarse=ncoarse, tolerance=0.0, iter_max=k, u0 = sol)
120+
para = parareal(tstart=0.0, tend=tmax, nslices=nproc, fine=stab_fine, coarse=impeuler, nsteps_fine=1, nsteps_coarse=ncoarse, tolerance=0.0, iter_max=k, u0 = sol)
121121

122122
para.run()
123123
temp = para.get_last_end_value()

0 commit comments

Comments
 (0)