PhyStar  v0.0.0 thu24
fftapi.hpp File Reference

API for fftw. More...

#include <iostream>
#include <complex>
#include "fftw3.h"
Include dependency graph for fftapi.hpp:
This graph shows which files directly or indirectly include this file:

Namespaces

 tfft3d
 

Enumerations

enum  tfft3d::FFTTYPE {
  tfft3d::kNULL = -9 , tfft3d::kDFTc2c = 0 , tfft3d::kDFTc2r , tfft3d::kDFTr2c ,
  tfft3d::kDFTHC , tfft3d::kDCT1 , tfft3d::kDCT2 , tfft3d::kDCT3 ,
  tfft3d::kDCT4 , tfft3d::kDST1 , tfft3d::kDST2 , tfft3d::kDST3 ,
  tfft3d::kDST4
}
 
enum  tfft3d::FFTDimension { tfft3d::FirstDim = 0 , tfft3d::SecondDim , tfft3d::ThirdDim }
 
enum  tfft3d::MemoryAlignType { tfft3d::kLeft = 0 , tfft3d::kJustified }
 
enum  tfft3d::DCTTYPE { tfft3d::DCT1 = 0 , tfft3d::DCT2 , tfft3d::DCT3 , tfft3d::DCT4 }
 
enum  tfft3d::DSTTYPE { tfft3d::DST1 = 0 , tfft3d::DST2 , tfft3d::DST3 , tfft3d::DST4 }
 

Functions

void tfft3d::MemoryCopy (auto *in, int m0, int m1, int m2, auto *out, int n0, int n1, int n2, const int align_type=kLeft)
 copy the memory of one array to a new array with a different size for three dimensional case More...
 
template<typename T_real = double>
void tfft3d::MemoryCopy (T_real *in, int m0, int m1, int m2, std::complex< T_real > *out, int n0, int n1, int n2, const int align_type=kLeft)
 
template<typename T_real = double>
void tfft3d::MemoryCopy (std::complex< T_real > *in, int m0, int m1, int m2, T_real *out, int n0, int n1, int n2, const int align_type=kLeft)
 
template<int Rank, typename T_real = double>
static void tfft3d::PencilDFTForwardc2c (std::complex< T_real > *in, int m0, int m1, int m2, std::complex< T_real > *out, int n0, int n1, int n2, std::complex< T_real > *temp=nullptr)
 Forward DFT for a 3D-pencil array (c2c) More...
 
template<int Rank, typename T_real = double>
static void tfft3d::PencilDFTBackwardc2c (std::complex< T_real > *in, int m0, int m1, int m2, std::complex< T_real > *out, int n0, int n1, int n2, std::complex< T_real > *temp=nullptr)
 Backward DFT for a 3D-pencil array (c2c) More...
 
template<int Rank, typename T_real = double>
static void tfft3d::PencilDFTc2c (std::complex< T_real > *in, std::complex< T_real > *out, int n0, int n1, int n2, const int fftw_dir)
 DFT for a 3D-pencil array (c2c) (the sizes of input and output arrays are the same) More...
 
template<int Rank, typename T_real = double>
static void tfft3d::PencilDFTr2c (T_real *in, int m0, int m1, int m2, std::complex< T_real > *out, int n0, int n1, int n2, std::complex< T_real > *temp=nullptr)
 DFT for a 3D-pencil array (r2c) More...
 
template<int Rank, typename T_real = double>
static void tfft3d::PencilDFTc2r (std::complex< T_real > *in, int m0, int m1, int m2, T_real *out, int n0, int n1, int n2, std::complex< T_real > *temp=nullptr)
 
template<int Rank, typename T_real = double>
static void tfft3d::PencilDFTr2c (T_real *in, std::complex< T_real > *out, int n0, int n1, int n2)
 DFT for a 3D-pencil array (r2c) (the logical sizes of input and output arrays are the same) More...
 
template<int Rank, typename T_real = double>
static void tfft3d::PencilDFTc2r (std::complex< T_real > *in, T_real *out, int n0, int n1, int n2)
 DFT for a 3D-pencil array (c2r) (the logical sizes of input and output arrays are the same) More...
 
template<int Rank, typename T_real = double>
static void tfft3d::PencilDFTForwardr2r (T_real *in, int m0, int m1, int m2, T_real *out, int n0, int n1, int n2, const fftw_r2r_kind kind, T_real *temp=nullptr)
 
template<int Rank, typename T_real = double>
static void tfft3d::PencilDFTForwardr2r (std::complex< T_real > *in, int m0, int m1, int m2, std::complex< T_real > *out, int n0, int n1, int n2, const fftw_r2r_kind kind, std::complex< T_real > *temp=nullptr)
 
