Skip to content

Commit 9cddb17

Browse files
committed
Added smaller values of alpha to the tests
1 parent 8254c83 commit 9cddb17

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

pySDC/tests/test_controllers/test_controller_ParaDiag_nonMPI.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ def get_composite_collocation_problem(L, M, N, alpha=0, dt=1e-1, problem='Dahlqu
105105
@pytest.mark.parametrize('L', [1, 4])
106106
@pytest.mark.parametrize('M', [2, 3])
107107
@pytest.mark.parametrize('N', [2])
108-
@pytest.mark.parametrize('alpha', [1e-4, 1e-2])
108+
@pytest.mark.parametrize('alpha', [1e-8, 1e-4, 1e-2])
109109
@pytest.mark.parametrize('problem', ['Dahlquist', 'Dahlquist_IMEX', 'vdp'])
110110
def test_ParaDiag_convergence(L, M, N, alpha, problem):
111111
from pySDC.helpers.stats_helper import get_sorted
@@ -129,8 +129,8 @@ def test_ParaDiag_convergence(L, M, N, alpha, problem):
129129
@pytest.mark.base
130130
@pytest.mark.parametrize('L', [1, 4])
131131
@pytest.mark.parametrize('M', [2, 3])
132-
@pytest.mark.parametrize('N', [64])
133-
@pytest.mark.parametrize('alpha', [1e-4, 1e-2])
132+
@pytest.mark.parametrize('N', [32])
133+
@pytest.mark.parametrize('alpha', [1e-8, 1e-4, 1e-2])
134134
def test_IMEX_ParaDiag_convergence(L, M, N, alpha):
135135
from pySDC.helpers.stats_helper import get_sorted
136136

@@ -185,14 +185,14 @@ def test_ParaDiag_vs_PFASST(L, M, N, problem):
185185
@pytest.mark.parametrize('L', [4])
186186
@pytest.mark.parametrize('M', [2, 3])
187187
@pytest.mark.parametrize('N', [1])
188-
@pytest.mark.parametrize('alpha', [1e-4, 1e-2])
188+
@pytest.mark.parametrize('alpha', [1e-6, 1e-4])
189189
def test_ParaDiag_order(L, M, N, alpha):
190190
import numpy as np
191191
from pySDC.helpers.stats_helper import get_sorted
192192

193193
errors = []
194194
if M == 3:
195-
dts = [0.8 * 2 ** (-x) for x in range(7, 9)]
195+
dts = [2 ** (-x) for x in range(9, 11)]
196196
elif M == 2:
197197
dts = [2 ** (-x) for x in range(5, 9)]
198198
else:
@@ -217,18 +217,18 @@ def test_ParaDiag_order(L, M, N, alpha):
217217
errors = np.array(errors)
218218
dts = np.array(dts)
219219
order = np.log(abs(errors[1:] - errors[:-1])) / np.log(abs(dts[1:] - dts[:-1]))
220-
num_order = np.mean(order)
220+
num_order = np.median(order)
221221

222222
assert (
223223
expected_order + 1 > num_order > expected_order
224-
), f'Got unexpected numerical order {num_order} instead of {expected_order} in ParaDiag'
224+
), f'Got unexpected numerical order {num_order:2f} instead of {expected_order} in ParaDiag {order} {errors}'
225225

226226

227227
@pytest.mark.base
228228
@pytest.mark.parametrize('L', [4, 12])
229-
@pytest.mark.parametrize('M', [2, 3])
229+
@pytest.mark.parametrize('M', [3, 4])
230230
@pytest.mark.parametrize('N', [1])
231-
@pytest.mark.parametrize('alpha', [1e-4, 1e-2])
231+
@pytest.mark.parametrize('alpha', [1e-6, 1e-4, 1e-2])
232232
def test_ParaDiag_convergence_rate(L, M, N, alpha):
233233
r"""
234234
Test that the error in ParaDiag contracts as fast as expected.
@@ -258,7 +258,7 @@ def test_ParaDiag_convergence_rate(L, M, N, alpha):
258258

259259
assert (
260260
convergence_rate < convergence_bound
261-
), f'Convergence rate {convergence_rate} exceeds upper bound of {convergence_bound}!'
261+
), f'Convergence rate {convergence_rate:.2e} exceeds upper bound of {convergence_bound:.2e}!'
262262

263263

264264
if __name__ == '__main__':

0 commit comments

Comments
 (0)