Skip to content

Commit

Permalink
refactor: relax initialize_dae! type restrictions
Browse files Browse the repository at this point in the history
  • Loading branch information
AayushSabharwal committed Nov 29, 2024
1 parent fd2ee92 commit 9965cbb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/initialize_dae.jl
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 9965cbb

Please sign in to comment.