From 9965cbb980ec092313314caf3d9a98e6492412dd Mon Sep 17 00:00:00 2001 From: Aayush Sabharwal Date: Fri, 29 Nov 2024 13:30:54 +0530 Subject: [PATCH] refactor: relax `initialize_dae!` type restrictions --- src/initialize_dae.jl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/initialize_dae.jl b/src/initialize_dae.jl index 947e3aa5..50b52b1e 100644 --- a/src/initialize_dae.jl +++ b/src/initialize_dae.jl @@ -1,13 +1,13 @@ struct SDEDefaultInit <: DiffEqBase.DAEInitializationAlgorithm end -function DiffEqBase.initialize_dae!(integrator::SDEIntegrator, initializealg = integrator.initializealg) +function DiffEqBase.initialize_dae!(integrator::AbstractSDEIntegrator, initializealg = integrator.initializealg) OrdinaryDiffEqCore._initialize_dae!(integrator, integrator.sol.prob, initializealg, Val(DiffEqBase.isinplace(integrator.sol.prob))) end -function OrdinaryDiffEqCore._initialize_dae!(integrator::SDEIntegrator, prob, ::SDEDefaultInit, isinplace) +function OrdinaryDiffEqCore._initialize_dae!(integrator::AbstractSDEIntegrator, prob, ::SDEDefaultInit, isinplace) if SciMLBase.has_initializeprob(prob.f) OrdinaryDiffEqCore._initialize_dae!(integrator, prob, SciMLBase.OverrideInit(), isinplace) - else + elseif prob.f.mass_matrix isa Tuple && any(mm != I for mm in prob.f.mass_matrix) || prob.f.mass_matrix != I OrdinaryDiffEqCore._initialize_dae!(integrator, prob, SciMLBase.CheckInit(), isinplace) end end