15#ifndef IPPL_FFT_FFTBASE_H
16#define IPPL_FFT_FFTBASE_H
29template <
unsigned Dim,
class T>
class FFTBase;
30template <
unsigned Dim,
class T>
37 static const char* transformTypeString_g[4] = {
"complex-to-complex FFT",
38 "real-to-complex FFT",
42 return std::string(transformTypeString_g[i % 4]);
53template <
unsigned Dim,
class T>
102 void write(std::ostream& out)
const;
195template <
unsigned Dim,
class T>
207template <
unsigned Dim,
class T>
210 const char* directionName) {
212 directions_m[directionName] = direction;
223template <
unsigned Dim,
class T>
226 return (*(directions_m.find(directionName))).second;
236template <
unsigned Dim,
class T>
240 return transformDims_m[d];
250template <
unsigned Dim,
class T>
254 return activeDims_m[d];
267template <
unsigned Dim,
class T>
273 static bool matched[
Dim];
277 for (d=0; d<
Dim; ++d) matched[d] =
false;
282 while (!found && d1<
Dim) {
286 found = ( dom1[d].length()==dom2[d1].length() &&
287 dom1[d].sameBase(dom2[d1]) );
289 if (found) matched[d1] =
true;
293 if (!found)
return false;
std::ostream & operator<<(std::ostream &, const FFTBase< Dim, T > &)
Define operator<< to invoke write() member function:
std::string getTransformType(unsigned int i)
character strings for transform types
PETE_TUTree< FnAbs, typename T::PETE_Expr_t > abs(const PETE_Expr< T > &l)
Domain_t Domain_m
Domain of the input field, mainly used to check axis sizes and ordering, former const Domain_t& Domai...
FFTPACK< T > InternalFFT_t
int getDirection(const char *directionName) const
translate direction name string into dimension number
Precision_t & getNormFact(void)
get the FFT normalization factor
const Domain_t & getDomain(void) const
get our domain
InternalFFT_t FFTEngine_m
Internal FFT object for performing serial FFTs.
void setNormFact(Precision_t nf)
unsigned numTransformDims(void) const
query number of transform dimensions
void write(std::ostream &out) const
FFT_e transformType_m
Indicates which type of transform we do.
unsigned nTransformDims_m
Stores the number of dims to be transformed.
bool transformDims_m[Dim]
Indicates which dimensions are transformed.
FFTBase(FFT_e transform, const Domain_t &domain, const bool transformTheseDims[Dim], bool compressTemps)
std::map< const char *, int > directions_m
Stores user-defined names for FFT directions:
bool compressTempFields_m
Switch to turn on/off compression of intermediate Fields (tempFields) as algorithm is finished with t...
bool transformDim(unsigned d) const
query whether this dimension is to be transformed
void setDirectionName(int direction, const char *directionName)
bool compressTemps(void) const
do we compress temps?
unsigned * activeDims_m
Stores the numbers of these dims (0,1,2).
unsigned activeDimension(unsigned d) const
get dimension number from list of transformed dimensions
InternalFFT_t & getEngine(void)
access the internal FFT Engine
static GuardCellSizes< Dim > nullGC
null GuardCellSizes object for checking BareField arguments to transform
FFTBase(FFT_e transform, const Domain_t &domain, bool compressTemps)
Precision_t normFact_m
Normalization factor:
bool checkDomain(const Domain_t &dom1, const Domain_t &dom2) const
compare indexes of two domains