-
Notifications
You must be signed in to change notification settings - Fork 37
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
Add more global time step control #1159
Conversation
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, definitely will be useful for me in a couple of places downstream. Just a few questions below that are non-blocking.
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
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.
This is a great improvement! Have definitely felt the lack of these features more than once before. Can we make sure to add to the changelog? Also would be good to have these in the docs for reference.
Done. I took the opportunity to also alphabetize the parameters. |
Nice! |
PR Summary
This was originally in a downstream PR, but some functionality was not available, so I've moved it upstream.
This adds some extra timestep controllers that are not package / meshblock / processor dependent.
dt_min
: ifdt <= dt_min
fordt_min_count_max
cycles, thenPARTHENON_FAIL
. Defaults to 10 bad cycles in a row.dt_max
: ifdt >= dt_max
, fordt_max_count_max
cycles, thenPARTHENON_FAIL
. Defaults to 1 bad cycle in a row.dt_user
: user settable timestep suggestion (dt = min(dt, dt_user)
)dt_force
: Force the timestep todt_force
regardless of other controllersdt_init
: Set the first timestep to this value but allow it to be smaller if it wants to be. To force this value, the user can setdt_init_force = true
.dt_floor
: setsdt = std::max(dt , dt_floor)
dt_ceil
: setsdt = std::min(dt, dt_ceil)
dt_factor
:dt / dt_previous <= dt_factor
. Previously, this was hard coded to 2.The main purpose of
dt_min
anddt_max
is to stop simulations from going off the rails and cycling on1e-20
timesteps or blowing up.All of these options are "off" by default.
I have tested all options in a downstream code.
PR Checklist