fft Class Reference

Fast fourier transform using the fftw library. More...

Public Types

enum  transformDirection { FORWARD_TRANSFORM = -1, REVERSE_TRANSFORM = 1 }
 

Static Public Member Functions

static void fftRenumberRecurse (List< complex > &data, List< complex > &renumData, const UList< int > &nn, label nnprod, label ii, label l1, label l2)
 
static void fftRenumber (List< complex > &data, const UList< int > &nn)
 
static tmp< complexFieldrealTransform1D (const scalarField &field)
 Transform real-value data. More...
 
static tmp< complexFieldrealTransform1D (const tmp< scalarField > &field)
 Transform real-value data. More...
 
static void transform (complexField &field, const UList< int > &nn, transformDirection fftDirection)
 Transform complex-value data. More...
 
static tmp< complexFieldforwardTransform (const tmp< complexField > &field, const UList< int > &nn)
 
static tmp< complexFieldreverseTransform (const tmp< complexField > &field, const UList< int > &nn)
 
static tmp< complexVectorFieldforwardTransform (const tmp< complexVectorField > &field, const UList< int > &nn)
 
static tmp< complexVectorFieldreverseTransform (const tmp< complexVectorField > &field, const UList< int > &nn)
 

Detailed Description

Fast fourier transform using the fftw library.

The complex transform field is returned in the field supplied. The direction of transform is supplied as an argument (-1 = forward, 1 = reverse). The dimensionality and organisation of the array of values in space is supplied in the nn indexing array.

Note
The fftw library uses int only (no longs) for its dimensionality.
Source files

Definition at line 55 of file fft.H.

Member Enumeration Documentation

◆ transformDirection

Enumerator
FORWARD_TRANSFORM 

The sign -1 = FFTW_FORWARD.

REVERSE_TRANSFORM 

The sign +1 = FFTW_BACKWARD.

Definition at line 60 of file fft.H.

Member Function Documentation

◆ fftRenumberRecurse()

void fftRenumberRecurse ( List< complex > &  data,
List< complex > &  renumData,
const UList< int > &  nn,
label  nnprod,
label  ii,
label  l1,
label  l2 
)
static

Definition at line 35 of file fft.C.

References Foam::roots::complex, Foam::Im(), Foam::Re(), and UList< T >::size().

Referenced by fft::fftRenumber().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fftRenumber()

void fftRenumber ( List< complex > &  data,
const UList< int > &  nn 
)
static

fftRenumber: fold the n-d data array to get the fft components in the right places.

Definition at line 94 of file fft.C.

References fft::fftRenumberRecurse(), and forAll.

Here is the call graph for this function:

◆ realTransform1D() [1/2]

Foam::tmp< Foam::complexField > realTransform1D ( const scalarField field)
static

Transform real-value data.

  • uses the fftw real to half-complex method

result size is field.size()/2 + 1

Definition at line 120 of file fft.C.

References field(), n, and tmp< T >::New().

Referenced by noiseFFT::Pf(), and noiseModel::Pf().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ realTransform1D() [2/2]

Foam::tmp< Foam::complexField > realTransform1D ( const tmp< scalarField > &  field)
static

Transform real-value data.

  • uses the fftw real to half-complex method

result size is field.size()/2 + 1

Definition at line 168 of file fft.C.

References tmp< T >::clear().

Here is the call graph for this function:

◆ transform()

void transform ( complexField field,
const UList< int > &  nn,
transformDirection  fftDirection 
)
static

Transform complex-value data.

Definition at line 179 of file fft.C.

References UList< T >::begin(), field(), forAll, N(), and UList< T >::size().

Here is the call graph for this function:

◆ forwardTransform() [1/2]

Foam::tmp< Foam::complexField > forwardTransform ( const tmp< complexField > &  field,
const UList< int > &  nn 
)
static

Definition at line 243 of file fft.C.

References tmp< T >::clear(), tmp< T >::New(), and Foam::transform().

Referenced by energySpectrum::calcAndWriteSpectrum(), and Foam::calcEk().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ reverseTransform() [1/2]

Foam::tmp< Foam::complexField > reverseTransform ( const tmp< complexField > &  field,
const UList< int > &  nn 
)
static

Definition at line 259 of file fft.C.

References tmp< T >::clear(), tmp< T >::New(), and Foam::transform().

Referenced by turbGen::U().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ forwardTransform() [2/2]

Foam::tmp< Foam::complexVectorField > forwardTransform ( const tmp< complexVectorField > &  field,
const UList< int > &  nn 
)
static

Definition at line 275 of file fft.C.

References tmp< T >::clear(), Foam::component(), VectorSpace< Vector< scalar >, scalar, 3 >::nComponents, and tmp< T >::New().

Here is the call graph for this function:

◆ reverseTransform() [2/2]

Foam::tmp< Foam::complexVectorField > reverseTransform ( const tmp< complexVectorField > &  field,
const UList< int > &  nn 
)
static

Definition at line 298 of file fft.C.

References tmp< T >::clear(), Foam::component(), VectorSpace< Vector< scalar >, scalar, 3 >::nComponents, and tmp< T >::New().

Here is the call graph for this function:

The documentation for this class was generated from the following files: