Skip to content

Commit

Permalink
remove unnecessary part in callback condition (#53)
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshuaLampert authored May 29, 2024
1 parent 1345714 commit b3671ba
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions src/callbacks_step/alive.jl
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,7 @@ function (alive_callback::AliveCallback)(u, t, integrator)
# (total #steps) (#accepted steps)
# We need to check the number of accepted steps since callbacks are not
# activated after a rejected step.
return interval_or_dt > 0 && (((integrator.stats.naccept % interval_or_dt == 0) &&
!(integrator.stats.naccept == 0 && integrator.iter > 0)))
return interval_or_dt > 0 && (integrator.stats.naccept % interval_or_dt == 0)
end

# this method is called when the callback is activated
Expand Down
3 changes: 1 addition & 2 deletions src/callbacks_step/save_solution.jl
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,7 @@ function (solution_callback::SaveSolutionCallback)(u, t, integrator)
# (total #steps) (#accepted steps)
# We need to check the number of accepted steps since callbacks are not
# activated after a rejected step.
return interval_or_dt > 0 && (((integrator.stats.naccept % interval_or_dt == 0) &&
!(integrator.stats.naccept == 0 && integrator.iter > 0)) ||
return interval_or_dt > 0 && (integrator.stats.naccept % interval_or_dt == 0 ||
(save_final_solution && isfinished(integrator)))
end

Expand Down

0 comments on commit b3671ba

Please sign in to comment.