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

#include <FFT.h>

Inheritance diagram for FFT< SineTransform, Dim, T >:
Collaboration diagram for FFT< SineTransform, Dim, T >:

Public Types

typedef FieldLayout< DimLayout_t
typedef BareField< T, DimRealField_t
typedef LField< T, DimRealLField_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  
enum  FFT_e
typedef T Precision_t
typedef NDIndex< DimDomain_t
typedef FFTPACK< T > InternalFFT_t

Public Member Functions

 FFT (const Domain_t &rdomain, const Domain_t &cdomain, const bool transformTheseDims[Dim], const bool sineTransformDims[Dim], const bool &compressTemps=false)
 FFT (const Domain_t &rdomain, const Domain_t &cdomain, const bool sineTransformDims[Dim], const bool &compressTemps=false)
 FFT (const Domain_t &rdomain, const bool sineTransformDims[Dim], const bool &compressTemps=false)
 FFT (const Domain_t &rdomain, const bool &compressTemps=false)
 ~FFT (void)
void transform (int direction, RealField_t &f, ComplexField_t &g, const bool &constInput=false)
void transform (const char *directionName, RealField_t &f, ComplexField_t &g, const bool &constInput=false)
void transform (int direction, ComplexField_t &f, RealField_t &g, const bool &constInput=false)
void transform (const char *directionName, ComplexField_t &f, RealField_t &g, const bool &constInput=false)
void transform (int direction, RealField_t &f, RealField_t &g, const bool &constInput=false)
void transform (const char *directionName, RealField_t &f, RealField_t &g, const bool &constInput=false)
void transform (int direction, RealField_t &f)
void transform (const char *directionName, RealField_t &f)
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
bool transformDim (unsigned d) const
 query whether this dimension is to be transformed
unsigned numTransformDims (void) const
 query number of transform dimensions
unsigned activeDimension (unsigned d) const
 get dimension number from list of transformed dimensions
InternalFFT_tgetEngine (void)
 access the internal FFT Engine
Precision_tgetNormFact (void)
 get the FFT normalization factor
const Domain_tgetDomain (void) const
 get our domain
bool checkDomain (const Domain_t &dom1, const Domain_t &dom2) const
 compare indexes of two domains
bool compressTemps (void) const
 do we compress temps?

Static Protected Attributes

static GuardCellSizes< DimnullGC
 null GuardCellSizes object for checking BareField arguments to transform

Private Member Functions

void setup (void)

Private Attributes

bool sineTransformDims_m [Dim]
size_t numSineTransforms_m
Layout_t ** tempLayouts_m
Layout_t ** tempRLayouts_m
ComplexField_t ** tempFields_m
RealField_t ** tempRFields_m
const Domain_tcomplexDomain_m
std::map< const char *, int > directions_m
 Stores user-defined names for FFT directions:
FFT_e transformType_m
 Indicates which type of transform we do.
bool transformDims_m [Dim]
 Indicates which dimensions are transformed.
unsigned nTransformDims_m
 Stores the number of dims to be transformed.
unsigned * activeDims_m
 Stores the numbers of these dims (0,1,2).
InternalFFT_t FFTEngine_m
 Internal FFT object for performing serial FFTs.
Precision_t normFact_m
 Normalization factor:
Domain_t Domain_m
 Domain of the input field, mainly used to check axis sizes and ordering, former const Domain_t& Domain_m;.
bool compressTempFields_m
 Switch to turn on/off compression of intermediate Fields (tempFields) as algorithm is finished with them.

Detailed Description

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

sine transform class

Definition at line 660 of file FFT.h.

Member Typedef Documentation

◆ Complex_t

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

Definition at line 668 of file FFT.h.

◆ ComplexField_t

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

Definition at line 669 of file FFT.h.

◆ ComplexLField_t

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

Definition at line 670 of file FFT.h.

◆ Domain_t [1/2]

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

Definition at line 671 of file FFT.h.

◆ Domain_t [2/2]

typedef NDIndex<Dim> FFTBase< Dim, T >::Domain_t

Definition at line 60 of file FFTBase.h.

◆ InternalFFT_t

