fft.H
Go to the documentation of this file.
1/*---------------------------------------------------------------------------*\
2 ========= |
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4 \\ / O peration |
5 \\ / A nd | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2011 OpenFOAM Foundation
9 Copyright (C) 2016-2018 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27Class
28 Foam::fft
29
30Description
31 Fast fourier transform using the fftw library.
32
33 The complex transform field is returned in the field supplied. The
34 direction of transform is supplied as an argument (-1 = forward, 1 =
35 reverse). The dimensionality and organisation of the array of values
36 in space is supplied in the nn indexing array.
37
38Note
39 The fftw library uses int only (no longs) for its dimensionality.
40
41SourceFiles
42 fft.C
43
44\*---------------------------------------------------------------------------*/
45
46#ifndef fft_H
47#define fft_H
48
49#include "complexFields.H"
50
51// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
52
53namespace Foam
54{
56class fft
57{
58
59public:
62 {
65 };
66
67 static void fftRenumberRecurse
68 (
70 List<complex>& renumData,
71 const UList<int>& nn,
72 label nnprod,
73 label ii,
74 label l1,
75 label l2
76 );
77
78 //- fftRenumber: fold the n-d data array to get the fft components in
79 //- the right places.
80 static void fftRenumber(List<complex>& data, const UList<int>& nn);
81
82 //- Transform real-value data
83 // - uses the fftw real to half-complex method
84 // - result size is field.size()/2 + 1
86
87
88 //- Transform real-value data
89 // - uses the fftw real to half-complex method
90 // - result size is field.size()/2 + 1
92
93
94 //- Transform complex-value data
95 static void transform
96 (
98 const UList<int>& nn,
99 transformDirection fftDirection
100 );
101
102
104 (
106 const UList<int>& nn
107 );
108
109
111 (
113 const UList<int>& nn
114 );
115
116
118 (
120 const UList<int>& nn
121 );
122
123
125 (
127 const UList<int>& nn
128 );
129};
130
131
132// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
133
134} // End namespace Foam
135
136// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
137
138#endif
139
140// ************************************************************************* //
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: List.H:77
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
Definition: UList.H:94
Database for solution data, solver performance and other reduced data.
Definition: data.H:58
Fast fourier transform using the fftw library.
Definition: fft.H:56
static tmp< complexField > realTransform1D(const scalarField &field)
Transform real-value data.
Definition: fft.C:120
static tmp< complexField > forwardTransform(const tmp< complexField > &field, const UList< int > &nn)
Definition: fft.C:243
static void transform(complexField &field, const UList< int > &nn, transformDirection fftDirection)
Transform complex-value data.
Definition: fft.C:179
transformDirection
Definition: fft.H:61
@ REVERSE_TRANSFORM
The sign +1 = FFTW_BACKWARD.
Definition: fft.H:63
@ FORWARD_TRANSFORM
The sign -1 = FFTW_FORWARD.
Definition: fft.H:62
static tmp< complexField > reverseTransform(const tmp< complexField > &field, const UList< int > &nn)
Definition: fft.C:259
static void fftRenumber(List< complex > &data, const UList< int > &nn)
Definition: fft.C:94
static void fftRenumberRecurse(List< complex > &data, List< complex > &renumData, const UList< int > &nn, label nnprod, label ii, label l1, label l2)
Definition: fft.C:35
A class for managing temporary objects.
Definition: tmp.H:65
rDeltaTY field()
Specialisations of Field<T> for complex and complexVector.
Namespace for OpenFOAM.