Skip to content

Commit 4479f54

Browse files
Update solve.jl
1 parent b25f500 commit 4479f54

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/solve.jl

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
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+
15
function DiffEqBase.__solve(jump_prob::DiffEqBase.AbstractJumpProblem{P},
26
alg::DiffEqBase.DEAlgorithm;
37
kwargs...) where {P}
4-
integrator = DiffEqBase.__init(jump_prob, alg; kwargs...)
8+
integrator = DiffEqBase.__init(jump_prob, alg, ForceJumpDispatch(); kwargs...)
59
solve!(integrator)
610
integrator.sol
711
end
@@ -18,7 +22,7 @@ function DiffEqBase.__solve(jump_prob::DiffEqBase.AbstractJumpProblem; kwargs...
1822
end
1923

2024
function DiffEqBase.__init(_jump_prob::DiffEqBase.AbstractJumpProblem{P},
21-
alg::DiffEqBase.DEAlgorithm;
25+
alg::DiffEqBase.DEAlgorithm, disp::ForceJumpDispatch = ForceJumpDispatch();
2226
callback = nothing, seed = nothing,
2327
alias_jump = Threads.threadid() == 1,
2428
kwargs...) where {P}

0 commit comments

Comments
 (0)