|
| 1 | +.. role:: cpp(code) |
| 2 | + :language: c++ |
| 3 | + |
| 4 | +.. role:: fortran(code) |
| 5 | + :language: fortran |
| 6 | + |
| 7 | +.. _tutorials_heffte: |
| 8 | + |
| 9 | +heFFTe |
| 10 | +========================== |
| 11 | + |
| 12 | +These tutorials demonstrate how to heFFTe to solve for and manipulate Fourier transform data using multiple MPI ranks/GPUs. |
| 13 | + |
| 14 | +There are two heFFTe tutorials, ``Basic`` and ``Poisson``: |
| 15 | + |
| 16 | +- ``Basic`` tutorial: The tutorial found in ``amrex-tutorials/ExampleCodes/heFFTe/Basic`` is |
| 17 | + useful if the objective is to simply take a forward FFT of data, and the DFT's ordering in k-space |
| 18 | + matters to the user. This tutorial initializes a 3D or 2D :cpp:`MultiFab`, takes a forward FFT, |
| 19 | + and then redistributes the data in k-space where the center cell in the domain corresponds to the k=0 mode. |
| 20 | + The results are written to a plot file. |
| 21 | + |
| 22 | +- ``Poisson`` tutorial: This tutorial: ``amrex-tutorials/ExampleCodes/heFFTe/Poisson`` |
| 23 | + solves a Poisson equation with periodic boundary conditions. In it, both a forward FFT and reverse FFT |
| 24 | + are called to solve the equation, however, no reordering of the DFT data in k-space is performed. |
| 25 | + |
| 26 | +We note that both backends, fftw and cufft, assume a row-major ordering of data; since a :cpp:`MultiFab` is column major, |
| 27 | +the output to the spectral array is spatially-transposed. |
| 28 | + |
| 29 | +.. toctree:: |
| 30 | + :maxdepth: 1 |
| 31 | + |
| 32 | +.. _section:heffte_tutorial:heffte_basic: |
| 33 | + |
| 34 | +Basic |
| 35 | +-------------------------- |
| 36 | + |
| 37 | +This tutorial initializes a 3D or 2D :cpp:`MultiFab`, takes a forward FFT, |
| 38 | +and then redistributes the data in k-space where the center cell in the domain corresponds to the k=0 mode. |
| 39 | +The results are written to a plot file. |
| 40 | + |
| 41 | +.. _section:heffte_tutorial:heffte_pois: |
| 42 | + |
| 43 | +Poisson |
| 44 | +-------------------------- |
| 45 | + |
| 46 | +In this test case we set up a right hand side (rhs), call the forward transform, |
| 47 | +modify the coefficients, then call the backward solver and output the solution |
| 48 | +to the discrete Poisson equation. |
0 commit comments