From 6bef107cd322f7a31b50770219327de4345d93bc Mon Sep 17 00:00:00 2001 From: Daniel Doehring Date: Sat, 16 Dec 2023 15:06:09 +0100 Subject: [PATCH] Add get_proposed_dt to custom integrators (#1776) --- src/time_integration/methods_2N.jl | 5 +++++ src/time_integration/methods_3Sstar.jl | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/src/time_integration/methods_2N.jl b/src/time_integration/methods_2N.jl index d2f22679c4f..f3b09b01e97 100644 --- a/src/time_integration/methods_2N.jl +++ b/src/time_integration/methods_2N.jl @@ -204,6 +204,11 @@ function set_proposed_dt!(integrator::SimpleIntegrator2N, dt) integrator.dt = dt end +# Required e.g. for `glm_speed_callback` +function get_proposed_dt(integrator::SimpleIntegrator2N) + return integrator.dt +end + # stop the time integration function terminate!(integrator::SimpleIntegrator2N) integrator.finalstep = true diff --git a/src/time_integration/methods_3Sstar.jl b/src/time_integration/methods_3Sstar.jl index b0ce5930514..7b70466606c 100644 --- a/src/time_integration/methods_3Sstar.jl +++ b/src/time_integration/methods_3Sstar.jl @@ -282,6 +282,11 @@ function set_proposed_dt!(integrator::SimpleIntegrator3Sstar, dt) integrator.dt = dt end +# Required e.g. for `glm_speed_callback` +function get_proposed_dt(integrator::SimpleIntegrator3Sstar) + return integrator.dt +end + # stop the time integration function terminate!(integrator::SimpleIntegrator3Sstar) integrator.finalstep = true