Skip to content

Commit 8140ed7

Browse files
refactor: call get_updated_symbolic_problem in get_concrete_problem instead of init_call
1 parent 4f28525 commit 8140ed7

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/solve.jl

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,6 @@ function init_call(_prob, args...; merge_callbacks = true, kwargshandle = nothin
547547
kwargshandle = has_kwargs(_prob) && haskey(_prob.kwargs, :kwargshandle) ?
548548
_prob.kwargs[:kwargshandle] : kwargshandle
549549

550-
_prob = get_updated_symbolic_problem(_get_root_indp(_prob), _prob)
551550
if has_kwargs(_prob)
552551
if merge_callbacks && haskey(_prob.kwargs, :callback) && haskey(kwargs, :callback)
553552
kwargs_temp = NamedTuple{
@@ -1240,24 +1239,27 @@ function checkkwargs(kwargshandle; kwargs...)
12401239
end
12411240

12421241
function get_concrete_problem(prob::AbstractJumpProblem, isadapt; kwargs...)
1243-
prob
1242+
get_updated_symbolic_problem(_get_root_indp(prob), prob)
12441243
end
12451244

12461245
function get_concrete_problem(prob::SteadyStateProblem, isadapt; kwargs...)
1246+
prob = get_updated_symbolic_problem(_get_root_indp(prob), prob)
12471247
p = get_concrete_p(prob, kwargs)
12481248
u0 = get_concrete_u0(prob, isadapt, Inf, kwargs)
12491249
u0 = promote_u0(u0, p, nothing)
12501250
remake(prob; u0 = u0, p = p)
12511251
end
12521252

12531253
function get_concrete_problem(prob::NonlinearProblem, isadapt; kwargs...)
1254+
prob = get_updated_symbolic_problem(_get_root_indp(prob), prob)
12541255
p = get_concrete_p(prob, kwargs)
12551256
u0 = get_concrete_u0(prob, isadapt, nothing, kwargs)
12561257
u0 = promote_u0(u0, p, nothing)
12571258
remake(prob; u0 = u0, p = p)
12581259
end
12591260

12601261
function get_concrete_problem(prob::NonlinearLeastSquaresProblem, isadapt; kwargs...)
1262+
prob = get_updated_symbolic_problem(_get_root_indp(prob), prob)
12611263
p = get_concrete_p(prob, kwargs)
12621264
u0 = get_concrete_u0(prob, isadapt, nothing, kwargs)
12631265
u0 = promote_u0(u0, p, nothing)
@@ -1279,6 +1281,7 @@ function init(prob::PDEProblem, alg::AbstractDEAlgorithm, args...;
12791281
end
12801282

12811283
function get_concrete_problem(prob, isadapt; kwargs...)
1284+
prob = get_updated_symbolic_problem(_get_root_indp(prob), prob)
12821285
p = get_concrete_p(prob, kwargs)
12831286
tspan = get_concrete_tspan(prob, isadapt, kwargs, p)
12841287
u0 = get_concrete_u0(prob, isadapt, tspan[1], kwargs)
@@ -1297,6 +1300,7 @@ function get_concrete_problem(prob, isadapt; kwargs...)
12971300
end
12981301

12991302
function get_concrete_problem(prob::DAEProblem, isadapt; kwargs...)
1303+
prob = get_updated_symbolic_problem(_get_root_indp(prob), prob)
13001304
p = get_concrete_p(prob, kwargs)
13011305
tspan = get_concrete_tspan(prob, isadapt, kwargs, p)
13021306
u0 = get_concrete_u0(prob, isadapt, tspan[1], kwargs)
@@ -1320,6 +1324,7 @@ function get_concrete_problem(prob::DAEProblem, isadapt; kwargs...)
13201324
end
13211325

13221326
function get_concrete_problem(prob::DDEProblem, isadapt; kwargs...)
1327+
prob = get_updated_symbolic_problem(_get_root_indp(prob), prob)
13231328
p = get_concrete_p(prob, kwargs)
13241329
tspan = get_concrete_tspan(prob, isadapt, kwargs, p)
13251330
u0 = get_concrete_u0(prob, isadapt, tspan[1], kwargs)

0 commit comments

Comments
 (0)