typedef FFTPACK<T> FFTBase< Dim, T >::InternalFFT_t

Definition at line 66 of file FFTBase.h.

◆ Layout_t

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

Definition at line 665 of file FFT.h.

◆ Precision_t

typedef T FFTBase< Dim, T >::Precision_t

Definition at line 59 of file FFTBase.h.

◆ RealField_t

template<size_t Dim, class T>
typedef BareField<T,Dim> FFT< SineTransform, Dim, T >::RealField_t

Definition at line 666 of file FFT.h.

◆ RealLField_t

template<size_t Dim, class T>
typedef LField<T,Dim> FFT< SineTransform, Dim, T >::RealLField_t

Definition at line 667 of file FFT.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum

Definition at line 58 of file FFTBase.h.

◆ FFT_e

Definition at line 63 of file FFTBase.h.

Constructor & Destructor Documentation

◆ FFT() [1/4]

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

Constructor for doing sine transform(s) followed by RC FFT Create a new FFT object with the given domains for input/output Fields Specify which dimensions to transform along. Also specify which of these are sine transforms Optional argument compress indicates whether or not to compress temporary Fields in between uses.

References compressTemps(), and Dim.

Referenced by FFT(), setup(), and ~FFT().

Here is the call graph for this function:

◆ FFT() [2/4]

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

Same as above, but transform all dims:

References compressTemps(), and Dim.

Here is the call graph for this function:

◆ FFT() [3/4]

template<size_t Dim, class T>
FFT< SineTransform, Dim, T >::FFT ( const Domain_t & rdomain,
const bool sineTransformDims[Dim],
const bool & compressTemps = false )

Separate constructors for doing only sine transforms Create a new FFT object with the given domain for input/output Field Specify which dimensions to transform along. Optional argument compress indicates whether or not to compress temporary Fields in between uses.

References compressTemps(), and Dim.

Here is the call graph for this function:

◆ FFT() [4/4]

template<size_t Dim, class T>
FFT< SineTransform, Dim, T >::FFT ( const Domain_t & rdomain,
const bool & compressTemps = false )

Same as above, but transform all dims:

References compressTemps(), and FFT().

Here is the call graph for this function:

◆ ~FFT()

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

Definition at line 2127 of file FFT.hpp.

References FFT(), numSineTransforms_m, numTransformDims(), tempFields_m, tempLayouts_m, tempRFields_m, and tempRLayouts_m.

Here is the call graph for this function:

Member Function Documentation

◆ activeDimension()

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 151 of file FFTBase.h.

Referenced by setup().

◆ checkDomain()

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 163 of file FFTBase.h.

◆ compressTemps()

bool FFTBase< Dim, T >::compressTemps ( void ) const
inlineprotected

do we compress temps?

Definition at line 166 of file FFTBase.h.

Referenced by FFT(), FFT(), FFT(), and FFT().

◆ getDirection()

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 142 of file FFTBase.h.

◆ getDomain()

const Domain_t & FFTBase< Dim, T >::getDomain ( void ) const
inlineprotected

get our domain

Definition at line 160 of file FFTBase.h.

Referenced by setup().

◆ getEngine()

InternalFFT_t & FFTBase< Dim, T >::getEngine ( void )
inlineprotected

access the internal FFT Engine

Definition at line 154 of file FFTBase.h.

◆ getNormFact()

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

get the FFT normalization factor

Definition at line 157 of file FFTBase.h.

◆ numTransformDims()

unsigned FFTBase< Dim, T >::numTransformDims ( void ) const
inlineprotected

query number of transform dimensions

Definition at line 148 of file FFTBase.h.

Referenced by setup(), and ~FFT().

◆ setDirectionName()

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 110 of file FFTBase.h.

◆ setNormFact()

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.

◆ setup()

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

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

Definition at line 1973 of file FFT.hpp.

References activeDimension(), complexDomain_m, Dim, FFT(), getDomain(), numSineTransforms_m, numTransformDims(), PARALLEL, PAssert, PAssert_EQ, PAssert_LT, PInsist, SERIAL, sineTransformDims_m, tempFields_m, tempLayouts_m, tempRFields_m, tempRLayouts_m, transformDim(), and transVnodes().

