From 1936414e931a565b6a8fad1dd0dedcad94afe625 Mon Sep 17 00:00:00 2001 From: Thomas Baumann <39156931+brownbaerchen@users.noreply.github.com> Date: Thu, 7 Nov 2024 07:27:35 +0100 Subject: [PATCH] Added ARK3 method (#500) --- .../sweeper_classes/Runge_Kutta.py | 18 ++++++++++++++++++ .../test_sweepers/test_Runge_Kutta_sweeper.py | 2 ++ 2 files changed, 20 insertions(+) diff --git a/pySDC/implementations/sweeper_classes/Runge_Kutta.py b/pySDC/implementations/sweeper_classes/Runge_Kutta.py index 5fb8dd706..f6db08086 100644 --- a/pySDC/implementations/sweeper_classes/Runge_Kutta.py +++ b/pySDC/implementations/sweeper_classes/Runge_Kutta.py @@ -761,8 +761,26 @@ def get_update_order(cls): class ARK2(RungeKuttaIMEX): + """ + Second order two stage singly diagonally implicit globally stiffly accurate IMEX RK method with explicit first stage. + Can be used to integrate simple DAEs because explicit and implicit part are both stiffly accurate. + """ + generator_IMP = RK_SCHEMES["ARK222EDIRK"]() generator_EXP = RK_SCHEMES["ARK222ERK"]() nodes, weights, matrix = generator_IMP.genCoeffs() _, weights_explicit, matrix_explicit = generator_EXP.genCoeffs() + + +class ARK3(RungeKuttaIMEX): + """ + Third order four stage singly diagonally implicit globally stiffly accurate IMEX RK method with explicit first stage. + Can be used to integrate simple DAEs because explicit and implicit part are both stiffly accurate. + """ + + generator_IMP = RK_SCHEMES["ARK443ESDIRK"]() + generator_EXP = RK_SCHEMES["ARK443ERK"]() + + nodes, weights, matrix = generator_IMP.genCoeffs() + _, weights_explicit, matrix_explicit = generator_EXP.genCoeffs() diff --git a/pySDC/tests/test_sweepers/test_Runge_Kutta_sweeper.py b/pySDC/tests/test_sweepers/test_Runge_Kutta_sweeper.py index 7164043dc..eee15b791 100644 --- a/pySDC/tests/test_sweepers/test_Runge_Kutta_sweeper.py +++ b/pySDC/tests/test_sweepers/test_Runge_Kutta_sweeper.py @@ -27,6 +27,7 @@ 'IMEXEuler', 'ARK32', 'ARK2', + 'ARK3', ] @@ -168,6 +169,7 @@ def test_order(sweeper_name, useGPU=False): 'ARK548L2SA': 6, 'IMEXEuler': 2, 'ARK2': 3, + 'ARK3': 4, 'ARK32': 4, 'ARK324L2SAERK': 4, 'ARK324L2SAESDIRK': 4,