1- # Used to ensure that this jump dispatch is preferred over the DiffEq solver
2- # when the solver (i.e. StochasticDiffEq.jl) allows for jumps in __init
3- struct ForceJumpDispatch end
4-
5-
6-
71function DiffEqBase. __solve (jump_prob:: DiffEqBase.AbstractJumpProblem{P} ,
82 alg:: DiffEqBase.DEAlgorithm ;
93 kwargs... ) where {P}
10- integrator = DiffEqBase . __init (jump_prob, alg, ForceJumpDispatch () ; kwargs... )
4+ integrator = __jump_init (jump_prob, alg; kwargs... )
115 solve! (integrator)
126 integrator. sol
137end
1610function DiffEqBase. __solve (jump_prob:: DiffEqBase.AbstractJumpProblem{P} ,
1711 alg:: Union{SciMLBase.AbstractRODEAlgorithm, SciMLBase.AbstractSDEAlgorithm} ;
1812 kwargs... ) where {P}
19- integrator = DiffEqBase . __init (jump_prob, alg, ForceJumpDispatch () ; kwargs... )
13+ integrator = __jump_init (jump_prob, alg; kwargs... )
2014 solve! (integrator)
2115 integrator. sol
2216end
@@ -33,8 +27,11 @@ function DiffEqBase.__solve(jump_prob::DiffEqBase.AbstractJumpProblem; kwargs...
3327end
3428
3529function DiffEqBase. __init (_jump_prob:: DiffEqBase.AbstractJumpProblem{P} ,
36- alg:: Union{SciMLBase.AbstractRODEAlgorithm, SciMLBase.AbstractSDEAlgorithm, DiffEqBase.DEAlgorithm} ,
37- disp:: ForceJumpDispatch = ForceJumpDispatch ();
30+ alg:: DiffEqBase.DEAlgorithm ; kwargs... )
31+ __jump_init (_jump_prob, alg; kwargs... )
32+ end
33+
34+ function __jump_init (_jump_prob:: DiffEqBase.AbstractJumpProblem{P} , alg;
3835 callback = nothing , seed = nothing ,
3936 alias_jump = Threads. threadid () == 1 ,
4037 kwargs... ) where {P}
0 commit comments