-
Notifications
You must be signed in to change notification settings - Fork 191
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
Handle substeps in LTS error control #5943
Handle substeps in LTS error control #5943
Conversation
48a9273
to
7d2aede
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, a couple minor suggestions you can squash immediately
#include "Time/Time.hpp" | ||
|
||
template <typename T> | ||
struct StepperErrorEstimate { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please add doxygen documentation to this?
src/Time/StepperErrorEstimate.hpp
Outdated
size_t order{}; | ||
T error{}; | ||
|
||
void pup(PUP::er& p) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move out of line?
7d2aede
to
b9a0a4a
Compare
Done. Also changed the initializer for |
// won't improve the reported error, so make sure to only do it | ||
// if we actually request a smaller step. | ||
return std::make_pair(new_step, | ||
new_step >= previous_step or l_inf_error <= 1.0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wait, this is backwards.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, no, it's the right way, but it does need an abs
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pushed a fixup for this and updated the test so it would have been caught.
And added a small commit fixing a preexisting bug in the test. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Please go ahead and squash!
Aside from cleanup, the main effect of this change is that the ErrorControl stepper now always uses the most recent error estimate, where it used to only activate if that estimate was from the most recent evaluation. The only case where that matters is for LTS updating with a multistage method, which used to not work and now uses the error estimates from the previous two steps, as opposed to the current and previous step for single-stage LTS. This matches the behavior for GTS adjustment, so should be acceptable for now.
It's not valid for any TimeStepper, so move logic to the calling code instead of the steppers.
Preparation for adding LTS substep methods.
Proposed changes
Upgrade instructions
Code review checklist
make doc
to generate the documentation locally intoBUILD_DIR/docs/html
.Then open
index.html
.code review guide.
bugfix
ornew feature
if appropriate.Further comments