|
9 | 9 | CrankNicholson, |
10 | 10 | Cash_Karp, |
11 | 11 | Heun_Euler, |
| 12 | + DIRK34, |
12 | 13 | ) |
13 | 14 | from pySDC.implementations.convergence_controller_classes.adaptivity import AdaptivityRK |
14 | 15 | from pySDC.implementations.convergence_controller_classes.estimate_embedded_error import EstimateEmbeddedErrorNonMPI |
@@ -131,7 +132,7 @@ def plot_stability_single(sweeper, ax=None, description=None, implicit=True, re= |
131 | 132 | ) |
132 | 133 |
|
133 | 134 | # check if we think the method should be A-stable |
134 | | - Astable_methods = [RK1, CrankNicholson, MidpointMethod] # only the implicit versions are A-stable |
| 135 | + Astable_methods = [RK1, CrankNicholson, MidpointMethod, DIRK34] # only the implicit versions are A-stable |
135 | 136 | assert ( |
136 | 137 | implicit and sweeper in Astable_methods |
137 | 138 | ) == Astable, f"Unexpected region of stability for {sweeper.__name__} sweeper!" |
@@ -162,6 +163,8 @@ def test_all_stability(): |
162 | 163 | plot_stability_single(sweepers[j][i], implicit=impl[j], ax=axs[j], re=re, im=im, crosshair=crosshair[i]) |
163 | 164 | axs[j].set_title(titles[j]) |
164 | 165 |
|
| 166 | + plot_stability_single(DIRK34, re=re, im=im) |
| 167 | + |
165 | 168 | fig.tight_layout() |
166 | 169 |
|
167 | 170 |
|
@@ -216,7 +219,7 @@ def test_advection(): |
216 | 219 |
|
217 | 220 |
|
218 | 221 | @pytest.mark.base |
219 | | -@pytest.mark.parametrize("sweeper", [Cash_Karp, Heun_Euler]) |
| 222 | +@pytest.mark.parametrize("sweeper", [Cash_Karp, Heun_Euler, DIRK34]) |
220 | 223 | def test_embedded_estimate_order(sweeper): |
221 | 224 | """ |
222 | 225 | Test the order of embedded Runge-Kutta schemes. They are not run with adaptivity here, |
@@ -244,12 +247,18 @@ def test_embedded_estimate_order(sweeper): |
244 | 247 |
|
245 | 248 | custom_controller_params = {'logger_level': 40} |
246 | 249 |
|
| 250 | + expected_order = { |
| 251 | + Cash_Karp: [5], |
| 252 | + Heun_Euler: [2], |
| 253 | + DIRK34: [4], |
| 254 | + } |
| 255 | + |
247 | 256 | Tend = 7e-2 |
248 | 257 | dt_list = Tend * 2.0 ** (-np.arange(8)) |
249 | 258 | prob = run_vdp |
250 | 259 | plot_all_errors( |
251 | 260 | ax, |
252 | | - [5] if sweeper == Cash_Karp else [2], |
| 261 | + expected_order.get(sweeper, None), |
253 | 262 | True, |
254 | 263 | Tend_fixed=Tend, |
255 | 264 | custom_description=description, |
|
0 commit comments