Skip to content

Commit

Permalink
Make hasmethod check if BrownFullBasicInit is defined
Browse files Browse the repository at this point in the history
  • Loading branch information
Ickaser committed Nov 8, 2024
1 parent 44dce66 commit 6a8547e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/OrdinaryDiffEqCore/src/initialize_dae.jl
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,10 @@ variable, then the system is not Index 1!

function DiffEqBase.initialize_dae!(integrator::ODEIntegrator,
initializealg = integrator.initializealg)
if !hasmethod(_initialize_dae!, (Any, typeof(integrator.sol.prob),
BrownFullBasicInit, Val))
error("This ODE requires a DAE initialization and thus a nonlinear solve but no nonlinear solve has been loaded. To solve this problem, do `using OrdinaryDiffEqNonlinearSolve` or pass a custom `nlsolve` choice into the `initializealg`.")
if !hasmethod(_initialize_dae!, (typeof(integrator),
typeof(integrator.sol.prob), BrownFullBasicInit,
Val{DiffEqBase.isinplace(integrator.sol.prob)}))
error("This ODE requires a DAE initialization and thus a nonlinear solve but no nonlinear solve has been loaded. To solve this problem, do `using OrdinaryDiffEqNonlinearSolve` or pass a custom `nlsolve` choice into the `initializealg`.")
end
_initialize_dae!(integrator, integrator.sol.prob,
initializealg,
Expand Down

0 comments on commit 6a8547e

Please sign in to comment.