Skip to content

Commit 0da6851

Browse files
committed
TL: completed tutorial with pySDC-FNO combination
1 parent 396c4ab commit 0da6851

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

pySDC/playgrounds/dedalus/README.md

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Playground to use Dedalus with pySDC
1+
# Playground to use Dedalus with pySDC, and coupling with a Fourier Neural Operator (FNO)
22

33
:scroll: Interface for [Dedalus code](https://dedalus-project.readthedocs.io/en/latest/) so it can be used within the pySDC framework.
44

@@ -133,6 +133,28 @@ while solver.proceed:
133133

134134
A full example script for the 2D Rayleigh-Benard Convection problem can be found [here](./rayleighBenardSDC.py).
135135

136+
## SDC coupled with FNO for initial guess
137+
138+
FNO model trained using Dedalus (or pySDC) generated data can be used to compute the initial guess for SDC sweep.
139+
140+
This requires the installation of the [`cfno`](https://github.com/Parallel-in-Time/cfno/tree/tibo) package,
141+
and here is a template example for its usage :
142+
143+
```python
144+
from pySDC.playgrounds.dedalus.sdc import SpectralDeferredCorrectionIMEX
145+
146+
checkpoint = "path/to/checkpoint.pt"
147+
SpectralDeferredCorrectionIMEX.setupNN(
148+
"FNOP-2", checkpoint=checkpoint, initSweep="NN")
149+
150+
# Build Dedalus problem and give additional SDC settings ...
151+
```
152+
153+
Some FNO-based sweepers are also available for `pySDC` and currently stored in the `cfno` package,
154+
see [cfno.simulation.sweeper](https://github.com/Parallel-in-Time/cfno/blob/tibo/cfno/simulation/sweeper.py).
155+
Those consists on two classes, `FNO_IMEX` and `FNO_IMEX_PINT`,
156+
allowing to run IMEX-SDC with any kind of problem implemented in `pySDC` and adapted to those type of sweeper.
157+
136158
## Time-parallel SDC time-integrator for Dedalus
137159

138160
Two MPI implementations of SDC time-integrators for

0 commit comments

Comments
 (0)