diff --git a/lib/NonlinearSolveBase/src/solve.jl b/lib/NonlinearSolveBase/src/solve.jl index e4dd33636..66ad6a0e4 100644 --- a/lib/NonlinearSolveBase/src/solve.jl +++ b/lib/NonlinearSolveBase/src/solve.jl @@ -248,6 +248,8 @@ end kwargs::Any end +get_u(cache::NonlinearSolveNoInitCache) = SII.state_values(cache.prob) + function SciMLBase.reinit!( cache::NonlinearSolveNoInitCache, u0 = cache.prob.u0; p = cache.prob.p, kwargs... ) diff --git a/test/mtk_cache_indexing_tests.jl b/test/mtk_cache_indexing_tests.jl index 6e059e78c..dc11a1147 100644 --- a/test/mtk_cache_indexing_tests.jl +++ b/test/mtk_cache_indexing_tests.jl @@ -20,6 +20,9 @@ nint = init(nlprob, alg) @test nint isa integtype + @test_nowarn state_values(nint) + @test_nowarn parameter_values(nint) + for (i, sym) in enumerate([X, nlsys.X, :X]) # test both getindex and setindex! nint[sym] = 1.5i