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

Add driver/callback docs #432

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
Open

Add driver/callback docs #432

wants to merge 14 commits into from

Conversation

MTCam
Copy link
Member

@MTCam MTCam commented Jul 13, 2021

fixes #427

doc/support/drivers.rst Outdated Show resolved Hide resolved
doc/support/drivers.rst Outdated Show resolved Hide resolved
@tulioricci tulioricci added the documentation Improvements or additions to documentation label Jan 8, 2024
@MTCam MTCam marked this pull request as ready for review January 8, 2024 19:44
@MTCam MTCam requested a review from tulioricci January 8, 2024 19:45
@@ -0,0 +1,68 @@
Writing drivers for :mod:`mirgecom`
==============================================
Copy link
Collaborator

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.

Copy link
Collaborator

@tulioricci tulioricci Jan 8, 2024

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.

Copy link
Member Author

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.

Copy link
Collaborator

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.

Copy link
Collaborator

@tulioricci tulioricci left a comment

Choose a reason for hiding this comment

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

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Missing documentation on callbacks
2 participants