Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implementation of get_fsalfirstlast for MPRK schemes #119

Merged
merged 2 commits into from
Aug 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/PositiveIntegrators.jl
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ import OrdinaryDiffEq: alg_order, isfsal,
calculate_residuals, calculate_residuals!,
alg_cache, get_tmp_cache,
initialize!, perform_step!,
_ode_interpolant, _ode_interpolant!
_ode_interpolant, _ode_interpolant!,
get_fsalfirstlast

# 2. Export functionality defining the public API
export PDSFunction, PDSProblem
Expand Down
18 changes: 10 additions & 8 deletions src/mprk.jl
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,10 @@ end
return nothing
end

# We use MPRKMutableCache as supertype for all MPRK scheme caches
abstract type MPRKMutableCache <: OrdinaryDiffEqMutableCache end
get_fsalfirstlast(cache::MPRKMutableCache, rate_prototype) = (nothing, nothing)

### MPE #####################################################################################
"""
MPE([linsolve = ..., small_constant = ...])
Expand Down Expand Up @@ -321,7 +325,7 @@ end
integrator.u = u
end

struct MPECache{PType, uType, tabType, F} <: OrdinaryDiffEqMutableCache
struct MPECache{PType, uType, tabType, F} <: MPRKMutableCache
P::PType
D::uType
σ::uType
Expand All @@ -330,7 +334,7 @@ struct MPECache{PType, uType, tabType, F} <: OrdinaryDiffEqMutableCache
linsolve::F
end

struct MPEConservativeCache{PType, uType, tabType, F} <: OrdinaryDiffEqMutableCache
struct MPEConservativeCache{PType, uType, tabType, F} <: MPRKMutableCache
P::PType
σ::uType
tab::tabType
Expand Down Expand Up @@ -618,8 +622,7 @@ end
integrator.u = u
end

struct MPRK22Cache{uType, PType, tabType, F} <:
OrdinaryDiffEqMutableCache
struct MPRK22Cache{uType, PType, tabType, F} <: MPRKMutableCache
tmp::uType
P::PType
P2::PType
Expand All @@ -630,8 +633,7 @@ struct MPRK22Cache{uType, PType, tabType, F} <:
linsolve::F
end

struct MPRK22ConservativeCache{uType, PType, tabType, F} <:
OrdinaryDiffEqMutableCache
struct MPRK22ConservativeCache{uType, PType, tabType, F} <: MPRKMutableCache
tmp::uType
P::PType
P2::PType
Expand Down Expand Up @@ -1197,7 +1199,7 @@ end
integrator.u = u
end

struct MPRK43Cache{uType, PType, tabType, F} <: OrdinaryDiffEqMutableCache
struct MPRK43Cache{uType, PType, tabType, F} <: MPRKMutableCache
tmp::uType
tmp2::uType
P::PType
Expand All @@ -1211,7 +1213,7 @@ struct MPRK43Cache{uType, PType, tabType, F} <: OrdinaryDiffEqMutableCache
linsolve::F
end

struct MPRK43ConservativeCache{uType, PType, tabType, F} <: OrdinaryDiffEqMutableCache
struct MPRK43ConservativeCache{uType, PType, tabType, F} <: MPRKMutableCache
tmp::uType
tmp2::uType
P::PType
Expand Down
10 changes: 4 additions & 6 deletions src/sspmprk.jl
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,7 @@ end
integrator.u = u
end

struct SSPMPRK22Cache{uType, PType, tabType, F} <:
OrdinaryDiffEqMutableCache
struct SSPMPRK22Cache{uType, PType, tabType, F} <: MPRKMutableCache
tmp::uType
P::PType
P2::PType
Expand All @@ -213,8 +212,7 @@ struct SSPMPRK22Cache{uType, PType, tabType, F} <:
linsolve::F
end

struct SSPMPRK22ConservativeCache{uType, PType, tabType, F} <:
OrdinaryDiffEqMutableCache
struct SSPMPRK22ConservativeCache{uType, PType, tabType, F} <: MPRKMutableCache
tmp::uType
P::PType
P2::PType
Expand Down Expand Up @@ -709,7 +707,7 @@ end
integrator.u = u
end

struct SSPMPRK43Cache{uType, PType, tabType, F} <: OrdinaryDiffEqMutableCache
struct SSPMPRK43Cache{uType, PType, tabType, F} <: MPRKMutableCache
tmp::uType
tmp2::uType
P::PType
Expand All @@ -724,7 +722,7 @@ struct SSPMPRK43Cache{uType, PType, tabType, F} <: OrdinaryDiffEqMutableCache
linsolve::F
end

struct SSPMPRK43ConservativeCache{uType, PType, tabType, F} <: OrdinaryDiffEqMutableCache
struct SSPMPRK43ConservativeCache{uType, PType, tabType, F} <: MPRKMutableCache
tmp::uType
tmp2::uType
P::PType
Expand Down