DiffEqBase.jl
DiffEqBase.jl copied to clipboard
Ensure initial tstops are unique
As shown in https://github.com/SciML/DiffEqJump.jl/issues/239, a user might accidentally double include some tstops
when using callbacks. Maybe it would make sense for DiffEqBase.initialize!
to call unique!
on the tstops
?
Or alternatively to give a useful error about double including tstops
.
Shouldn't these cases be handled by the algorithm that pops tstops? Even if the initial tstops are unique callbacks might add tstops that introduce non-uniqueness later during the integration process (this is done eg by the callbacks in DelayDiffEq). It seems safer to ensure that all tstops of (approximately) the same value are removed if a tstop is hit.
Is there a use case for having non-unique initial tstops
or is that always a user setup error?
I'd be willing to put a warning on this. My guess is that there is no valid use case. If there is, we can create an opt-out, but I think there's a 99% chance that any time this happens it's a user setup error.