OPAL (Object Oriented Parallel Accelerator Library)  2.2.0
OPAL
Public Types | Public Member Functions | Protected Member Functions | Static Protected Attributes | Private Attributes | List of all members
FFTBase< Dim, T > Class Template Reference

#include <FFTBase.h>

Inheritance diagram for FFTBase< Dim, T >:
Inheritance graph
[legend]

Public Types

enum  { dimensions = Dim }
 
enum  FFT_e { ccFFT, rcFFT, sineFFT, cosineFFT }
 
typedef T Precision_t
 
typedef NDIndex< DimDomain_t
 
typedef FFTPACK< TInternalFFT_t
 

Public Member Functions

 FFTBase ()
 
 FFTBase (FFT_e transform, const Domain_t &domain, const bool transformTheseDims[Dim], bool compressTemps)
 
 FFTBase (FFT_e transform, const Domain_t &domain, bool compressTemps)
 
virtual ~FFTBase (void)
 
void write (std::ostream &out) const
 
void setDirectionName (int direction, const char *directionName)
 
void setNormFact (Precision_t nf)
 
int transVnodes () const
 

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>()
 null GuardCellSizes object for checking BareField arguments to transform More...
 

Private Attributes

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<unsigned Dim, class T>
class FFTBase< Dim, T >

The FFTBase class handles duties for the FFT class that do not involve the type of transform to be done. FFTBase is templated on dimensionality of the Field to transform and the floating-point precision type of the Field (float or double).

FFT Base Class to do stuff that is independent of transform type

Definition at line 29 of file FFTBase.h.

Member Typedef Documentation

template<unsigned Dim, class T>
typedef NDIndex<Dim> FFTBase< Dim, T >::Domain_t

Definition at line 60 of file FFTBase.h.

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

Definition at line 66 of file FFTBase.h.

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

Definition at line 59 of file FFTBase.h.

Member Enumeration Documentation

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

Definition at line 58 of file FFTBase.h.

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

Definition at line 63 of file FFTBase.h.

Constructor & Destructor Documentation

template<unsigned Dim, class T>
FFTBase< Dim, T >::FFTBase ( )
inline

Definition at line 68 of file FFTBase.h.

template<unsigned Dim, class T>
FFTBase< Dim, T >::FFTBase ( FFT_e  transform,
const Domain_t domain,
const bool  transformTheseDims[Dim],
bool  compressTemps 
)

inputs are enum of transform type, domain of input Field, which dimensions to transform, and whether to compress temporary Fields when not in use

Parameters
transform
domain
transformTheseDims
compressTemps
template<unsigned Dim, class T>
FFTBase< Dim, T >::FFTBase ( FFT_e  transform,
const Domain_t domain,
bool  compressTemps 
)
Parameters
transform
domain
compressTemps
template<unsigned Dim, class T>
virtual FFTBase< Dim, T >::~FFTBase ( void  )
inlinevirtual

Definition at line 95 of file FFTBase.h.

Member Function Documentation

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

get dimension number from list of transformed dimensions

get dimension number from list of transformed dimensions

Parameters
d
Returns

Definition at line 252 of file FFTBase.h.

References PAssert_LT.

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

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

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 FFT< CCTransform, Dim, T >::transform().

template<unsigned Dim, class T>
bool FFTBase< Dim, T >::compressTemps ( void  ) const
inlineprotected
template<unsigned Dim, class T >
int FFTBase< Dim, T >::getDirection ( const char *  directionName) const
inlineprotected

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 FFT< CCTransform, Dim, T >::transform().

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

access the internal FFT Engine

Definition at line 154 of file FFTBase.h.

Referenced by FFT< CCTransform, Dim, T >::FFT(), and FFT< CCTransform, Dim, T >::transform().

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

get the FFT normalization factor

Definition at line 157 of file FFTBase.h.

Referenced by FFT< CCTransform, Dim, T >::FFT(), and FFT< CCTransform, Dim, T >::transform().

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

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

Parameters
direction
directionName

Allow the user to name the transform directions, for code clarity. 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:

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

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

Parameters
nf

Definition at line 117 of file FFTBase.h.

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

query whether this dimension is to be transformed

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

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

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.

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

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

I/O for FFT object

Parameters
out

Definition at line 82 of file FFTBase.hpp.

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

Here is the call graph for this function:

Member Data Documentation

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

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

Definition at line 176 of file FFTBase.h.

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

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

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< 1U, T >::compressTemps().

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

Stores user-defined names for FFT directions:

Definition at line 171 of file FFTBase.h.

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

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< 1U, T >::getDomain().

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

Internal FFT object for performing serial FFTs.

Definition at line 179 of file FFTBase.h.

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

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

Normalization factor:

Definition at line 182 of file FFTBase.h.

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

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

Stores the number of dims to be transformed.

Definition at line 175 of file FFTBase.h.

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

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

null GuardCellSizes object for checking BareField arguments to transform

! These members are used by the derived FFT classes

Definition at line 139 of file FFTBase.h.

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

Indicates which dimensions are transformed.

Definition at line 174 of file FFTBase.h.

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

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: