Skip to content

Commit

Permalink
Merge pull request #2552 from Shreyas-Ekanathan/master
Browse files Browse the repository at this point in the history
Cache Radau Tableaus
  • Loading branch information
ChrisRackauckas authored Dec 5, 2024
2 parents d01c8c1 + 81f6fc3 commit 9b4ecb2
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 276 deletions.
18 changes: 4 additions & 14 deletions lib/OrdinaryDiffEqFIRK/src/firk_caches.jl
Original file line number Diff line number Diff line change
Expand Up @@ -518,18 +518,13 @@ function alg_cache(alg::AdaptiveRadau, u, rate_prototype, ::Type{uEltypeNoUnits}
end
num_stages = min_stages

tabs = [RadauIIATableau5(uToltype, constvalue(tTypeNoUnits)), RadauIIATableau9(uToltype, constvalue(tTypeNoUnits)), RadauIIATableau13(uToltype, constvalue(tTypeNoUnits))]
i = max(min_stages, 9)
while i <= max_stages
push!(tabs, RadauIIATableau(uToltype, constvalue(tTypeNoUnits), i))
i += 2
end
tabs = [RadauIIATableau(uToltype, constvalue(tTypeNoUnits), i) for i in min_stages:2:max_stages]
cont = Vector{typeof(u)}(undef, max_stages)
for i in 1:max_stages
cont[i] = zero(u)
end

index = min((min_stages - 1) ÷ 2, 4)
index = 1

κ = alg.κ !== nothing ? convert(uToltype, alg.κ) : convert(uToltype, 1 // 100)
J = false .* _vec(rate_prototype) .* _vec(rate_prototype)'
Expand Down Expand Up @@ -602,14 +597,9 @@ function alg_cache(alg::AdaptiveRadau, u, rate_prototype, ::Type{uEltypeNoUnits}
end
num_stages = min_stages

tabs = [RadauIIATableau5(uToltype, constvalue(tTypeNoUnits)), RadauIIATableau9(uToltype, constvalue(tTypeNoUnits)), RadauIIATableau13(uToltype, constvalue(tTypeNoUnits))]
i = max(min_stages, 9)
while i <= max_stages
push!(tabs, RadauIIATableau(uToltype, constvalue(tTypeNoUnits), i))
i += 2
end
tabs = [RadauIIATableau(uToltype, constvalue(tTypeNoUnits), i) for i in min_stages:2:max_stages]

index = min((min_stages - 1) ÷ 2, 4)
index = 1

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

Expand Down
Loading

0 comments on commit 9b4ecb2

Please sign in to comment.