Go to the documentation of this file.
60 for (label i=0; i<nn[ii]; i++)
96 List<complex> renumData(data);
104 label ii(0), l1(0), l2(0);
122 const label
n =
field.size();
123 const label nBy2 =
n/2;
132 for (label i=0; i <
n; ++i)
138 fftw_plan plan = fftw_plan_r2r_1d
151 auto& result = tresult.ref();
153 result[0].Re() = out[0];
154 result[nBy2].Re() = out[nBy2];
155 for (label i = 1; i < nBy2; ++i)
157 result[i].Re() = out[i];
158 result[i].Im() = out[
n - i];
161 fftw_destroy_plan(plan);
182 transformDirection dir
186 const label
N =
field.size();
188 fftw_complex* inPtr =
189 static_cast<fftw_complex*
>(fftw_malloc(
sizeof(fftw_complex)*
N));
190 fftw_complex* outPtr =
191 static_cast<fftw_complex*
>(fftw_malloc(
sizeof(fftw_complex)*
N));
194 if (dir == REVERSE_TRANSFORM)
196 fftRenumber(
field, nn);
201 inPtr[i][0] =
field[i].Re();
202 inPtr[i][1] =
field[i].Im();
214 const label rank = nn.
size();
216 fftw_plan_dft(rank, nn.
begin(), inPtr, outPtr, dir, FFTW_ESTIMATE);
223 field[i].Re() = outPtr[i][0];
224 field[i].Im() = outPtr[i][1];
227 fftw_destroy_plan(plan);
233 if (dir == FORWARD_TRANSFORM)
235 fftRenumber(
field, nn);
244 const tmp<complexField>& tfield,
284 tresult.
ref().replace
287 forwardTransform(tfield().
component(cmpt), nn)
307 tresult.
ref().replace
310 reverseTransform(tfield().
component(cmpt), nn)
void component(FieldField< Field, typename FieldField< Field, Type >::cmptType > &sf, const FieldField< Field, Type > &f, const direction d)
void clear() const noexcept
A class for managing temporary objects.
dimensionSet transform(const dimensionSet &ds)
static tmp< complexField > reverseTransform(const tmp< complexField > &field, const UList< int > &nn)
scalarField Im(const UList< complex > &cf)
Generic templated field type.
static void fftRenumber(List< complex > &data, const UList< int > &nn)
static void fftRenumberRecurse(List< complex > &data, List< complex > &renumData, const UList< int > &nn, label nnprod, label ii, label l1, label l2)
static void transform(complexField &field, const UList< int > &nn, transformDirection fftDirection)
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
scalarField Re(const UList< complex > &cf)
static tmp< complexField > forwardTransform(const tmp< complexField > &field, const UList< int > &nn)
static tmp< T > New(Args &&... args)
iterator begin() noexcept
const Vector< label > N(dict.get< Vector< label >>("N"))
Database for solution data, solver performance and other reduced data.
static constexpr direction nComponents
static tmp< complexField > realTransform1D(const scalarField &field)