Skip to content

Commit 1f6470c

Browse files
committed
Better tests of asympconf_Linf
1 parent 1030f7e commit 1f6470c

File tree

2 files changed

+19
-5
lines changed

2 files changed

+19
-5
lines changed

pySDC/projects/AsympConv/PFASST_conv_Linf.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,13 @@ def main():
3030
plot_results()
3131

3232

33-
def run_diffusion(QI):
33+
def run_diffusion(QI, max_proc_exp=13):
3434
"""
3535
A simple test program to test PFASST convergence for the heat equation with random initial data
3636
3737
Args:
3838
QI: preconditioner
39+
max_proc_exp: max number of processors will be 2^max_proc_exp
3940
"""
4041

4142
# initialize level parameters
@@ -53,7 +54,7 @@ def run_diffusion(QI):
5354
# initialize problem parameters
5455
problem_params = dict()
5556
problem_params['nu'] = 0.1 # diffusion coefficient
56-
problem_params['freq'] = -1 # frequency for the test value
57+
problem_params['freq'] = 2 # frequency for the test value
5758
problem_params['nvars'] = [127, 63] # number of degrees of freedom for each level
5859
problem_params['bc'] = 'dirichlet-zero' # boundary conditions
5960

@@ -93,7 +94,7 @@ def run_diffusion(QI):
9394
writer.writerow(('num_proc', 'niter'))
9495
file.close()
9596

96-
for i in range(0, 13):
97+
for i in range(0, max_proc_exp):
9798

9899
num_proc = 2**i
99100
level_params['dt'] = (Tend - t0) / num_proc
@@ -131,12 +132,13 @@ def run_diffusion(QI):
131132
assert os.path.isfile(fname), 'ERROR: pickle did not create file'
132133

133134

134-
def run_advection(QI):
135+
def run_advection(QI, max_proc_exp=7):
135136
"""
136137
A simple test program to test PFASST convergence for the periodic advection equation
137138
138139
Args:
139140
QI: preconditioner
141+
max_proc_exp: max number of processors will be 2^max_proc_exp
140142
"""
141143

142144
# initialize level parameters
@@ -196,7 +198,7 @@ def run_advection(QI):
196198
writer.writerow(('num_proc', 'niter'))
197199
file.close()
198200

199-
for i in range(0, 7):
201+
for i in range(0, max_proc_exp):
200202

201203
num_proc = 2**i
202204
level_params['dt'] = (Tend - t0) / num_proc

pySDC/tests/test_projects/test_asympconv/test_PFASST.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,18 @@ def test_main():
77

88
main()
99

10+
@pytest.mark.base
11+
def test_Linf():
12+
from pySDC.projects.AsympConv.PFASST_conv_Linf import run_advection, run_diffusion
13+
14+
QI = 'LU'
15+
run_diffusion(QI=QI, max_proc_exp=4)
16+
run_advection(QI=QI, max_proc_exp=4)
17+
18+
QI = 'LU2'
19+
run_diffusion(QI=QI, max_proc_exp=4)
20+
run_advection(QI=QI, max_proc_exp=4)
21+
1022

1123
@pytest.mark.base
1224
def test_plot_results():

0 commit comments

Comments
 (0)