@@ -216,8 +216,10 @@ Keyword arguments:
216216 If the former is `nothing`, this keyword argument will be used. If it is also not provided,
217217 an error will be thrown.
218218
219+ All additional keyword arguments are forwarded to `solve`.
220+
219221In case the initialization problem is trivial, `nlsolve_alg`, `abstol` and `reltol` are
220- not required.
222+ not required. `solve` is also not called.
221223"""
222224function get_initial_values (prob, valp, f, alg:: OverrideInit ,
223225 iip:: Union{Val{true}, Val{false}} ; nlsolve_alg = nothing , abstol = nothing , reltol = nothing , kwargs... )
@@ -257,7 +259,7 @@ function get_initial_values(prob, valp, f, alg::OverrideInit,
257259 else
258260 throw (OverrideInitNoTolerance (:reltol ))
259261 end
260- nlsol = solve (initprob, nlsolve_alg; abstol = _abstol, reltol = _reltol)
262+ nlsol = solve (initprob, nlsolve_alg; abstol = _abstol, reltol = _reltol, kwargs ... )
261263 success = SciMLBase. successful_retcode (nlsol)
262264 end
263265
@@ -304,7 +306,8 @@ function initialization_status(prob::AbstractSciMLProblem)
304306 iprob = prob. f. initialization_data. initializeprob
305307 isnothing (prob) && return nothing
306308
307- nunknowns = iprob. u0 === nothing ? 0 : length (iprob. u0)
309+ iu0 = state_values (iprob)
310+ nunknowns = iu0 === nothing ? 0 : length (iu0)
308311 neqs = if __has_resid_prototype (iprob. f) && iprob. f. resid_prototype != = nothing
309312 length (iprob. f. resid_prototype)
310313 else
0 commit comments