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

Fix NonHydrostaticTimeIntegrator2D for projection of solutions with adaptivity #374

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

stephankramer
Copy link
Contributor

The advance method of a timeintegrator should always advance from the solved-for-fields, which are the same fields that will contain the solution at the end of the timestep after calling advance(). This is because this is the only field(s) that the "user" of a time integrator has control over, and the user may want to adjust/overwrite/project (for adaptivity) at the end of a timestep and expect the timestepper to advance from the adjusted values in the next timestep.

Thus, if a time-integrator stores some copy of a "solution_old" it should be set at the beginning of advance() to the current solution, rather than at the end.

…daptivity

The advance method of a timeintegrator should always advance from the
solved-for-fields, which are the same fields that will contain the
solution at the end of the timestep _after_ calling advance(). This is
because this is the only field(s) that the "user" of a time integrator
has control over, and the user may want to adjust/overwrite/project (for
adaptivity) at the end of a timestep and expect the timestepper to
advance from the adjusted values in the next timestep.

Thus, if a time-integrator stores some copy of a "solution_old" it
should be set at the _beginning_ of advance() to the current solution,
rather than at the end.
Copy link
Contributor

@cpjordan cpjordan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This update ensures that elev_old should reflect any updates that the user makes to elev_2d between timesteps. Makes sense for adaptivity purposes and shouldn't impact otherwise as verified by running one of the non-hydrostatic examples. Looks good to me!

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