From 90aac04fb3b929ff1cae3111a7277264fea60f65 Mon Sep 17 00:00:00 2001 From: Christopher Rackauckas Date: Sun, 30 Jun 2024 09:37:29 +0800 Subject: [PATCH] imports --- .../src/OrdinaryDiffEqSSPRK.jl | 4 +++- lib/OrdinaryDiffEqSSPRK/src/addsteps.jl | 8 +++---- lib/OrdinaryDiffEqSSPRK/src/interpolants.jl | 2 ++ src/dense/interpolants.jl | 23 ------------------- 4 files changed, 9 insertions(+), 28 deletions(-) diff --git a/lib/OrdinaryDiffEqSSPRK/src/OrdinaryDiffEqSSPRK.jl b/lib/OrdinaryDiffEqSSPRK/src/OrdinaryDiffEqSSPRK.jl index 195b9a3f4a..658d21baef 100644 --- a/lib/OrdinaryDiffEqSSPRK/src/OrdinaryDiffEqSSPRK.jl +++ b/lib/OrdinaryDiffEqSSPRK/src/OrdinaryDiffEqSSPRK.jl @@ -10,7 +10,9 @@ import OrdinaryDiffEq: alg_order, calculate_residuals!, OrdinaryDiffEqAdaptiveAlgorithm, uses_uprev, alg_cache, _vec, _reshape, @cache, isfsal, full_cache, constvalue, _unwrap_val, du_alias_or_new, - explicit_rk_docstring, trivial_limiter! + explicit_rk_docstring, trivial_limiter!, + _ode_interpolant, _ode_interpolant!, + _ode_addsteps! using DiffEqBase, FastBroadcast, Polyester, MuladdMacro, RecursiveArrayTools using DiffEqBase: @def using Static: False diff --git a/lib/OrdinaryDiffEqSSPRK/src/addsteps.jl b/lib/OrdinaryDiffEqSSPRK/src/addsteps.jl index 4948f2dfa5..5f31180d9e 100644 --- a/lib/OrdinaryDiffEqSSPRK/src/addsteps.jl +++ b/lib/OrdinaryDiffEqSSPRK/src/addsteps.jl @@ -3,10 +3,10 @@ function _ode_addsteps!(k, t, uprev, u, dt, f, p, SSPRK43ConstantCache, SSPRK432ConstantCache}, always_calc_begin = false, allow_calc_end = true, force_calc_end = false) -if length(k) < 1 || always_calc_begin - copyat_or_push!(k, 1, f(uprev, p, t)) -end -nothing + if length(k) < 1 || always_calc_begin + copyat_or_push!(k, 1, f(uprev, p, t)) + end + nothing end function _ode_addsteps!(k, t, uprev, u, dt, f, p, diff --git a/lib/OrdinaryDiffEqSSPRK/src/interpolants.jl b/lib/OrdinaryDiffEqSSPRK/src/interpolants.jl index aa8f6d090f..a5258bb49c 100644 --- a/lib/OrdinaryDiffEqSSPRK/src/interpolants.jl +++ b/lib/OrdinaryDiffEqSSPRK/src/interpolants.jl @@ -1,3 +1,5 @@ +const NEGZERO = Float16(-0.0f0) + @def ssprkpre0 begin c00 = @evalpoly(Θ, 1, NEGZERO, -1) c10 = Θ^2 diff --git a/src/dense/interpolants.jl b/src/dense/interpolants.jl index 6f92e895df..7356b8865d 100644 --- a/src/dense/interpolants.jl +++ b/src/dense/interpolants.jl @@ -251,29 +251,6 @@ end out end -const NEGZERO = Float16(-0.0f0) -""" -Second order strong stability preserving (SSP) interpolant. - -Ketcheson, Lóczi, Jangabylova, Kusmanov: Dense output for SSP RK methods (2017). -""" -@def ssprkpre0 begin - c00 = @evalpoly(Θ, 1, NEGZERO, -1) - c10 = Θ^2 - b10dt = Θ * @evalpoly(Θ, 1, -1) * dt -end - -@def ssprkpre1 begin - b10diff = @evalpoly(Θ, 1, -2) - c10diffinvdt = 2Θ * inv(dt) # = -c00diff * inv(dt) -end - -@def ssprkpre2 begin - invdt = inv(dt) - b10diff2invdt = -2 * invdt - c10diff2invdt2 = 2 * invdt^2 # = -c00diff2 * inv(dt)^2 -end - """ Runge–Kutta pairs of order 5(4) satisfying only the first column simplifying assumption