Skip to content

Commit e06c7f5

Browse files
authored
Implementation of get_fsalfirstlast for MPRK schemes (#119)
* tried to implement get_fsalfirstlast for MPE * Implemented get_fsalfirstlast for MPRK schemes
1 parent 719311e commit e06c7f5

File tree

3 files changed

+16
-15
lines changed

3 files changed

+16
-15
lines changed

src/PositiveIntegrators.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ import OrdinaryDiffEq: alg_order, isfsal,
3535
calculate_residuals, calculate_residuals!,
3636
alg_cache, get_tmp_cache,
3737
initialize!, perform_step!,
38-
_ode_interpolant, _ode_interpolant!
38+
_ode_interpolant, _ode_interpolant!,
39+
get_fsalfirstlast
3940

4041
# 2. Export functionality defining the public API
4142
export PDSFunction, PDSProblem

src/mprk.jl

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,10 @@ end
217217
return nothing
218218
end
219219

220+
# We use MPRKMutableCache as supertype for all MPRK scheme caches
221+
abstract type MPRKMutableCache <: OrdinaryDiffEqMutableCache end
222+
get_fsalfirstlast(cache::MPRKMutableCache, rate_prototype) = (nothing, nothing)
223+
220224
### MPE #####################################################################################
221225
"""
222226
MPE([linsolve = ..., small_constant = ...])
@@ -321,7 +325,7 @@ end
321325
integrator.u = u
322326
end
323327

324-
struct MPECache{PType, uType, tabType, F} <: OrdinaryDiffEqMutableCache
328+
struct MPECache{PType, uType, tabType, F} <: MPRKMutableCache
325329
P::PType
326330
D::uType
327331
σ::uType
@@ -330,7 +334,7 @@ struct MPECache{PType, uType, tabType, F} <: OrdinaryDiffEqMutableCache
330334
linsolve::F
331335
end
332336

333-
struct MPEConservativeCache{PType, uType, tabType, F} <: OrdinaryDiffEqMutableCache
337+
struct MPEConservativeCache{PType, uType, tabType, F} <: MPRKMutableCache
334338
P::PType
335339
σ::uType
336340
tab::tabType
@@ -618,8 +622,7 @@ end
618622
integrator.u = u
619623
end
620624

621-
struct MPRK22Cache{uType, PType, tabType, F} <:
622-
OrdinaryDiffEqMutableCache
625+
struct MPRK22Cache{uType, PType, tabType, F} <: MPRKMutableCache
623626
tmp::uType
624627
P::PType
625628
P2::PType
@@ -630,8 +633,7 @@ struct MPRK22Cache{uType, PType, tabType, F} <:
630633
linsolve::F
631634
end
632635

633-
struct MPRK22ConservativeCache{uType, PType, tabType, F} <:
634-
OrdinaryDiffEqMutableCache
636+
struct MPRK22ConservativeCache{uType, PType, tabType, F} <: MPRKMutableCache
635637
tmp::uType
636638
P::PType
637639
P2::PType
@@ -1197,7 +1199,7 @@ end
11971199
integrator.u = u
11981200
end
11991201

1200-
struct MPRK43Cache{uType, PType, tabType, F} <: OrdinaryDiffEqMutableCache
1202+
struct MPRK43Cache{uType, PType, tabType, F} <: MPRKMutableCache
12011203
tmp::uType
12021204
tmp2::uType
12031205
P::PType
@@ -1211,7 +1213,7 @@ struct MPRK43Cache{uType, PType, tabType, F} <: OrdinaryDiffEqMutableCache
12111213
linsolve::F
12121214
end
12131215

1214-
struct MPRK43ConservativeCache{uType, PType, tabType, F} <: OrdinaryDiffEqMutableCache
1216+
struct MPRK43ConservativeCache{uType, PType, tabType, F} <: MPRKMutableCache
12151217
tmp::uType
12161218
tmp2::uType
12171219
P::PType

src/sspmprk.jl

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -201,8 +201,7 @@ end
201201
integrator.u = u
202202
end
203203

204-
struct SSPMPRK22Cache{uType, PType, tabType, F} <:
205-
OrdinaryDiffEqMutableCache
204+
struct SSPMPRK22Cache{uType, PType, tabType, F} <: MPRKMutableCache
206205
tmp::uType
207206
P::PType
208207
P2::PType
@@ -213,8 +212,7 @@ struct SSPMPRK22Cache{uType, PType, tabType, F} <:
213212
linsolve::F
214213
end
215214

216-
struct SSPMPRK22ConservativeCache{uType, PType, tabType, F} <:
217-
OrdinaryDiffEqMutableCache
215+
struct SSPMPRK22ConservativeCache{uType, PType, tabType, F} <: MPRKMutableCache
218216
tmp::uType
219217
P::PType
220218
P2::PType
@@ -709,7 +707,7 @@ end
709707
integrator.u = u
710708
end
711709

712-
struct SSPMPRK43Cache{uType, PType, tabType, F} <: OrdinaryDiffEqMutableCache
710+
struct SSPMPRK43Cache{uType, PType, tabType, F} <: MPRKMutableCache
713711
tmp::uType
714712
tmp2::uType
715713
P::PType
@@ -724,7 +722,7 @@ struct SSPMPRK43Cache{uType, PType, tabType, F} <: OrdinaryDiffEqMutableCache
724722
linsolve::F
725723
end
726724

727-
struct SSPMPRK43ConservativeCache{uType, PType, tabType, F} <: OrdinaryDiffEqMutableCache
725+
struct SSPMPRK43ConservativeCache{uType, PType, tabType, F} <: MPRKMutableCache
728726
tmp::uType
729727
tmp2::uType
730728
P::PType

0 commit comments

Comments
 (0)