Skip to content

Commit 77560bd

Browse files
committed
Fix alg_cache verbose parameter compatibility
- Add missing [sources.OrdinaryDiffEqSDIRK] to OrdinaryDiffEqNonlinearSolve, ImplicitDiscreteSolve, and SimpleImplicitDiscreteSolve Project.toml files to ensure tests use local versions with verbose parameter support - Update OrdinaryDiffEqNewmark alg_cache methods to accept verbose parameter - Add backwards compatibility methods for callers that don't pass verbose 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent c9fcf3b commit 77560bd

File tree

4 files changed

+34
-2
lines changed

4 files changed

+34
-2
lines changed

lib/ImplicitDiscreteSolve/Project.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ SymbolicIndexingInterface = "2efcf032-c050-4f8e-a9bb-153293bab1f5"
1515

1616
[sources]
1717
OrdinaryDiffEqCore = {path = "../OrdinaryDiffEqCore"}
18+
OrdinaryDiffEqSDIRK = {path = "../OrdinaryDiffEqSDIRK"}
1819

1920
[compat]
2021
AllocCheck = "0.2"

lib/OrdinaryDiffEqNewmark/src/newmark_caches.jl

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ function alg_cache(
1515
alg::NewmarkBeta, u, rate_prototype, ::Type{uEltypeNoUnits},
1616
::Type{uBottomEltypeNoUnits}, ::Type{tTypeNoUnits}, uprev, uprev2, f, t,
1717
dt, reltol, p, calck,
18-
::Val{true}
18+
::Val{true}, verbose
1919
) where {uEltypeNoUnits, uBottomEltypeNoUnits, tTypeNoUnits}
2020
(; β, γ, thread) = alg
2121
fsalfirst = zero(rate_prototype)
@@ -57,7 +57,7 @@ function alg_cache(
5757
alg::NewmarkBeta, u, rate_prototype, ::Type{uEltypeNoUnits},
5858
::Type{uBottomEltypeNoUnits}, ::Type{tTypeNoUnits}, uprev, uprev2, f, t,
5959
dt, reltol, p, calck,
60-
::Val{false}
60+
::Val{false}, verbose
6161
) where {uEltypeNoUnits, uBottomEltypeNoUnits, tTypeNoUnits}
6262
(; β, γ, thread) = alg
6363
fsalfirst = zero(rate_prototype)
@@ -80,3 +80,28 @@ end
8080
function get_fsalfirstlast(cache::Union{NewmarkBetaCache, NewmarkBetaConstantCache}, u)
8181
return (cache.fsalfirst, cache.fsalfirst)
8282
end
83+
84+
# Backwards compatibility: handle old callers that don't pass verbose parameter
85+
function alg_cache(
86+
alg::NewmarkBeta, u, rate_prototype, ::Type{uEltypeNoUnits},
87+
::Type{uBottomEltypeNoUnits}, ::Type{tTypeNoUnits}, uprev, uprev2, f, t,
88+
dt, reltol, p, calck,
89+
::Val{true}
90+
) where {uEltypeNoUnits, uBottomEltypeNoUnits, tTypeNoUnits}
91+
return alg_cache(
92+
alg, u, rate_prototype, uEltypeNoUnits, uBottomEltypeNoUnits,
93+
tTypeNoUnits, uprev, uprev2, f, t, dt, reltol, p, calck, Val(true), nothing
94+
)
95+
end
96+
97+
function alg_cache(
98+
alg::NewmarkBeta, u, rate_prototype, ::Type{uEltypeNoUnits},
99+
::Type{uBottomEltypeNoUnits}, ::Type{tTypeNoUnits}, uprev, uprev2, f, t,
100+
dt, reltol, p, calck,
101+
::Val{false}
102+
) where {uEltypeNoUnits, uBottomEltypeNoUnits, tTypeNoUnits}
103+
return alg_cache(
104+
alg, u, rate_prototype, uEltypeNoUnits, uBottomEltypeNoUnits,
105+
tTypeNoUnits, uprev, uprev2, f, t, dt, reltol, p, calck, Val(false), nothing
106+
)
107+
end

lib/OrdinaryDiffEqNonlinearSolve/Project.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,3 +80,6 @@ path = "../OrdinaryDiffEqDifferentiation"
8080

8181
[sources.OrdinaryDiffEqCore]
8282
path = "../OrdinaryDiffEqCore"
83+
84+
[sources.OrdinaryDiffEqSDIRK]
85+
path = "../OrdinaryDiffEqSDIRK"

lib/SimpleImplicitDiscreteSolve/Project.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,6 @@ SimpleNonlinearSolve = "2.7"
2828

2929
[targets]
3030
test = ["JET", "OrdinaryDiffEqSDIRK", "Test", "AllocCheck"]
31+
32+
[sources]
33+
OrdinaryDiffEqSDIRK = {path = "../OrdinaryDiffEqSDIRK"}

0 commit comments

Comments
 (0)