Hipace
Classes | Typedefs | Enumerations | Functions | Variables
AnyFFT Namespace Reference

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
 

Detailed Description

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).

Typedef Documentation

◆ Complex

using AnyFFT::Complex = typedef fftw_complex

Complex type for FFT, depends on FFT library

◆ FFTplans

Collection of FFT plans, one FFTplan per box

◆ VendorFFTPlan

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).

Enumeration Type Documentation

◆ direction

enum AnyFFT::direction
strong

Direction in which the FFT is performed.

Enumerator
R2C 
C2R 

Function Documentation

◆ CreatePlan()

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.

Parameters
[in]real_sizeSize of the real array, along each dimension.
[out]real_arrayReal array from/to where R2C/C2R FFT is performed
[out]complex_arrayComplex array to/from where R2C/C2R FFT is performed
[in]dirdirection, either R2C or C2R

◆ DestroyPlan()

void AnyFFT::DestroyPlan ( FFTplan fft_plan)

Destroy library FFT plan.

Parameters
[out]fft_planplan to destroy

◆ Execute()

void AnyFFT::Execute ( FFTplan fft_plan)

Perform FFT with backend library.

Parameters
[out]fft_planplan for which the FFT is performed

Variable Documentation

◆ VendorC2R

cufftType AnyFFT::VendorC2R = CUFFT_Z2D

◆ VendorCreatePlanC2R2D

const auto AnyFFT::VendorCreatePlanC2R2D = fftw_plan_dft_c2r_2d

◆ VendorCreatePlanC2R3D

const auto AnyFFT::VendorCreatePlanC2R3D = fftw_plan_dft_c2r_3d

◆ VendorCreatePlanR2C2D

const auto AnyFFT::VendorCreatePlanR2C2D = fftw_plan_dft_r2c_2d

◆ VendorCreatePlanR2C3D

const auto AnyFFT::VendorCreatePlanR2C3D = fftw_plan_dft_r2c_3d

◆ VendorR2C

cufftType AnyFFT::VendorR2C = CUFFT_D2Z