Skip to content

Commit

Permalink
fix defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
jClugstor committed Dec 11, 2024
1 parent 0454f1c commit bdaa141
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions lib/OrdinaryDiffEqCore/src/solve.jl
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ function DiffEqBase.__init(
userdata = nothing,
allow_extrapolation = alg_extrapolates(alg),
initialize_integrator = true,
alias = ODEAliasSpecifier(alias_u0 = false, alias_du0 = false),
alias = ODEAliasSpecifier(alias_u0 = false, alias_du0 = false, alias_p = true, alias_f = true),
initializealg = DefaultInit(),
kwargs...) where {recompile_flag}
if prob isa DiffEqBase.AbstractDAEProblem && alg isa OrdinaryDiffEqAlgorithm
Expand Down Expand Up @@ -158,18 +158,6 @@ function DiffEqBase.__init(
_alg = alg
end

if aliases.alias_f
f = prob.f
else
f = deepcopy(prob.f)
end

if aliases.alias_p
p = prob.p
else
p = recursivecopy(prob.p)
end

use_old_kwargs = haskey(kwargs,:alias_u0) || haskey(kwargs,:alias_du0)

if use_old_kwargs
Expand Down Expand Up @@ -202,6 +190,18 @@ function DiffEqBase.__init(
end
end

if aliases.alias_f || isnothing(aliases.alias_f)
f = prob.f
else
f = deepcopy(prob.f)
end

if aliases.alias_p || isnothing(aliases.alias_f)
p = prob.p
else
p = recursivecopy(prob.p)
end

if aliases.alias_u0
u = prob.u0
else
Expand Down

0 comments on commit bdaa141

Please sign in to comment.