From 0a1275315082322918914ec3d4f5308f955a99b6 Mon Sep 17 00:00:00 2001 From: Aayush Sabharwal Date: Thu, 21 Nov 2024 17:26:57 +0530 Subject: [PATCH] feat: add `constructorof` for `DAEProblem` --- src/problems/dae_problems.jl | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/problems/dae_problems.jl b/src/problems/dae_problems.jl index 6e91313fe..1755d29b1 100644 --- a/src/problems/dae_problems.jl +++ b/src/problems/dae_problems.jl @@ -112,3 +112,10 @@ end function DAEProblem(f, du0, u0, tspan, p = NullParameters(); kwargs...) DAEProblem(DAEFunction(f), du0, u0, tspan, p; kwargs...) end + +function ConstructionBase.constructorof(::Type{P}) where {P <: DAEProblem} + function ctor(f, du0, u0, tspan, p, kw, dv) + iip = isinplace(f) + return DAEProblem{iip}(f, du0, u0, tspan, p; differential_vars = dv, kw...) + end +end