Both integrator.success_iter and integrator.destats.naccept seem to contain the number of accepted steps/iterations - as far as I understand from their names and implementations. However, there is a subtly but important difference when trying to use them in, say, custom callbacks.
Thus, integrator.success_iter == integrator.destats.naccept - 1 at the end of the integration and whenever callbacks are called. If all steps are accepted, integrator.success_iter == integrator.iter - 1.
My questions are
Is there a reason for this different behavior of integrator.success_iter and integrator.destats.naccept?
If not: Can we get rid of integrator.success_iter or change it's behavior such that it mimics integrator.destats.naccept?
Both
integrator.success_iter
andintegrator.destats.naccept
seem to contain the number of accepted steps/iterations - as far as I understand from their names and implementations. However, there is a subtly but important difference when trying to use them in, say, custom callbacks.integrator.success_iter
is updated inloopheader!
, see https://github.com/SciML/OrdinaryDiffEq.jl/blob/cdc5ef291d37f31ce7746e9f27aeeeae5d806393/src/integrators/integrator_utils.jl#L10integrator.destats.naccept
is updated inloopheader!
, see https://github.com/SciML/OrdinaryDiffEq.jl/blob/cdc5ef291d37f31ce7746e9f27aeeeae5d806393/src/integrators/integrator_utils.jl#L192 and https://github.com/SciML/OrdinaryDiffEq.jl/blob/cdc5ef291d37f31ce7746e9f27aeeeae5d806393/src/integrators/integrator_utils.jl#L209Thus,
integrator.success_iter == integrator.destats.naccept - 1
at the end of the integration and whenever callbacks are called. If all steps are accepted,integrator.success_iter == integrator.iter - 1
.My questions are
integrator.success_iter
andintegrator.destats.naccept
?integrator.success_iter
or change it's behavior such that it mimicsintegrator.destats.naccept
?