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

Added coupling between pySDC and Gusto #516

Merged
merged 7 commits into from
Jan 24, 2025

Conversation

brownbaerchen
Copy link
Contributor

This enables to use pySDC as a time discretisation method within Gusto, or to setup a geophysical problem in Gusto and then run it in pySDC.
The intended use is to take a script running a Gusto problem, setup the Gusto timestepper with the pySDC integrator and then either just use that in normal Gusto fashion, or extract the controller from the pySDC integrator and run in pySDC.

Added in this PR

  • helper that inherits from the Gusto base time discretisation and sets up a pySDC controller that can then be used on it's own or called from Gusto during the time stepping
  • generic Gusto problem class that accepts a Gusto equation or a Gusto residual and assembles nonlinear variational problems to be solved for evaluating the right hand side or doing an Euler step
  • IMEX version of generic gusto problem class
  • Tutorial on running Williamson 5 (flow over mountain) using pySDC within Gusto, includes plotting script taken almost unmodified from the Gusto repository. Script includes infrastructure for MPI parallel diagonal SDC.
  • Appended the tutorial README to include this and the Firedrake coupling.

Tests

  • Test for using the generic Gusto problem class without upwinding and without the accompanying setup in the timestepper
  • Test that various RK methods and (IMEX) SDC give the same result between the Gusto and pySDC implementations
  • Test for adaptive step size selection within the coupling: First the problem is run adaptively using pySDC, then the same sequence of steps is solved in Gusto.
  • Test for the tutorial that after a few steps the results between Gusto and pySDC SDC implementations match

Caveats

  • Gusto is not compatible with the most recent version of Firedrake. While it is being fixed, we have to limit the CI pipeline to use the last compatible version of Firedrake at the moment. Please let us know when we can revert to the most current version, @jshipton.
  • Gusto is not currently built for adaptive step size selection and the current implementation for this in the coupling is very hacky.

field_name=None,
subcycling_options=None,
solver_parameters=None,
limiter=None,
Copy link
Contributor

Choose a reason for hiding this comment

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

I think that not all of these options work from pySDC, e.g. the limiter... probably the sub cycling options aren't used and probably not the augmentation either... would it be better to remove them from the interface and docs?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You're right! I removed those three parameters. I am not sure about the options. Seems to me like it might work when using Gusto for time integration because it adds a wrapper, but I don't actually know.

dtype_f = IMEX_firedrake_mesh
rhs_n_labels = 2

def evaluate_individual_term(self, u, label):
Copy link
Contributor

Choose a reason for hiding this comment

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

slightly picky... but label might apply to more than one term so not sure "individual" is the right word

Copy link
Contributor

@jshipton jshipton left a comment

Choose a reason for hiding this comment

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

This looks like a very thorough job to me @brownbaerchen ! I've checked all the Gusto residual manipulation and agree with what you've done, and it's all very comprehensively tested. Great work!

@pancetta pancetta merged commit 913463d into Parallel-in-Time:master Jan 24, 2025
87 checks passed
@brownbaerchen brownbaerchen deleted the gusto_coupling branch January 24, 2025 09:29
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.

3 participants