@@ -515,6 +515,32 @@ function Base.showerror(io::IO, e::LateBindingTstopsNotSupportedError)
515515 println (io, TruncatedStacktraces. VERBOSE_MSG)
516516end
517517
518+ """
519+ $(TYPEDSIGNATURES)
520+
521+ Given the index provider `indp` used to construct the problem `prob` being solved, return
522+ an updated `prob` to be used for solving. All implementations should accept arbitrary
523+ keyword arguments.
524+
525+ Should be called before the problem is solved, after performing type-promotion on the
526+ problem.
527+ """
528+ function get_updated_symbolic_problem (indp, prob; kw... )
529+ return prob
530+ end
531+
532+ """
533+ $(TYPEDSIGNATURES)
534+
535+ Get the innermost index provider using `SII.symbolic_container`.
536+ """
537+ function _get_root_indp (indp)
538+ if hasmethod (SII. symbolic_container, Tuple{typeof (indp)}) && (sc = SII. symbolic_container (indp)) != = indp
539+ return _get_root_indp (sc)
540+ end
541+ return indp
542+ end
543+
518544function init_call (_prob, args... ; merge_callbacks = true , kwargshandle = nothing ,
519545 kwargs... )
520546 kwargshandle = kwargshandle === nothing ? KeywordArgError : kwargshandle
@@ -1213,24 +1239,27 @@ function checkkwargs(kwargshandle; kwargs...)
12131239end
12141240
12151241function get_concrete_problem (prob:: AbstractJumpProblem , isadapt; kwargs... )
1216- prob
1242+ get_updated_symbolic_problem ( _get_root_indp ( prob), prob)
12171243end
12181244
12191245function get_concrete_problem (prob:: SteadyStateProblem , isadapt; kwargs... )
1246+ prob = get_updated_symbolic_problem (_get_root_indp (prob), prob)
12201247 p = get_concrete_p (prob, kwargs)
12211248 u0 = get_concrete_u0 (prob, isadapt, Inf , kwargs)
12221249 u0 = promote_u0 (u0, p, nothing )
12231250 remake (prob; u0 = u0, p = p)
12241251end
12251252
12261253function get_concrete_problem (prob:: NonlinearProblem , isadapt; kwargs... )
1254+ prob = get_updated_symbolic_problem (_get_root_indp (prob), prob)
12271255 p = get_concrete_p (prob, kwargs)
12281256 u0 = get_concrete_u0 (prob, isadapt, nothing , kwargs)
12291257 u0 = promote_u0 (u0, p, nothing )
12301258 remake (prob; u0 = u0, p = p)
12311259end
12321260
12331261function get_concrete_problem (prob:: NonlinearLeastSquaresProblem , isadapt; kwargs... )
1262+ prob = get_updated_symbolic_problem (_get_root_indp (prob), prob)
12341263 p = get_concrete_p (prob, kwargs)
12351264 u0 = get_concrete_u0 (prob, isadapt, nothing , kwargs)
12361265 u0 = promote_u0 (u0, p, nothing )
@@ -1252,6 +1281,7 @@ function init(prob::PDEProblem, alg::AbstractDEAlgorithm, args...;
12521281end
12531282
12541283function get_concrete_problem (prob, isadapt; kwargs... )
1284+ prob = get_updated_symbolic_problem (_get_root_indp (prob), prob)
12551285 p = get_concrete_p (prob, kwargs)
12561286 tspan = get_concrete_tspan (prob, isadapt, kwargs, p)
12571287 u0 = get_concrete_u0 (prob, isadapt, tspan[1 ], kwargs)
@@ -1270,6 +1300,7 @@ function get_concrete_problem(prob, isadapt; kwargs...)
12701300end
12711301
12721302function get_concrete_problem (prob:: DAEProblem , isadapt; kwargs... )
1303+ prob = get_updated_symbolic_problem (_get_root_indp (prob), prob)
12731304 p = get_concrete_p (prob, kwargs)
12741305 tspan = get_concrete_tspan (prob, isadapt, kwargs, p)
12751306 u0 = get_concrete_u0 (prob, isadapt, tspan[1 ], kwargs)
@@ -1293,6 +1324,7 @@ function get_concrete_problem(prob::DAEProblem, isadapt; kwargs...)
12931324end
12941325
12951326function get_concrete_problem (prob:: DDEProblem , isadapt; kwargs... )
1327+ prob = get_updated_symbolic_problem (_get_root_indp (prob), prob)
12961328 p = get_concrete_p (prob, kwargs)
12971329 tspan = get_concrete_tspan (prob, isadapt, kwargs, p)
12981330 u0 = get_concrete_u0 (prob, isadapt, tspan[1 ], kwargs)
0 commit comments