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

Lengthen the last subcycle timestep to avoid very small dt #701

Merged
merged 5 commits into from
Nov 30, 2019

Conversation

maximumcats
Copy link
Member

PR summary

Due to roundoff issues, it is possible for the current algorithm to divide the main timestep into N smaller dt's that, when summed up, so not exactly equal the desired target time. We already have protection against the case where the final time is slightly larger than the target time (in which case
we shortened that timestep) but we had no protection against the case where we would end up slightly short of the target time, in which case we'd have to take a very short last timestep. This PR resolves that issue by making that last timestep slightly longer.

PR checklist

  • test suite needs to be run on this PR
  • this PR will change answers in the test suite
  • all functions have docstrings as per the coding conventions
  • the CHANGES file has been updated
  • if appropriate, this change is described in the docs

Due to roundoff issues, it is possible for the current algorithm to divide
the main timestep into N smaller dt's that, when summed up, so not exactly
equal the desired target time. We already have protection against the case
where the final time is slightly larger than the target time (in which case
we shortened that timestep) but we had no protection against the case where
we would end up slightly short of the target time, in which case we'd have
to take a very short last timestep. This PR resolves that issue by making
that last timestep slightly longer.
@zingale zingale merged commit 4578cf1 into development Nov 30, 2019
@zingale zingale deleted the harden_retry_dt branch November 30, 2019 01:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants