Skip to content

Commit 83f8c3d

Browse files
fix: fix SII implementation for NonlinearSolveNoInitCache (#506)
Co-authored-by: Christopher Rackauckas <accounts@chrisrackauckas.com>
1 parent 7f90cf4 commit 83f8c3d

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

lib/NonlinearSolveBase/src/solve.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,8 @@ end
248248
kwargs::Any
249249
end
250250

251+
get_u(cache::NonlinearSolveNoInitCache) = SII.state_values(cache.prob)
252+
251253
function SciMLBase.reinit!(
252254
cache::NonlinearSolveNoInitCache, u0 = cache.prob.u0; p = cache.prob.p, kwargs...
253255
)

test/mtk_cache_indexing_tests.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@
2020
nint = init(nlprob, alg)
2121
@test nint isa integtype
2222

23+
@test_nowarn state_values(nint)
24+
@test_nowarn parameter_values(nint)
25+
2326
for (i, sym) in enumerate([X, nlsys.X, :X])
2427
# test both getindex and setindex!
2528
nint[sym] = 1.5i

0 commit comments

Comments
 (0)