Skip to content

Rayleigh-Benard demo using Irksome and patch smoothing #4319

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

Closed
wants to merge 49 commits into from

Conversation

rckirby
Copy link
Contributor

@rckirby rckirby commented May 14, 2025

Description

Add a demo using Irksome for a time-dependent Rayleigh-Benard convection problem. We use a monolithic multigrid scheme with Vanka patch relaxation for the time stepping.

connorjward and others added 15 commits April 29, 2025 14:33
* Post-release updates

* Set source ref in workflows
* Make linkcheck not prevent later steps

* Set AIMS as a flaky link
…didate

Merge release changes into master
* Interpolation onto subfunctions

* More generic approach using fieldsplit

* Interpolate: Fix parloop args ordering

* Fix dual

* Interpolate from MixedFunctionSpace

* Test Interpolate from vector/mixed to mixed

* Interpolate from (scalar/mixed) to (scalar/mixed)

Co-authored-by: Pablo Brubeck <[email protected]>

---------

Co-authored-by: David A. Ham <[email protected]>
@rckirby rckirby requested a review from pbrubeck May 14, 2025 10:45
@rckirby rckirby requested review from ScottMacLachlan and dham May 14, 2025 11:08
@dham dham marked this pull request as ready for review May 14, 2025 12:04
Comment on lines 25 to 28
except ImportError:
import sys
warning("Unable to import irksome.")
sys.exit(0)
Copy link
Contributor

Choose a reason for hiding this comment

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

Rather than do this I would just include a bit like: "This tutorial assumes that you have Irksome installed as well as Firedrake. Instructions for installing Irksome can be found ."

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is how the netgen tutorial is written. But, to make sure the demo runs in our CI, we'll either need to fail gracefully (without an exception) or put Irksome in our CI.

Copy link
Member

Choose a reason for hiding this comment

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

We definitely need irksome in CI for this to land.

rckirby and others added 4 commits May 17, 2025 09:37
Ensure that restoring a BC from checkpoint returns a new BC and doesn't incorrectly modify the program variable BC.

---------

Co-authored-by: David A. Ham <[email protected]>
Co-authored-by: Pablo Brubeck <[email protected]>
Comment on lines 25 to 28
except ImportError:
import sys
warning("Unable to import irksome.")
sys.exit(0)
Copy link
Member

Choose a reason for hiding this comment

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

We definitely need irksome in CI for this to land.

Ts = []
cur_step = 0
while float(t) < 1.0:
print(f"t = {float(t)}")
Copy link
Member

Choose a reason for hiding this comment

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

If I had intended you to put print statements in time loops, I would never have given you ProgressBar

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This will be the only firedrake demo with a progress bar, FYI.

Ts.append(upT.subfunctions[2].copy(deepcopy=True))


nsp = 16
Copy link
Member

Choose a reason for hiding this comment

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

Why is the plotting in the time loop code block? This looks quite odd on the rendered version.

try:
animation.save("benard_temp.mp4", writer="ffmpeg")
except:
print("Failed to write movie! Try installing `ffmpeg`.")
Copy link
Member

Choose a reason for hiding this comment

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

missing link to Python version of demo.

@@ -0,0 +1,269 @@
Steady Boussinesq problem with integral constraints
Copy link
Member

Choose a reason for hiding this comment

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

Please don't also attempt to re-merge the Boussinesq demo.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have absolutely no idea how this got here, or why I now have so many changed files after merging.

Comment on lines 166 to 167


Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
The last step is to make the animation and save it to a file. ::

@rckirby
Copy link
Contributor Author

rckirby commented May 27, 2025

Something has gone dreadfully wrong on merging...I'm going to close this and start again.

@rckirby rckirby closed this May 27, 2025
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.

10 participants