From 0d076252ec586ff57d0dc4053f2472323a2c0364 Mon Sep 17 00:00:00 2001 From: jClugstor Date: Tue, 12 Nov 2024 11:00:23 -0500 Subject: [PATCH] fix defaults --- lib/OrdinaryDiffEqCore/src/solve.jl | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/lib/OrdinaryDiffEqCore/src/solve.jl b/lib/OrdinaryDiffEqCore/src/solve.jl index dec03b0bd3..a4b8148fe1 100644 --- a/lib/OrdinaryDiffEqCore/src/solve.jl +++ b/lib/OrdinaryDiffEqCore/src/solve.jl @@ -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 @@ -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 @@ -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