Draft: restore BDF step size after tstop truncation#2
Draft
dpastoor wants to merge 1 commit into
Draft
Conversation
d8f8b19 to
23137c0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
set_stop_timetruncates a step to land exactly ontstop.TstopReachedis returned, rescale the BDF difference history back to the pre-truncation step size so the truncated stop interval does not become the next proposed step size.Why draft
This preserves the documented
TstopReachedbehavior thatstate.t == tstop, but it changes the meaning ofstate.himmediately after a stop: afterTstopReached,state.his the restored proposed next step size rather than the just-used truncated interval. That may be the right behavior for checkpoint/restart, but it is worth maintainer review before treating this as the final API contract.This branch is independent of #1. It intentionally does not include the
n_equal_stepscheckpoint-state change.Reproducer
Command:
Output from this branch:
The
set_stop_timerow remains above the single sweep because this branch does not include #1. The key behavior tested here is that stop-time truncation no longer pins the checkpointed/proposed step size to the dense output spacing.Tests
cargo test -p diffsol bdf_tstop_restores_pre_truncation_step_size -- --nocapturecargo test -p diffsol test_tstop_bdf -- --nocapturecargo check -p diffsol --examplescargo run -p diffsol --example bdf_tstop_reproducer