template<int Rank, typename T_real = double>
static void tfft3d::PencilDFTBackwardr2r (T_real *in, int m0, int m1, int m2, T_real *out, int n0, int n1, int n2, const fftw_r2r_kind kind, T_real *temp=nullptr)
 
template<int Rank, typename T_real = double>
static void tfft3d::PencilDFTBackwardr2r (std::complex< T_real > *in, int m0, int m1, int m2, std::complex< T_real > *out, int n0, int n1, int n2, const fftw_r2r_kind kind, std::complex< T_real > *temp=nullptr)
 
template<int Rank, typename T_real = double>
static void tfft3d::PencilDFTr2r (T_real *in, T_real *out, int n0, int n1, int n2, const fftw_r2r_kind kind)
 
template<int Rank, typename T_real = double>
static void tfft3d::PencilDFTr2r (std::complex< T_real > *in, std::complex< T_real > *out, int n0, int n1, int n2, const fftw_r2r_kind kind)
 
template<int Rank, typename T_real = double>
static void tfft3d::PencilDFTForwardc2c (auto *in, int m0, int m1, int m2, auto *out, int n0, int n1, int n2, auto *temp=nullptr)
 
template<int Rank, typename T_real = double>
static void tfft3d::PencilDFTr2c (auto *in, int m0, int m1, int m2, auto *out, int n0, int n1, int n2, auto *temp=nullptr)
 
template<int Rank, typename T_real = double>
static void tfft3d::PencilDFTc2r (auto *in, int m0, int m1, int m2, auto *out, int n0, int n1, int n2, auto *temp=nullptr)
 
template<int Rank, typename T_real = double>
static void tfft3d::PencilDFTc2c (auto *in, auto *out, int n0, int n1, int n2, int fftw_flag)
 
template<int Rank, typename T_real = double>
static void tfft3d::PencilDFTr2c (auto *in, auto *out, int n0, int n1, int n2)
 
template<int Rank, typename T_real = double>
static void tfft3d::PencilDFTc2r (auto *in, auto *out, int n0, int n1, int n2)
 
template<int Rank, typename T_real = double>
static void tfft3d::PencilDFTr2r (auto *in, auto *out, int n0, int n1, int n2, const fftw_r2r_kind kind)
 
template<int Rank, typename T_real = double>
static void tfft3d::PencilDFTForwardr2r (auto *in, int m0, int m1, int m2, auto *out, int n0, int n1, int n2, const fftw_r2r_kind kind, auto *temp=nullptr)
 
template<int Rank, typename T_real = double>
static void tfft3d::PencilDFTBackwardc2c (auto *in, int m0, int m1, int m2, auto *out, int n0, int n1, int n2, auto *temp=nullptr)
 
template<int Rank, typename T_real = double>
static void tfft3d::PencilDFTBackwardr2r (auto *in, int m0, int m1, int m2, auto *out, int n0, int n1, int n2, const fftw_r2r_kind kind, auto *temp=nullptr)
 
template<int Rank, typename T_real = double>
static void tfft3d::PencilDFTForward (std::complex< T_real > *in, int m0, int m1, int m2, std::complex< T_real > *out, int n0, int n1, int n2, std::complex< T_real > *temp=nullptr)
 
template<int Rank, typename T_real = double>
static void tfft3d::PencilDFTForward (T_real *in, int m0, int m1, int m2, std::complex< T_real > *out, int n0, int n1, int n2, std::complex< T_real > *temp=nullptr)
 
template<int Rank, typename T_real = double>
static void tfft3d::PencilDFTForward (T_real *in, int m0, int m1, int m2, T_real *out, int n0, int n1, int n2, const fftw_r2r_kind *kind, T_real *temp=nullptr)
 
template<int Rank, typename T_real = double>
static void tfft3d::PencilDFTBackward (std::complex< T_real > *in, int m0, int m1, int m2, std::complex< T_real > *out, int n0, int n1, int n2, std::complex< T_real > *temp=nullptr)
 
template<int Rank, typename T_real = double>
static void tfft3d::PencilDFTBackward (std::complex< T_real > *in, int m0, int m1, int m2, T_real *out, int n0, int n1, int n2, std::complex< T_real > *temp=nullptr)
 
template<int Rank, typename T_real = double>
static void tfft3d::PencilDFTBackward (T_real *in, int m0, int m1, int m2, T_real *out, int n0, int n1, int n2, const fftw_r2r_kind *kind, T_real *temp=nullptr)
 
