Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unnecessary part in callback condition #53

Merged
merged 1 commit into from
May 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading