-
Notifications
You must be signed in to change notification settings - Fork 21
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 driver/callback docs #432
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: Mike Campbell <[email protected]>
doc/support/drivers.rst
Outdated
@@ -0,0 +1,68 @@ | |||
Writing drivers for :mod:`mirgecom` | |||
============================================== |
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.
Trim this a bit to align with the text
are able to do with their drivers. This section of the documentation | ||
is designed to introduce the tools, and recommended practices for | ||
designing drivers for :mod:`mirgecom` simulations. | ||
|
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 was wondering if we should add a section about the RHS too, particularly because of make_operator_fluid_states (i.e., we gotta pass the limiter). These two should cover the most important pitfalls concerning limiters.
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 agree that we need better documentation and developer guidance for drivers. It would be my preference to document this and your suggestion in a sort of detailed driver walk-through. For now, maybe it would suffice to something like this:
Consider these snippets from the *RK4* time integrator, and example *rhs* function:
| def rk4_step(state, t, dt, rhs):
| """Take one step using the fourth-order Classical Runge-Kutta method."""
| k1 = rhs(t, state)
| k2 = rhs(t+dt/2, state + dt/2*k1)
| k3 = rhs(t+dt/2, state + dt/2*k2)
| k4 = rhs(t+dt, state + dt*k3)
|
| return state + dt/6*(k1 + 2*k2 + 2*k3 + k4)
| def rhs(t, state):
| """Return the RHS of the conservation system."""
| filtered_state = apply_filter(state)
| return rhs_operator(t, filtered_state)
What I really want in the end is documentation that covers an integrated driver with all of its components and constructs. Would be nice if those docs could be (largely) generated from the specific examples and their inline documentation, but I think we need to restructure the example drivers somewhat in order to easily wedge their docs into the automatic online documentation.
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.
Capisce. There are a few PRs concerning driver updates, so we can put more doc details in those then.
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.
👍
fixes #427