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

Classes

struct  FFTplan
 

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, const int dim)
 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...
 
std::string cufftErrorToString (const cufftResult &err)
 This method converts a cufftResult into the corresponding string. More...
 
std::string rocfftErrorToString (const rocfft_status err)
 This method converts a rocfftResult into the corresponding string. 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 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,
const int  dim 
)

create FFT plan for the backend FFT library.

Parameters
[in]real_sizeSize of the real array, along each dimension. Only the first dim elements are used.
[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
[in]dimdirection, number of dimensions of the arrays. Must be <= AMREX_SPACEDIM.

◆ cufftErrorToString()

std::string AnyFFT::cufftErrorToString ( const cufftResult &  err)

This method converts a cufftResult into the corresponding string.

Parameters
[in]erra cufftResult
Returns
an std::string

◆ 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

◆ rocfftErrorToString()

std::string AnyFFT::rocfftErrorToString ( const rocfft_status  err)

This method converts a rocfftResult into the corresponding string.

Parameters
[in]erra rocfftResult
Returns
an std::string

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