OPAL (Object Oriented Parallel Accelerator Library) 2024.2
OPAL
FFT< CCTransform, Dim, T > Class Template Reference

complex-to-complex FFT class More...

#include <FFT.h>

Inheritance diagram for FFT< CCTransform, Dim, T >:
Inheritance graph
Collaboration diagram for FFT< CCTransform, Dim, T >:
Collaboration graph

Public Types

typedef FieldLayout< DimLayout_t
 
typedef std::complex< T > Complex_t
 
typedef BareField< Complex_t, DimComplexField_t
 
typedef LField< Complex_t, DimComplexLField_t
 
typedef FFTBase< Dim, T >::Domain_t Domain_t
 
enum  { dimensions = Dim }
 
enum  FFT_e { ccFFT , rcFFT , sineFFT , cosineFFT }
 
typedef T Precision_t
 
typedef FFTPACK< T > InternalFFT_t
 

Public Member Functions

 FFT (const Domain_t &cdomain, const bool transformTheseDims[Dim], const bool &compressTemps=false)
 Create a new FFT object with the given domain for the input Field. More...
 
 FFT (const Domain_t &cdomain, const bool &compressTemps=false)
 Create a new FFT object of type CCTransform, with a given domain. More...
 
 ~FFT (void)
 
void transform (int direction, ComplexField_t &f, ComplexField_t &g, const bool &constInput=false)
 Do the FFT: specify +1 or -1 to indicate forward or inverse transform, or specify the user-defined name string for the direction. More...
 
void transform (const char *directionName, ComplexField_t &f, ComplexField_t &g, const bool &constInput=false)
 invoke using string for direction name More...
 
void transform (int direction, ComplexField_t &f)
 overloaded versions which perform the FFT "in place" More...
 
void transform (const char *directionName, ComplexField_t &f)
 
void write (std::ostream &out) const
 I/O for FFT object. More...
 
void setDirectionName (int direction, const char *directionName)
 Allow the user to name the transform directions, for code clarity. More...
 
void setNormFact (Precision_t nf)
 Set the FFT normalization factor (to something other than the default) More...
 
int transVnodes () const
 Utility to determine the number of vnodes to use in temporary transpose fields; this is either -1, or a limited number set on the command line. More...
 

Protected Member Functions

int getDirection (const char *directionName) const
 translate direction name string into dimension number More...
 
bool transformDim (unsigned d) const
 query whether this dimension is to be transformed More...
 
unsigned numTransformDims (void) const
 query number of transform dimensions More...
 
unsigned activeDimension (unsigned d) const
 get dimension number from list of transformed dimensions More...
 
InternalFFT_tgetEngine (void)
 access the internal FFT Engine More...
 
Precision_tgetNormFact (void)
 get the FFT normalization factor More...
 
const Domain_tgetDomain (void) const
 get our domain More...
 
bool checkDomain (const Domain_t &dom1, const Domain_t &dom2) const
 compare indexes of two domains More...
 
bool compressTemps (void) const
 do we compress temps? More...
 

Static Protected Attributes

static GuardCellSizes< DimnullGC = GuardCellSizes<Dim>()
 ! These members are used by the derived FFT classes More...
 

Private Member Functions

void setup (void)
 setup performs all the initializations necessary after the transform directions have been specified. More...
 

Private Attributes

Layout_t ** tempLayouts_m
 How the temporary field's are laid out; these are computed from the input Field's domain. More...
 
ComplexField_t ** tempFields_m
 The array of temporary fields, one for each transform direction These use the corresponding tempLayouts. More...
 
std::map< const char *, int > directions_m
 Stores user-defined names for FFT directions: More...
 
FFT_e transformType_m
 Indicates which type of transform we do. More...
 
bool transformDims_m [Dim]
 Indicates which dimensions are transformed. More...
 
unsigned nTransformDims_m
 Stores the number of dims to be transformed. More...
 
unsigned * activeDims_m
 Stores the numbers of these dims (0,1,2). More...
 
InternalFFT_t FFTEngine_m
 Internal FFT object for performing serial FFTs. More...
 
Precision_t normFact_m
 Normalization factor: More...
 
Domain_t Domain_m
 Domain of the input field, mainly used to check axis sizes and ordering, former const Domain_t& Domain_m;. More...
 