Referenced by transform().

Here is the call graph for this function:

◆ transform() [1/8]

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

◆ transform() [2/8]

template<size_t Dim, class T>
void FFT< SineTransform, Dim, T >::transform ( const char * directionName,
RealField_t & f )

References setup().

Here is the call graph for this function:

◆ transform() [3/8]

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

◆ transform() [4/8]

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

◆ transform() [5/8]

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

complex-to-real FFT, followed by sine transform(s) Same as above, but with input and output field types reversed.

◆ transform() [6/8]

template<size_t Dim, class T>
void FFT< SineTransform, Dim, T >::transform ( int direction,
RealField_t & f )

In-place version of real-to-real transform

◆ transform() [7/8]

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

These transforms are for combinations of sine transforms and RC FFTs

Do the FFT: specify +1 or -1 to indicate forward or inverse transform, or specify the user-defined name string for the direction. Supply a second BareField to store the output. 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.

◆ transform() [8/8]

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

These transforms are for doing sine transforms only sine transform: specify +1 or -1 to indicate forward or inverse transform, or specify the user-defined name string for the direction. Supply a second BareField to store the output. 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()

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 145 of file FFTBase.h.

Referenced by setup().

◆ transVnodes()

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

◆ write()

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

I/O for FFT object

Parameters
out

Definition at line 102 of file FFTBase.hpp.

Member Data Documentation

◆ activeDims_m

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

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

Definition at line 176 of file FFTBase.h.

◆ complexDomain_m

template<size_t Dim, class T>
const Domain_t* FFT< SineTransform, Dim, T >::complexDomain_m
private

domain of the resulting complex Field for real-to-complex transform

Definition at line 795 of file FFT.h.

Referenced by setup().

◆ compressTempFields_m

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.

◆ directions_m

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.

◆ Domain_m

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.

◆ FFTEngine_m

InternalFFT_t FFTBase< Dim, T >::FFTEngine_m
private

Internal FFT object for performing serial FFTs.

Definition at line 179 of file FFTBase.h.

◆ normFact_m

Precision_t FFTBase< Dim, T >::normFact_m
private

Normalization factor:

Definition at line 182 of file FFTBase.h.

◆ nTransformDims_m

unsigned FFTBase< Dim, T >::nTransformDims_m
private

Stores the number of dims to be transformed.

Definition at line 175 of file FFTBase.h.

◆ nullGC

GuardCellSizes<Dim> FFTBase< Dim, T >::nullGC
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.

◆ numSineTransforms_m

template<size_t Dim, class T>
size_t FFT< SineTransform, Dim, T >::numSineTransforms_m
private

number of sine transforms to perform

Definition at line 766 of file FFT.h.

Referenced by setup(), and ~FFT().

◆ sineTransformDims_m

template<size_t Dim, class T>
bool FFT< SineTransform, Dim, T >::sineTransformDims_m[Dim]
private

which dimensions are sine transformed

Definition at line 761 of file FFT.h.

Referenced by setup().

◆ tempFields_m

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

The array of temporary complex Fields These use the corresponding tempLayouts.

Definition at line 785 of file FFT.h.

Referenced by setup(), and ~FFT().

◆ tempLayouts_m

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

layouts for temporary Fields: SERIAL along the zeroth dimension, with the axes are permuted so that the transform direction is first

layouts for the temporary complex Fields

Definition at line 775 of file FFT.h.

Referenced by setup(), and ~FFT().

◆ tempRFields_m

template<size_t Dim, class T>
RealField_t** FFT< SineTransform, Dim, T >::tempRFields_m
private

The array of temporary real Fields These use the corresponding tempRLayouts.

Definition at line 790 of file FFT.h.

Referenced by setup(), and ~FFT().

◆ tempRLayouts_m

template<size_t Dim, class T>
Layout_t** FFT< SineTransform, Dim, T >::tempRLayouts_m
private

layouts for the temporary real Fields

Definition at line 780 of file FFT.h.

Referenced by setup(), and ~FFT().

◆ transformDims_m

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

Indicates which dimensions are transformed.

Definition at line 174 of file FFTBase.h.

◆ transformType_m

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: