kspaceFirstOrder3D-OMP
1.1
The C++ implementation of the k-wave toolbox for the time-domain simulation of acoustic wave fields in 3D
|
Class implementing 3D Real-To-Complex and Complex-To-Real transforms using FFTW interface. More...
#include <FFTWComplexMatrix.h>
Public Member Functions | |
TFFTWComplexMatrix (const TDimensionSizes &DimensionSizes) | |
Constructor. More... | |
virtual | ~TFFTWComplexMatrix () |
Destructor. More... | |
void | Create_FFT_Plan_3D_R2C (TRealMatrix &InMatrix) |
Create FFTW plan for Real-to-Complex. More... | |
void | Create_FFT_Plan_3D_C2R (TRealMatrix &OutMatrix) |
Create FFTW plan for Complex-to-Real. More... | |
void | Create_FFT_Plan_1DX_R2C (TRealMatrix &InMatrix) |
Create FFTW plan for Real-to-Complex in the X dimension. More... | |
void | Create_FFT_Plan_1DY_R2C (TRealMatrix &InMatrix) |
Create FFTW plan for Real-to-Complex in the Y dimension. More... | |
void | Create_FFT_Plan_1DZ_R2C (TRealMatrix &InMatrix) |
Create FFTW plan for Real-to-Complex in the Z dimension. More... | |
void | Create_FFT_Plan_1DX_C2R (TRealMatrix &OutMatrix) |
Create FFTW plan for Complex-to-Real in the X dimension. More... | |
void | Create_FFT_Plan_1DY_C2R (TRealMatrix &OutMatrix) |
Create FFTW plan for Complex-to-Real in the Y dimension. More... | |
void | Create_FFT_Plan_1DZ_C2R (TRealMatrix &OutMatrix) |
Create FFTW plan for Complex-to-Real in the Z dimension. More... | |
void | Compute_FFT_3D_R2C (TRealMatrix &InMatrix) |
Compute 3D out-of-place Real-to-Complex FFT. More... | |
void | Compute_FFT_3D_C2R (TRealMatrix &OutMatrix) |
Compute 3D out-of-place Complex-to-Real FFT. More... | |
void | Compute_FFT_1DX_R2C (TRealMatrix &InMatrix) |
Compute 1D out-of-place Real-to-Complex FFT in the X dimension. More... | |
void | Compute_FFT_1DY_R2C (TRealMatrix &InMatrix) |
Compute 1D out-of-place Real-to-Complex FFT in the Y dimension. More... | |
void | Compute_FFT_1DZ_R2C (TRealMatrix &InMatrix) |
Compute 1D out-of-place Real-to-Complex FFT in the Z dimension. More... | |
void | Compute_FFT_1DX_C2R (TRealMatrix &OutMatrix) |
Compute 1D out-of-place Complex-to-Real FFT in the X dimension. More... | |
void | Compute_FFT_1DY_C2R (TRealMatrix &OutMatrix) |
Compute 1D out-of-place Complex-to-Real FFT in the Y dimension. More... | |
void | Compute_FFT_1DZ_C2R (TRealMatrix &OutMatrix) |
Compute 1D out-of-place Complex-to-Real FFT in the Z dimension. More... | |
Public Member Functions inherited from TComplexMatrix | |
TComplexMatrix (const TDimensionSizes &DimensionSizes) | |
Constructor. More... | |
virtual | ~TComplexMatrix () |
Destructor. | |
TFloatComplex & | operator[] (const size_t &index) |
operator []. More... | |
const TFloatComplex & | operator[] (const size_t &index) const |
operator [], constant version. More... | |
TFloatComplex & | GetElementFrom3D (const size_t X, const size_t Y, const size_t Z) |
Get element from 3D matrix. More... | |
const TFloatComplex & | GetElementFrom3D (const size_t X, const size_t Y, const size_t Z) const |
Get element from 3D matrix, constant version. More... | |
virtual void | ReadDataFromHDF5File (THDF5_File &HDF5_File, const char *MatrixName) |
Load data from the HDF5_File. More... | |
virtual void | WriteDataToHDF5File (THDF5_File &HDF5_File, const char *MatrixName, const size_t CompressionLevel) |
Write data into the HDF5_File. More... | |
Public Member Functions inherited from TBaseFloatMatrix | |
TBaseFloatMatrix () | |
Default constructor. | |
virtual TDimensionSizes | GetDimensionSizes () const |
Get dimension sizes of the matrix. | |
virtual size_t | GetTotalElementCount () const |
Get element count of the matrix. | |
virtual size_t | GetTotalAllocatedElementCount () const |
Get total allocated element count (might differ from total element count used for the simulation because of padding). | |
virtual | ~TBaseFloatMatrix () |
Destructor. | |
virtual void | CopyData (const TBaseFloatMatrix &src) |
Copy data from other matrix with the same size. More... | |
virtual void | ZeroMatrix () |
Zero all elements of the matrix (NUMA first touch). More... | |
virtual void | ScalarDividedBy (const float scalar) |
Divide scalar/ matrix_element[i]. More... | |
virtual float * | GetRawData () |
Get raw data out of the class (for direct kernel access). | |
virtual const float * | GetRawData () const |
Get raw data out of the class (for direct kernel access). | |
Public Member Functions inherited from TBaseMatrix | |
TBaseMatrix () | |
Default constructor. | |
virtual | ~TBaseMatrix () |
Destructor. | |
Static Public Member Functions | |
static void | ExportWisdom () |
Export wisdom to the file. More... | |
static void | ImportWisdom () |
Import wisdom from the file. More... | |
static void | DeleteStoredWisdom () |
Destroy wisdom in the file (delete it). More... | |
Protected Member Functions | |
TFFTWComplexMatrix () | |
Default constructor not allowed for public. | |
TFFTWComplexMatrix (const TFFTWComplexMatrix &src) | |
Copy constructor not allowed for public. | |
TFFTWComplexMatrix & | operator= (const TFFTWComplexMatrix &src) |
Operator = not allowed for public. | |
virtual void | AllocateMemory () |
Allocate memory for the FFTW matrix. More... | |
virtual void | FreeMemory () |
Free memory of the FFTW matrix. More... | |
Protected Member Functions inherited from TComplexMatrix | |
TComplexMatrix () | |
Default constructor not allowed for public. | |
TComplexMatrix (const TComplexMatrix &src) | |
Copy constructor not allowed for public. | |
TComplexMatrix & | operator= (const TComplexMatrix &src) |
Operator not allowed for public. | |
virtual void | InitDimensions (const TDimensionSizes &DimensionSizes) |
Initialize dimension sizes and related structures. More... | |
Protected Member Functions inherited from TBaseFloatMatrix | |
TBaseFloatMatrix (const TBaseFloatMatrix &src) | |
Copy constructor is not directly allowed. | |
TBaseFloatMatrix & | operator= (const TBaseFloatMatrix &src) |
operator = is not directly allowed. | |
Static Protected Member Functions | |
static string | GetWisdomFileName () |
Get Wisdom file name, base on the checkpoint filename. More... | |
Protected Attributes | |
fftwf_plan | fftw_plan_3D_R2C |
FFTW plan for the 3D Real-to-Complex transform. | |
fftwf_plan | fftw_plan_3D_C2R |
FFTW plan for the 3D Complex-to-Real transform. | |
fftwf_plan | fftw_plan_1DX_R2C |
FFTW plan for the 1D Real-to-Complex transform in the X dimension. | |
fftwf_plan | fftw_plan_1DY_R2C |
FFTW plan for the 3D Real-to-Complex transform in the Y dimension. | |
fftwf_plan | fftw_plan_1DZ_R2C |
FFTW plan for the 3D Real-to-Complex transform in the Z dimension. | |
fftwf_plan | fftw_plan_1DX_C2R |
FFTW plan for the 3D Complex-to-Real transform in the X dimension. | |
fftwf_plan | fftw_plan_1DY_C2R |
FFTW plan for the 3D Complex-to-Real transform in the Y dimension. | |
fftwf_plan | fftw_plan_1DZ_C2R |
FFTW plan for the 3Z Complex-to-Real transform in the Z dimension. | |
Protected Attributes inherited from TBaseFloatMatrix | |
size_t | pTotalElementCount |
Total number of elements. | |
size_t | pTotalAllocatedElementCount |
Total number of allocated elements (in terms of floats). | |
struct TDimensionSizes | pDimensionSizes |
Dimension sizes. | |
size_t | pDataRowSize |
Size of a 1D row in X dimension. | |
size_t | p2DDataSliceSize |
Size of a 2D slab (X,Y). | |
float * | pMatrixData |
Raw matrix data. | |
Static Protected Attributes | |
static const unsigned | TFFTWComplexMatrix_FFT_FLAG = FFTW_MEASURE |
FFTW plan flag. | |
static const string | FFTW_Wisdom_FileName_Extension = "FFTW_Wisdom" |
The file extension for FFTW wisdom. | |
Class implementing 3D Real-To-Complex and Complex-To-Real transforms using FFTW interface.
Definition at line 50 of file FFTWComplexMatrix.h.
TFFTWComplexMatrix::TFFTWComplexMatrix | ( | const TDimensionSizes & | DimensionSizes | ) |
Constructor.
[in] | DimensionSizes | - Dimension sizes of the reduced complex matrix |
Definition at line 60 of file FFTWComplexMatrix.cpp.
|
virtual |
Destructor.
Definition at line 76 of file FFTWComplexMatrix.cpp.
|
protectedvirtual |
Allocate Memory using fftwf_malloc function to ensure correct alignment.
Reimplemented from TBaseFloatMatrix.
Definition at line 918 of file FFTWComplexMatrix.cpp.
void TFFTWComplexMatrix::Compute_FFT_1DX_C2R | ( | TRealMatrix & | OutMatrix | ) |
Compute 1D out-of-place Complex-to-Real FFT in the X dimension.
[out] | OutMatrix |
runtime_error | if the plan is not valid. |
Definition at line 761 of file FFTWComplexMatrix.cpp.
void TFFTWComplexMatrix::Compute_FFT_1DX_R2C | ( | TRealMatrix & | InMatrix | ) |
Compute 1D out-of-place Real-to-Complex FFT in the X dimension. There are two versions of this routine for GCC+FFTW and ICPC + MKL, otherwise it will not build! The FFTW version processes the whole matrix at one while the MKL slab by slab
[in] | InMatrix |
runtime_error | if the plan is not valid. |
Definition at line 652 of file FFTWComplexMatrix.cpp.
void TFFTWComplexMatrix::Compute_FFT_1DY_C2R | ( | TRealMatrix & | OutMatrix | ) |
Compute 1D out-of-place Complex-to-Real FFT in the Y dimension.
[out] | OutMatrix |
runtime_error | if the plan is not valid. |
Definition at line 797 of file FFTWComplexMatrix.cpp.
void TFFTWComplexMatrix::Compute_FFT_1DY_R2C | ( | TRealMatrix & | InMatrix | ) |
Compute 1D out-of-place Real-to-Complex FFT in the Y dimension.
[in] | InMatrix |
runtime_error | if the plan is not valid. |
Definition at line 688 of file FFTWComplexMatrix.cpp.
void TFFTWComplexMatrix::Compute_FFT_1DZ_C2R | ( | TRealMatrix & | OutMatrix | ) |
Compute 1D out-of-place Complex-to-Real FFT in the Z dimension
[out] | OutMatrix |
runtime_error | if the plan is not valid. |
Definition at line 833 of file FFTWComplexMatrix.cpp.
void TFFTWComplexMatrix::Compute_FFT_1DZ_R2C | ( | TRealMatrix & | InMatrix | ) |
Compute 1D out-of-place Real-to-Complex FFT in the Z dimension.
[in] | InMatrix |
runtime_error | if the plan is not valid. |
Definition at line 724 of file FFTWComplexMatrix.cpp.
void TFFTWComplexMatrix::Compute_FFT_3D_C2R | ( | TRealMatrix & | OutMatrix | ) |
Compute inverse out-of-place 3D Complex to Real FFT.
[out] | OutMatrix |
runtime_error | if the plan is not valid. |
Definition at line 628 of file FFTWComplexMatrix.cpp.
void TFFTWComplexMatrix::Compute_FFT_3D_R2C | ( | TRealMatrix & | InMatrix | ) |
Computer forward out-of place 3D Real-to-Complex FFT.
[in] | InMatrix | - Input Matrix |
runtime_error | if the plan is not valid. |
Definition at line 608 of file FFTWComplexMatrix.cpp.
void TFFTWComplexMatrix::Create_FFT_Plan_1DX_C2R | ( | TRealMatrix & | OutMatrix | ) |
Create FFTW plan for Complex-to-Real in the X dimension. There are two versions of this routine for GCC+FFTW and ICPC + MKL, otherwise it will not build! The FFTW version processes the whole matrix at one while the MKL slab by slab
[in,out] | OutMatrix | - RealMatrix of which to create the plan. |
runtime_error | if the plan can't be created. |
Definition at line 392 of file FFTWComplexMatrix.cpp.
void TFFTWComplexMatrix::Create_FFT_Plan_1DX_R2C | ( | TRealMatrix & | InMatrix | ) |
Create an FFTW plan for 1D Real-to-Complex in the X dimension. There are two versions of this routine for GCC+FFTW and ICPC + MKL, otherwise it will not build! The FFTW version processes the whole matrix at one while the MKL slab by slab
[in,out] | InMatrix | - RealMatrix of which to create the plan |
runtime_error | if the plan can't be created. |
Definition at line 167 of file FFTWComplexMatrix.cpp.
void TFFTWComplexMatrix::Create_FFT_Plan_1DY_C2R | ( | TRealMatrix & | OutMatrix | ) |
Create FFTW plan for Complex-to-Real in the Y dimension. There are two versions of this routine for GCC+FFTW and ICPC + MKL, otherwise it will not build! The FFTW version processes the whole matrix at one while the MKL slab by slab
[in,out] | OutMatrix | - RealMatrix of which to create the plan. |
runtime_error | if the plan can't be created. |
Definition at line 466 of file FFTWComplexMatrix.cpp.
void TFFTWComplexMatrix::Create_FFT_Plan_1DY_R2C | ( | TRealMatrix & | InMatrix | ) |
Create an FFTW plan for 1D Real-to-Complex in the Y dimension. There are two versions of this routine for GCC+FFTW and ICPC + MKL, otherwise it will not build! The FFTW version processes the whole matrix at one while the MKL slab by slab
[in,out] | InMatrix | - RealMatrix of which to create the plan |
runtime_error | if the plan can't be created. |
Definition at line 243 of file FFTWComplexMatrix.cpp.
void TFFTWComplexMatrix::Create_FFT_Plan_1DZ_C2R | ( | TRealMatrix & | OutMatrix | ) |
Create FFTW plan for Complex-to-Real in the Z dimension. There are two versions of this routine for GCC+FFTW and ICPC + MKL, otherwise it will not build! The FFTW version processes the whole matrix at one while the MKL slab by slab
[in,out] | OutMatrix | - RealMatrix of which to create the plan. |
runtime_error | if the plan can't be created. |
Definition at line 539 of file FFTWComplexMatrix.cpp.
void TFFTWComplexMatrix::Create_FFT_Plan_1DZ_R2C | ( | TRealMatrix & | InMatrix | ) |
Create an FFTW plan for 1D Real-to-Complex in the Z dimension. There are two versions of this routine for GCC+FFTW and ICPC + MKL, otherwise it will not build! The FFTW version processes the whole matrix at one while the MKL slab by slab
[in,out] | InMatrix | - RealMatrix of which to create the plan |
runtime_error | if the plan can't be created. |
Definition at line 319 of file FFTWComplexMatrix.cpp.
void TFFTWComplexMatrix::Create_FFT_Plan_3D_C2R | ( | TRealMatrix & | OutMatrix | ) |
Create an FFTW plan for 3D Complex-to-Real.
[in,out] | OutMatrix | - RealMatrix of which to create the plan. |
runtime_error | if the plan can't be created. |
Definition at line 140 of file FFTWComplexMatrix.cpp.
void TFFTWComplexMatrix::Create_FFT_Plan_3D_R2C | ( | TRealMatrix & | InMatrix | ) |
Create an FFTW plan for 3D Real-to-Complex.
[in,out] | InMatrix | - RealMatrix of which to create the plan |
runtime_error | if the plan can't be created. |
Definition at line 115 of file FFTWComplexMatrix.cpp.
|
static |
Delete stored wisdom (delete the file).
Definition at line 903 of file FFTWComplexMatrix.cpp.
|
static |
Export wisdom to the file.
Definition at line 869 of file FFTWComplexMatrix.cpp.
|
protectedvirtual |
Free memory using fftwf_free.
Reimplemented from TBaseFloatMatrix.
Definition at line 942 of file FFTWComplexMatrix.cpp.
|
staticprotected |
Get Wisdom file name (derive it form the checkpoint filename).
Definition at line 953 of file FFTWComplexMatrix.cpp.
|
static |
Import wisdom from the file.
Definition at line 888 of file FFTWComplexMatrix.cpp.