template<typename T, FFT::Direction D = FFT::Direction::both, int M = AMREX_SPACEDIM>
class amrex::FFT::LocalR2C< T, D, M >
Local Discrete Fourier Transform.
This class supports Fourier transforms between real and complex data. The name R2C indicates that the forward transform converts real data to complex data, while the backward transform converts complex data to real data. It should be noted that both directions of transformation are supported, not just from real to complex. The scaling follows the FFTW convention, where applying the forward transform followed by the backward transform scales the original data by the size of the input array.
For more details, we refer the users to https://amrex-codes.github.io/amrex/docs_html/FFT_Chapter.html.
template<typename T , FFT::Direction D, int M>
Constructor.
Given the diverse interfaces of FFT libraries we use, this constructo has a number of optional arguments.
The user can provide the data pointers to the constructor. They are only needed by FFTW because its plan creation requires the input and output arrays. If they are null, we will delay the plan creation for FFTW until the forward or backward function is called.
The cache_plan option is only used when we use cufft, rocfft and onemkl, but not FFTW.
- Parameters
-
fft_size | The forward domain size (i.e., the domain of the real data) |
p_fwd | Forward domain data pointer (optional) |
p_bwd | Backward domain data pointer (optional) |
cache_plan | Try to cache the plan or not (optionl) |
template<typename T , FFT::Direction D, int M>
template<Direction DIR, std::enable_if_t< DIR==Direction::backward||DIR==Direction::both, int > >
Backward transform.
This function is not available when this class template is instantiated for forward-only transform. For GPUs, this function is synchronous on the host.
- Parameters
-
indata | input data |
outdata | output data |
template<typename T , FFT::Direction D, int M>
template<Direction DIR, std::enable_if_t< DIR==Direction::forward||DIR==Direction::both, int > >
Forward transform.
This function is not available when this class template is instantiated for backward-only transform. For GPUs, this function is synchronous on the host.
- Parameters
-
indata | input data |
outdata | output data |