DifferentialEquations.jl
DifferentialEquations.jl copied to clipboard
Terminate should halt the addition of new tstops
https://discourse.julialang.org/t/simulating-a-stopping-time-in-sde-without-using-a-fixed-time-span/45608/4 brings up an interesting issue that goes as follows. terminate! works by removing all current tstops to then cause the integration to leave. But if someone does terminate! and then add_tstops! inside of the same callback, most likely by accident, which then causes the integration to not terminate. SSAStepper accidentally works there because it completely exits the method immediately, which doesn't allow for this issue to happen, but most other integrators will have this issue. We can fix this by just having add_tstops! check a bool isterminated before adding more.