bool compressTempFields_m
 Switch to turn on/off compression of intermediate Fields (tempFields) as algorithm is finished with them. More...
 

Detailed Description

template<size_t Dim, class T>
class FFT< CCTransform, Dim, T >

complex-to-complex FFT class

Definition at line 54 of file FFT.h.

Member Typedef Documentation

◆ Complex_t

template<size_t Dim, class T >
typedef std::complex<T> FFT< CCTransform, Dim, T >::Complex_t

Definition at line 59 of file FFT.h.

◆ ComplexField_t

template<size_t Dim, class T >
typedef BareField<Complex_t,Dim> FFT< CCTransform, Dim, T >::ComplexField_t

Definition at line 60 of file FFT.h.

◆ ComplexLField_t

template<size_t Dim, class T >
typedef LField<Complex_t,Dim> FFT< CCTransform, Dim, T >::ComplexLField_t

Definition at line 61 of file FFT.h.

◆ Domain_t

template<size_t Dim, class T >
typedef FFTBase<Dim,T>::Domain_t FFT< CCTransform, Dim, T >::Domain_t

Definition at line 62 of file FFT.h.

◆ InternalFFT_t

template<unsigned Dim, class T >
typedef FFTPACK<T> FFTBase< Dim, T >::InternalFFT_t
inherited

Definition at line 66 of file FFTBase.h.

◆ Layout_t

template<size_t Dim, class T >
typedef FieldLayout<Dim> FFT< CCTransform, Dim, T >::Layout_t

Definition at line 58 of file FFT.h.

◆ Precision_t

template<unsigned Dim, class T >
typedef T FFTBase< Dim, T >::Precision_t
inherited

Definition at line 59 of file FFTBase.h.

Member Enumeration Documentation

◆ anonymous enum

template<unsigned Dim, class T >
anonymous enum
inherited
Enumerator
dimensions 

Definition at line 58 of file FFTBase.h.

◆ FFT_e

template<unsigned Dim, class T >
enum FFTBase::FFT_e
inherited
Enumerator
ccFFT 
rcFFT 
sineFFT 
cosineFFT 

Definition at line 63 of file FFTBase.h.

Constructor & Destructor Documentation

◆ FFT() [1/2]

template<size_t Dim, class T >
FFT< CCTransform, Dim, T >::FFT ( const Domain_t cdomain,
const bool  transformTheseDims[Dim],
const bool &  compressTemps = false 
)

Create a new FFT object with the given domain for the input Field.

Specify which dimensions to transform along. Optional argument compressTemps indicates whether or not to compress temporary Fields in between uses.

◆ FFT() [2/2]

template<size_t Dim, class T >
FFT< CCTransform, Dim, T >::FFT ( const Domain_t cdomain,
const bool &  compressTemps = false 
)
inline

Create a new FFT object of type CCTransform, with a given domain.

Default case of transforming along all dimensions. Note this was formerly in the .cpp file, but the IBM linker could not find it!

Definition at line 78 of file FFT.h.

References Dim, FFTBase< Dim, T >::getEngine(), FFTBase< Dim, T >::getNormFact(), FFTPACK< T >::setup(), and Attrib::Legacy::Distribution::T.

Here is the call graph for this function:

◆ ~FFT()

template<size_t Dim, class T >
FFT< CCTransform, Dim, T >::~FFT ( void  )

Definition at line 117 of file FFT.hpp.

References FFTBase< Dim, T >::numTransformDims().

Here is the call graph for this function:

Member Function Documentation

◆ activeDimension()

template<unsigned Dim, class T >
unsigned FFTBase< Dim, T >::activeDimension ( unsigned  d) const
inlineprotectedinherited

get dimension number from list of transformed dimensions

Parameters
d
Returns

Definition at line 252 of file FFTBase.h.

References PAssert_LT.

Referenced by setup(), FFT< RCTransform, Dim, T >::setup(), and FFT< SineTransform, Dim, T >::setup().

◆ checkDomain()

template<unsigned Dim, class T >
bool FFTBase< Dim, T >::checkDomain ( const Domain_t dom1,
const Domain_t dom2 
) const
inlineprotectedinherited

compare indexes of two domains

helper function for comparing domains

Parameters
Dim
dom1
Dim
dom2
Returns

Definition at line 269 of file FFTBase.h.

References Dim.

Referenced by transform().

◆ compressTemps()

