Hipace
|
Wrapper around multiple FFT libraries. More...
Classes | |
struct | FFTplan |
This struct contains the vendor FFT plan and additional metadata. More... | |
Typedefs | |
using | Complex = fftw_complex |
using | VendorFFTPlan = fftw_plan |
using | FFTplans = amrex::LayoutData< FFTplan > |
Enumerations | |
enum class | direction { R2C , C2R } |
Functions | |
FFTplan | CreatePlan (const amrex::IntVect &real_size, amrex::Real *const real_array, Complex *const complex_array, const direction dir) |
create FFT plan for the backend FFT library. More... | |
void | DestroyPlan (FFTplan &fft_plan) |
Destroy library FFT plan. More... | |
void | Execute (FFTplan &fft_plan) |
Perform FFT with backend library. More... | |
Variables | |
cufftType | VendorR2C = CUFFT_D2Z |
cufftType | VendorC2R = CUFFT_Z2D |
const auto | VendorCreatePlanR2C3D = fftw_plan_dft_r2c_3d |
const auto | VendorCreatePlanC2R3D = fftw_plan_dft_c2r_3d |
const auto | VendorCreatePlanR2C2D = fftw_plan_dft_r2c_2d |
const auto | VendorCreatePlanC2R2D = fftw_plan_dft_c2r_2d |
Wrapper around multiple FFT libraries.
The header file defines the API and the base types (Complex and VendorFFTPlan), and the implementation for different FFT libraries is done in different cpp files. This wrapper only depends on the underlying FFT library AND on AMReX (There is no dependence on WarpX).
using AnyFFT::Complex = typedef fftw_complex |
Complex type for FFT, depends on FFT library
using AnyFFT::FFTplans = typedef amrex::LayoutData<FFTplan> |
Collection of FFT plans, one FFTplan per box
using AnyFFT::VendorFFTPlan = typedef fftw_plan |
Library-dependent FFT plans type, which holds one fft plan per box (plans are only initialized for the boxes that are owned by the local MPI rank).
|
strong |
Direction in which the FFT is performed.
Enumerator | |
---|---|
R2C | |
C2R |
FFTplan AnyFFT::CreatePlan | ( | const amrex::IntVect & | real_size, |
amrex::Real *const | real_array, | ||
Complex *const | complex_array, | ||
const direction | dir | ||
) |
create FFT plan for the backend FFT library.
[in] | real_size | Size of the real array, along each dimension. |
[out] | real_array | Real array from/to where R2C/C2R FFT is performed |
[out] | complex_array | Complex array to/from where R2C/C2R FFT is performed |
[in] | dir | direction, either R2C or C2R |
void AnyFFT::DestroyPlan | ( | FFTplan & | fft_plan | ) |
Destroy library FFT plan.
[out] | fft_plan | plan to destroy |
void AnyFFT::Execute | ( | FFTplan & | fft_plan | ) |
Perform FFT with backend library.
[out] | fft_plan | plan for which the FFT is performed |
cufftType AnyFFT::VendorC2R = CUFFT_Z2D |
const auto AnyFFT::VendorCreatePlanC2R2D = fftw_plan_dft_c2r_2d |
const auto AnyFFT::VendorCreatePlanC2R3D = fftw_plan_dft_c2r_3d |
const auto AnyFFT::VendorCreatePlanR2C2D = fftw_plan_dft_r2c_2d |
const auto AnyFFT::VendorCreatePlanR2C3D = fftw_plan_dft_r2c_3d |
cufftType AnyFFT::VendorR2C = CUFFT_D2Z |