Skip to content

Commit

Permalink
cached tableaus
Browse files Browse the repository at this point in the history
  • Loading branch information
Shreyas-Ekanathan committed Sep 2, 2024
1 parent ff10299 commit df3063f
Show file tree
Hide file tree
Showing 3 changed files with 297 additions and 41 deletions.
22 changes: 20 additions & 2 deletions lib/OrdinaryDiffEqFIRK/src/firk_caches.jl
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,16 @@ function alg_cache(alg::AdaptiveRadau, u, rate_prototype, ::Type{uEltypeNoUnits}
uf = UDerivativeWrapper(f, t, p)
uToltype = constvalue(uBottomEltypeNoUnits)
num_stages = alg.num_stages
tab = adaptiveRadauTableau(uToltype, constvalue(tTypeNoUnits), num_stages)

if (num_stages == 3)
tab = BigRadauIIA5Tableau(uToltype, constvalue(tTypeNoUnits), Int)
elseif (num_stages == 5)
tab = BigRadauIIA9Tableau(uToltype, constvalue(tTypeNoUnits), Int)
#elseif (num_stages == 7)
# tab = BigRadauIIA13Tableau(uToltype, constvalue(tTypeNoUnits), Int)
else
tab = adaptiveRadauTableau(uToltype, constvalue(tTypeNoUnits), num_stages)
end

cont = Vector{typeof(u)}(undef, num_stages)
for i in 1: num_stages
Expand Down Expand Up @@ -554,7 +563,16 @@ function alg_cache(alg::AdaptiveRadau, u, rate_prototype, ::Type{uEltypeNoUnits}
uf = UJacobianWrapper(f, t, p)
uToltype = constvalue(uBottomEltypeNoUnits)
num_stages = alg.num_stages
tab = adaptiveRadauTableau(uToltype, constvalue(tTypeNoUnits), num_stages)

if (num_stages == 3)
tab = BigRadauIIA5Tableau(uToltype, constvalue(tTypeNoUnits), Int)
elseif (num_stages == 5)
tab = BigRadauIIA9Tableau(uToltype, constvalue(tTypeNoUnits), Int)
#elseif (num_stages == 7)
# tab = BigRadauIIA13Tableau(uToltype, constvalue(tTypeNoUnits), Int)
else
tab = adaptiveRadauTableau(uToltype, constvalue(tTypeNoUnits), num_stages)
end

κ = alg.κ !== nothing ? convert(uToltype, alg.κ) : convert(uToltype, 1 // 100)

Expand Down
Loading

0 comments on commit df3063f

Please sign in to comment.