template<unsigned Dim, class T >
bool FFTBase< Dim, T >::compressTemps ( void  ) const
inlineprotectedinherited

◆ getDirection()

template<unsigned Dim, class T >
int FFTBase< Dim, T >::getDirection ( const char *  directionName) const
inlineprotectedinherited

translate direction name string into dimension number

Translate direction name string into dimension number.

Parameters
directionName
Returns

Definition at line 225 of file FFTBase.h.

Referenced by transform().

◆ getDomain()

template<unsigned Dim, class T >
const Domain_t & FFTBase< Dim, T >::getDomain ( void  ) const
inlineprotectedinherited

◆ getEngine()

template<unsigned Dim, class T >
InternalFFT_t & FFTBase< Dim, T >::getEngine ( void  )
inlineprotectedinherited

access the internal FFT Engine

Definition at line 154 of file FFTBase.h.

References FFTBase< Dim, T >::FFTEngine_m.

Referenced by FFT(), and transform().

◆ getNormFact()

template<unsigned Dim, class T >
Precision_t & FFTBase< Dim, T >::getNormFact ( void  )
inlineprotectedinherited

get the FFT normalization factor

Definition at line 157 of file FFTBase.h.

References FFTBase< Dim, T >::normFact_m.

Referenced by FFT(), and transform().

◆ numTransformDims()

template<unsigned Dim, class T >
unsigned FFTBase< Dim, T >::numTransformDims ( void  ) const
inlineprotectedinherited

◆ setDirectionName()

template<unsigned Dim, class T >
void FFTBase< Dim, T >::setDirectionName ( int  direction,
const char *  directionName 
)
inlineinherited

Allow the user to name the transform directions, for code clarity.

Parameters
direction
directionName

Typical values might be "x_to_k", "k_to_x", "t_to_omega", "omega_to_t"

Definition at line 209 of file FFTBase.h.

References abs(), and PAssert_EQ.

Here is the call graph for this function:

◆ setNormFact()

template<unsigned Dim, class T >
void FFTBase< Dim, T >::setNormFact ( Precision_t  nf)
inlineinherited

Set the FFT normalization factor (to something other than the default)

Parameters
nf

Definition at line 117 of file FFTBase.h.

References FFTBase< Dim, T >::normFact_m.

◆ setup()

template<size_t Dim, class T >
void FFT< CCTransform, Dim, T >::setup ( void  )
private

setup performs all the initializations necessary after the transform directions have been specified.

Definition at line 69 of file FFT.hpp.

References FFTBase< Dim, T >::activeDimension(), FFTBase< Dim, T >::compressTemps(), Dim, FFTBase< Dim, T >::getDomain(), FFTBase< Dim, T >::numTransformDims(), PARALLEL, SERIAL, and FFTBase< Dim, T >::transVnodes().

Here is the call graph for this function:

◆ transform() [1/4]

◆ transform() [2/4]

template<size_t Dim, class T >
void FFT< CCTransform, Dim, T >::transform ( const char *  directionName,
ComplexField_t f,
ComplexField_t g,
const bool &  constInput = false 
)

invoke using string for direction name

◆ transform() [3/4]

template<size_t Dim, class T >
void FFT< CCTransform, Dim, T >::transform ( int  direction,
ComplexField_t f 
)

overloaded versions which perform the FFT "in place"

◆ transform() [4/4]

template<size_t Dim, class T >
void FFT< CCTransform, Dim, T >::transform ( int  direction,
ComplexField_t f,
ComplexField_t g,
const bool &  constInput = false 
)

Do the FFT: specify +1 or -1 to indicate forward or inverse transform, or specify the user-defined name string for the direction.

User provides separate input and output fields optional argument constInput indicates whether or not to treat the input Field argument f as const. If not, we can use it as a temporary in order to avoid an additional data transpose.

◆ transformDim()

template<unsigned Dim, class T >
bool FFTBase< Dim, T >::transformDim ( unsigned  d) const
inlineprotectedinherited

query whether this dimension is to be transformed

Parameters
d
Returns

Definition at line 238 of file FFTBase.h.

References Dim, and PAssert_LT.

Referenced by FFT< SineTransform, Dim, T >::setup().

◆ transVnodes()

template<unsigned Dim, class T >
int FFTBase< Dim, T >::transVnodes ( ) const
inlineinherited

Utility to determine the number of vnodes to use in temporary transpose fields; this is either -1, or a limited number set on the command line.