template<int Rank, typename T_real = double>
static void tfft3d::PencilDFTForward (std::complex< T_real > *in, std::complex< T_real > *out, int n0, int n1, int n2)
 
template<int Rank, typename T_real = double>
static void tfft3d::PencilDFTForward (T_real *in, std::complex< T_real > *out, int n0, int n1, int n2)
 
template<int Rank, typename T_real = double>
static void tfft3d::PencilDFTBackward (std::complex< T_real > *in, std::complex< T_real > *out, int n0, int n1, int n2)
 
template<int Rank, typename T_real = double>
static void tfft3d::PencilDFTBackward (std::complex< T_real > *in, T_real *out, int n0, int n1, int n2)
 
template<int Rank, typename T_real = double>
static void tfft3d::PencilDFT (std::complex< T_real > *in, std::complex< T_real > *out, int n0, int n1, int n2, const int fftw_dir)
 
template<int Rank, typename T_real = double>
static void tfft3d::PencilDFT (std::complex< T_real > *in, T_real *out, int n0, int n1, int n2)
 
template<int Rank, typename T_real = double>
static void tfft3d::PencilDFT (T_real *in, std::complex< T_real > *out, int n0, int n1, int n2)
 
template<int Rank, typename T_real = double>
static void tfft3d::PencilDFT (T_real *in, T_real *out, int n0, int n1, int n2, const fftw_r2r_kind *kind)
 
template<int Rank, typename T_real = double>
static void tfft3d::PencilDFTHC (T_real *in, T_real *out, int n0, int n1, int n2, const int fftw_dir)
 
template<int Rank, typename T_real = double>
static void tfft3d::PencilDFTHC (std::complex< T_real > *in, std::complex< T_real > *out, int n0, int n1, int n2, const int fftw_dir)
 
template<int Rank, typename T_real = double>
static void tfft3d::PencilDCT (T_real *in, T_real *out, int n0, int n1, int n2, const int fftw_dir, const int dcttype=DCT1)
 
template<int Rank, typename T_real = double>
static void tfft3d::PencilDCT (std::complex< T_real > *in, std::complex< T_real > *out, int n0, int n1, int n2, const int fftw_dir, const int dcttype=DCT1)
 
template<int Rank, typename T_real = double>
static void tfft3d::PencilDST (T_real *in, T_real *out, int n0, int n1, int n2, const int fftw_dir, const int dsttype=DST1)
 
template<int Rank, typename T_real = double>
static void tfft3d::PencilDST (std::complex< T_real > *in, std::complex< T_real > *out, int n0, int n1, int n2, const int fftw_dir, const int dsttype=DST1)
 
template<int Rank>
void tfft3d::ZeroNyquistWave (auto *in, int n0, int n1, int n2, const int align_type)
 
template<int Rank, typename T_real = double>
static void tfft3d::PencilDFTForward (const int fft_type, auto *in, int m0, int m1, int m2, auto *out, int n0, int n1, int n2, auto *temp=nullptr)
 
template<int Rank, typename T_real = double>
static void tfft3d::PencilDFTBackward (const int fft_type, auto *in, int m0, int m1, int m2, auto *out, int n0, int n1, int n2, auto *temp=nullptr)
 
template<int Rank, typename T_real = double>
static void tfft3d::PencilDFTForward (const int fft_type, auto *in, auto *out, int n0, int n1, int n2)
 
template<int Rank, typename T_real = double>
static void tfft3d::PencilDFTBackward (const int fft_type, auto *in, auto *out, int n0, int n1, int n2)
 
template<typename T_real = double>
static void tfft3d::PencilDFTForward (const int fftdim, const int fft_type, auto *in, int m0, int m1, int m2, auto *out, int n0, int n1, int n2, auto *temp=nullptr)
 
template<typename T_real = double>
static void tfft3d::PencilDFTBackward (const int fftdim, const int fft_type, auto *in, int m0, int m1, int m2, auto *out, int n0, int n1, int n2, auto *temp=nullptr)
 
template<typename T_real = double>
static void tfft3d::PencilDFTForward (const int fftdim, const int fft_type, auto *in, auto *out, int n0, int n1, int n2)
 
template<typename T_real = double>
static void tfft3d::PencilDFTBackward (const int fftdim, const int fft_type, auto *in, auto *out, int n0, int n1, int n2)
 

Detailed Description

API for fftw.

Pencil decomposition and Fast Fourier Transformation for 2D/3D arrays with MPI

Author
Zhiwen Cui (Zhiwe.nosp@m.n_Cu.nosp@m.i@out.nosp@m.look.nosp@m..com)
Version
0.1
Date
2022-10-28