18 #ifndef IPPL_FFT_FFT_H
19 #define IPPL_FFT_FFT_H
27 template <
class T,
unsigned Dim>
class LField;
47 template <
class Transform,
size_t Dim,
class T>
53 template <
size_t Dim,
class T>
85 lengths[d] = cdomain[d].length();
88 int transformTypes[
Dim];
91 for (d=0; d<
Dim; ++d) {
93 normFact /= lengths[d];
113 void transform(
int direction, ComplexField_t& f, ComplexField_t& g,
114 const bool& constInput=
false);
118 void transform(
const char* directionName, ComplexField_t& f,
119 ComplexField_t& g,
const bool& constInput=
false);
123 void transform(
int direction, ComplexField_t& f);
145 begdim = (direction == +1) ? 0 : (nTransformDims-1);
146 enddim = (direction == +1) ? nTransformDims : -1;
147 for (idim = begdim; idim != enddim; idim += direction) {
151 bool skipTranspose =
false;
154 if (idim == begdim) {
156 const Domain_t& first_dom = tempLayouts_m[idim]->getDomain();
159 skipTranspose = ( (in_dom[0].sameBase(first_dom[0])) &&
160 (in_dom[0].length() == first_dom[0].length()) &&
167 if (idim == enddim-direction) {
169 const Domain_t& last_dom = tempLayouts_m[idim]->getDomain();
172 skipTranspose = ( (in_dom[0].sameBase(last_dom[0])) &&
173 (in_dom[0].length() == last_dom[0].length()) &&
178 if (!skipTranspose) {
180 (*tempFields_m[idim])[tempLayouts_m[idim]->
getDomain()] =
185 temp = tempFields_m[idim];
187 else if (idim == enddim-direction && temp != &f) {
203 for (l_i = temp->
begin_if(); l_i != l_end; ++l_i) {
210 localdata = ldf->
getP();
213 int nstrips = 1, length = ldf->
size(0);
214 for (d=1; d<
Dim; ++d) nstrips *= ldf->
size(d);
215 for (
int istrip=0; istrip<nstrips; ++istrip) {
267 template <
size_t Dim,
class T>
270 const char* directionName,
273 const bool& constInput)
276 transform(dir, f, g, constInput);
303 FFT(
const Domain_t& cdomain,
const bool transformTheseDims[1U],
324 const bool& constInput=
false);
366 const char* directionName,
369 const bool& constInput)
372 transform(dir, f, g, constInput);
382 const char* directionName,
394 template <
size_t Dim,
class T>
437 const bool& constInput=
false);
438 void transform(
const char* directionName,
RealField_t& f,
448 const bool& constInput=
false);
503 template <
size_t Dim,
class T>
506 const char* directionName,
509 const bool& constInput)
512 transform(dir, f, g, constInput);
519 template <
size_t Dim,
class T>
522 const char* directionName,
525 const bool& constInput)
528 transform(dir, f, g, constInput);
559 const bool transformTheseDims[1U],
const bool&
compressTemps=
false);
580 const bool& constInput=
false);
581 void transform(
const char* directionName,
RealField_t& f,
589 const bool& constInput=
false);
630 const char* directionName,
633 const bool& constInput)
636 transform(dir, f, g, constInput);
646 const char* directionName,
649 const bool& constInput)
652 transform(dir, f, g, constInput);
659 template <
size_t Dim,
class T>
681 const bool transformTheseDims[
Dim],
682 const bool sineTransformDims[Dim],
const bool&
compressTemps=
false);
715 const bool& constInput=
false);
716 void transform(
const char* directionName,
RealField_t& f,
724 const bool& constInput=
false);
738 const bool& constInput=
false);
739 void transform(
const char* directionName,
RealField_t& f,
746 void transform(
const char* directionName,
RealField_t& f);
761 bool sineTransformDims_m[
Dim];
801 template <
size_t Dim,
class T>
804 const char* directionName,
807 const bool& constInput)
810 transform(dir, f, g, constInput);
817 template <
size_t Dim,
class T>
820 const char* directionName,
823 const bool& constInput)
826 transform(dir, f, g, constInput);
833 template <
size_t Dim,
class T>
836 const char* directionName,
839 const bool& constInput)
842 transform(dir, f, g, constInput);
849 template <
size_t Dim,
class T>
852 const char* directionName,
881 FFT(
const Domain_t& rdomain,
const bool sineTransformDims[1U],
900 const bool& constInput=
false);
901 void transform(
const char* directionName,
RealField_t& f,
908 void transform(
const char* directionName,
RealField_t& f);
936 const char* directionName,
939 const bool& constInput)
942 transform(dir, f, g, constInput);
952 const char* directionName,
960 #endif // IPPL_FFT_FFT_H
Layout_t ** tempLayouts_m
LField< Complex_t, Dim > ComplexLField_t
FFTBase< 1U, T >::Domain_t Domain_t
BareField< Complex_t, Dim > ComplexField_t
Layout_t ** tempLayouts_m
ComplexField_t ** tempFields_m
bool checkDomain(const Domain_t &dom1, const Domain_t &dom2) const
compare indexes of two domains
size_t numSineTransforms_m
LField< Complex_t, 1U > ComplexLField_t
int size(unsigned d) const
Layout_t ** tempLayouts_m
BareField< Complex_t, 1U > ComplexField_t
LField< T, 1U > RealLField_t
BareField< T, 1U > RealField_t
FieldLayout< Dim > Layout_t
std::complex< T > Complex_t
Precision_t & getNormFact(void)
get the FFT normalization factor
unsigned numTransformDims(void) const
query number of transform dimensions
void Uncompress(bool fill_domain=true)
const GuardCellSizes< Dim > & getGC() const
InternalFFT_t & getEngine(void)
access the internal FFT Engine
FieldLayout< 1U > Layout_t
std::complex< T > Complex_t
FieldLayout< Dim > Layout_t
const Domain_t & getDomain(void) const
get our domain
void callFFT(unsigned transformDim, int direction, Complex_t *data)
LField< T, 1U > RealLField_t
BareField< T, Dim > RealField_t
FFT(const Domain_t &cdomain, const bool &compressTemps=false)
FFTBase< Dim, T >::Domain_t Domain_t
ComplexField_t * tempFields_m
BareField< T, 1U > RealField_t
FFTBase< Dim, T >::Domain_t Domain_t
LField< T, Dim > RealLField_t
LField< Complex_t, Dim > ComplexLField_t
std::complex< T > Complex_t
FFTBase< Dim, T >::Domain_t Domain_t
LField< Complex_t, Dim > ComplexLField_t
LField< Complex_t, 1U > ComplexLField_t
Layout_t & getLayout() const
FieldLayout< 1U > Layout_t
std::complex< T > Complex_t
RealField_t ** tempRFields_m
RealField_t * tempRField_m
BareField< Complex_t, Dim > ComplexField_t
BareField< Complex_t, Dim > ComplexField_t
ComplexField_t ** tempFields_m
FFTBase< 1U, T >::Domain_t Domain_t
LField< T, Dim > RealLField_t
bool compressTemps(void) const
do we compress temps?
ComplexField_t ** tempFields_m
Layout_t * tempRLayouts_m
Layout_t ** tempRLayouts_m
ComplexField_t * tempFields_m
int getDirection(const char *directionName) const
translate direction name string into dimension number
FFTBase< 1U, T >::Domain_t Domain_t
BareField< Complex_t, 1U > ComplexField_t
FieldLayout< 1U > Layout_t
BareField< T, Dim > RealField_t
void setup(unsigned numTransformDims, const int *transformTypes, const int *axisLengths)
ac_id_larray::const_iterator const_iterator_if
const NDIndex< Dim > & getDomain() const
std::complex< T > Complex_t
e_dim_tag getDistribution(unsigned int d) const
const Domain_t * complexDomain_m
FieldLayout< Dim > Layout_t
RealField_t * tempRFields_m
void transform(const char *directionName, ComplexField_t &f)