-
Notifications
You must be signed in to change notification settings - Fork 213
Infrastructure tweaks to support error-measure based stepping #2841
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
Infrastructure tweaks to support error-measure based stepping #2841
Conversation
c47767a to
6dd8c58
Compare
|
Removed a small part that better fits in a different PR. |
dc11cc0 to
1ff9fbd
Compare
|
I've dropped the step controller change, and added a fixup for the step chooser documentation. |
wthrowe
left a comment
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.
I'm having trouble quickly getting the history management working in a way compatible with both this and dense output, so let's go with this form so we're not blocking you and I'll change it for dense output later.
| ASSERT(history.size() <= order_, | ||
| ASSERT(history.size() <= order_ + 1, | ||
| "Length of history (" << history.size() << ") " | ||
| << "should not exceed target order (" << order_ << ")"); | ||
| << "should not exceed target order (" << order_ << ") by more than 1"); |
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.
What is this change about?
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.
Ah, yeah good catch -- these couple of lines of the hunk should be dropped. It was for an earlier and less elegant attempt at the history cleanup change.
| for (uint64_t i = 0; i < num_steps; ++i) { | ||
| take_step(&time, &y, &history, stepper, rhs, step_size); | ||
| // last parameter: check that we can apply the stepper sometime in the | ||
| // middle of the evolution without messing anything up. |
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.
"apply the stepper twice", maybe? Again later.
1ff9fbd to
efe1fd8
Compare
|
Dropped the part of the hunk that shouldn't have been present, added a fixup for the comment change, and removed the |
|
Looks good. Squash. |
efe1fd8 to
b676e69
Compare
|
Squashed. |
nilsvu
left a comment
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, though I'm by no means an expert in time-stepping :)
| /// a strictly smaller step, guided by the requested time step value. | ||
| template <typename Metavariables, typename DbTags> | ||
| double desired_step( | ||
| std::pair<double, bool> desired_step( |
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.
Would it be reasonable to make the return value here a std::optional<double>, meaning either "do a step with this size" or "don't do a step"? So the question is: Will the "desired step" double be used also when the "acceptance" bool is false? If this is what you mean with "guided by the requested time step value", please clarify, e.g. by rewording to "... the desired step value returned by this function".
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.
The return value is used when the step is rejected to choose the step size when retrying the step; it is assumed that when the step is rejected the returned step size is strictly smaller than the previously tried step. I'll clarify the documentation.
b676e69 to
c3fc226
Compare
|
Squashed in documentation rewording. |
|
@wthrowe could you take another look at this? |
|
Also, @nilsleiffischer, please give me some time to respond to things before pinging me. I find it annoying. |
|
@wthrowe Would it be too much hassle for you to split out the commit that does the history clean-up at the start of the step to a different PR? Then that could be a dependency of both this (with my history clean up change dropped) and your larger PR that makes the self-start changes |
|
I don't need the update_u changes. I think I just took them to avoid some git conflict. I do use "Add order function to You are correct that I haven't done the substep methods, but redoing a substep probably isn't useful anyway. (And redoing a full step is a different challenge.) Substep methods will need to be converted eventually for dense output. Submitted as #2894. |
- necessary to support the error measure update as a `Variables` with a different tag prefix
This is needed for step-unwinding. This adjusts the interface by consistently using the latest volume data in the history instead of using the current `u` value in some steppers
c3fc226 to
358fb06
Compare
|
rebased following merge of #2894, and dropped the history cleanup parts. |
Proposed changes
Various small changes to time steppers, step choosers, and step controllers that preserve existing functionality, but allow the possibility of an iterative process to support step rejection and retry.
Code review checklist
make docto generate the documentation locally intoBUILD_DIR/docs/html.Then open
index.html.code review guide.
bugfixormajor new featureif appropriate.