Returns

Definition at line 125 of file FFTBase.h.

References IpplInfo::getNodes(), and IpplInfo::maxFFTNodes().

Referenced by setup(), FFT< RCTransform, Dim, T >::setup(), and FFT< SineTransform, Dim, T >::setup().

Here is the call graph for this function:

◆ write()

template<unsigned Dim, class T >
void FFTBase< Dim, T >::write ( std::ostream &  out) const
inherited

I/O for FFT object.

Parameters
out

Definition at line 82 of file FFTBase.hpp.

References Dim, endl(), and getTransformType().

Referenced by operator<<().

Here is the call graph for this function:

Member Data Documentation

◆ activeDims_m

template<unsigned Dim, class T >
unsigned* FFTBase< Dim, T >::activeDims_m
privateinherited

Stores the numbers of these dims (0,1,2).

Definition at line 176 of file FFTBase.h.

Referenced by FFTBase< Dim, T >::~FFTBase().

◆ compressTempFields_m

template<unsigned Dim, class T >
bool FFTBase< Dim, T >::compressTempFields_m
privateinherited

Switch to turn on/off compression of intermediate Fields (tempFields) as algorithm is finished with them.

Definition at line 188 of file FFTBase.h.

Referenced by FFTBase< Dim, T >::compressTemps().

◆ directions_m

template<unsigned Dim, class T >
std::map<const char*,int> FFTBase< Dim, T >::directions_m
privateinherited

Stores user-defined names for FFT directions:

Definition at line 171 of file FFTBase.h.

◆ Domain_m

template<unsigned Dim, class T >
Domain_t FFTBase< Dim, T >::Domain_m
privateinherited

Domain of the input field, mainly used to check axis sizes and ordering, former const Domain_t& Domain_m;.

Definition at line 185 of file FFTBase.h.

Referenced by FFTBase< Dim, T >::getDomain().

◆ FFTEngine_m

template<unsigned Dim, class T >
InternalFFT_t FFTBase< Dim, T >::FFTEngine_m
privateinherited

Internal FFT object for performing serial FFTs.

Definition at line 179 of file FFTBase.h.

Referenced by FFTBase< Dim, T >::getEngine().

◆ normFact_m

template<unsigned Dim, class T >
Precision_t FFTBase< Dim, T >::normFact_m
privateinherited

Normalization factor:

Definition at line 182 of file FFTBase.h.

Referenced by FFTBase< Dim, T >::getNormFact(), and FFTBase< Dim, T >::setNormFact().

◆ nTransformDims_m

template<unsigned Dim, class T >
unsigned FFTBase< Dim, T >::nTransformDims_m
privateinherited

Stores the number of dims to be transformed.

Definition at line 175 of file FFTBase.h.

Referenced by FFTBase< Dim, T >::numTransformDims().

◆ nullGC

template<unsigned Dim, class T >
GuardCellSizes< Dim > FFTBase< Dim, T >::nullGC = GuardCellSizes<Dim>()
staticprotectedinherited

! These members are used by the derived FFT classes

null GuardCellSizes object for checking BareField arguments to transform

Definition at line 139 of file FFTBase.h.

◆ tempFields_m

template<size_t Dim, class T >
ComplexField_t** FFT< CCTransform, Dim, T >::tempFields_m
private

The array of temporary fields, one for each transform direction These use the corresponding tempLayouts.

Definition at line 259 of file FFT.h.

◆ tempLayouts_m

template<size_t Dim, class T >
Layout_t** FFT< CCTransform, Dim, T >::tempLayouts_m
private

How the temporary field's are laid out; these are computed from the input Field's domain.

This will be allocated as an array of FieldLayouts with nTransformDims elements. Each is SERIAL along the zeroth dimension and the axes are permuted so that the transform direction is first

Definition at line 254 of file FFT.h.

◆ transformDims_m

template<unsigned Dim, class T >
bool FFTBase< Dim, T >::transformDims_m[Dim]
privateinherited

Indicates which dimensions are transformed.

Definition at line 174 of file FFTBase.h.

◆ transformType_m

template<unsigned Dim, class T >
FFT_e FFTBase< Dim, T >::transformType_m
privateinherited

Indicates which type of transform we do.

Definition at line 173 of file FFTBase.h.


The documentation for this class was generated from the following files: