Skip to content

Commit

Permalink
imports
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisRackauckas committed Jun 30, 2024
1 parent 00f2fd5 commit 90aac04
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 28 deletions.
4 changes: 3 additions & 1 deletion lib/OrdinaryDiffEqSSPRK/src/OrdinaryDiffEqSSPRK.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions lib/OrdinaryDiffEqSSPRK/src/addsteps.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 2 additions & 0 deletions lib/OrdinaryDiffEqSSPRK/src/interpolants.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
const NEGZERO = Float16(-0.0f0)

@def ssprkpre0 begin
c00 = @evalpoly(Θ, 1, NEGZERO, -1)
c10 = Θ^2
Expand Down
23 changes: 0 additions & 23 deletions src/dense/interpolants.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 90aac04

Please sign in to comment.