COMP: fftw needs int (not long) for its dimensionality (issue #175)

- explicitly use List<int> instead List<label> for API compatibility,
  even when 64-bit labels are in use.
This commit is contained in:
Mark Olesen
2016-07-07 11:20:28 +02:00
parent b99515ea95
commit fcb0b3a42d
5 changed files with 19 additions and 16 deletions

View File

@ -35,7 +35,7 @@ inline Foam::label Foam::Kmesh::index
const label i, const label i,
const label j, const label j,
const label k, const label k,
const labelList& nn const UList<int>& nn
) )
{ {
return (k + j*nn[2] + i*nn[1]*nn[2]); return (k + j*nn[2] + i*nn[1]*nn[2]);

View File

@ -57,7 +57,7 @@ class Kmesh
vector l_; vector l_;
//- Multi-dimensional addressing array //- Multi-dimensional addressing array
labelList nn_; List<int> nn_;
//- Maximum wavenumber //- Maximum wavenumber
scalar kmax_; scalar kmax_;
@ -71,7 +71,7 @@ class Kmesh
const label i, const label i,
const label j, const label j,
const label k, const label k,
const labelList& nn const UList<int>& nn
); );
@ -92,7 +92,7 @@ public:
return l_; return l_;
} }
const labelList& nn() const const List<int>& nn() const
{ {
return nn_; return nn_;
} }

View File

@ -37,7 +37,7 @@ namespace Foam
void fft::transform void fft::transform
( (
complexField& field, complexField& field,
const labelList& nn, const UList<int>& nn,
transformDirection dir transformDirection dir
) )
{ {
@ -112,7 +112,7 @@ void fft::transform
tmp<complexField> fft::forwardTransform tmp<complexField> fft::forwardTransform
( (
const tmp<complexField>& tfield, const tmp<complexField>& tfield,
const labelList& nn const UList<int>& nn
) )
{ {
tmp<complexField> tfftField(new complexField(tfield)); tmp<complexField> tfftField(new complexField(tfield));
@ -128,7 +128,7 @@ tmp<complexField> fft::forwardTransform
tmp<complexField> fft::reverseTransform tmp<complexField> fft::reverseTransform
( (
const tmp<complexField>& tfield, const tmp<complexField>& tfield,
const labelList& nn const UList<int>& nn
) )
{ {
tmp<complexField> tifftField(new complexField(tfield)); tmp<complexField> tifftField(new complexField(tfield));
@ -144,7 +144,7 @@ tmp<complexField> fft::reverseTransform
tmp<complexVectorField> fft::forwardTransform tmp<complexVectorField> fft::forwardTransform
( (
const tmp<complexVectorField>& tfield, const tmp<complexVectorField>& tfield,
const labelList& nn const UList<int>& nn
) )
{ {
tmp<complexVectorField> tfftVectorField tmp<complexVectorField> tfftVectorField
@ -173,7 +173,7 @@ tmp<complexVectorField> fft::forwardTransform
tmp<complexVectorField> fft::reverseTransform tmp<complexVectorField> fft::reverseTransform
( (
const tmp<complexVectorField>& tfield, const tmp<complexVectorField>& tfield,
const labelList& nn const UList<int>& nn
) )
{ {
tmp<complexVectorField> tifftVectorField tmp<complexVectorField> tifftVectorField

View File

@ -32,6 +32,9 @@ Description
reverse). The dimensionality and organisation of the array of values reverse). The dimensionality and organisation of the array of values
in space is supplied in the nn indexing array. in space is supplied in the nn indexing array.
Note
The fftw library uses int only (no longs) for its dimensionality.
SourceFiles SourceFiles
fft.C fft.C
@ -41,7 +44,7 @@ SourceFiles
#define fft_H #define fft_H
#include "complexFields.H" #include "complexFields.H"
#include "labelList.H" #include "UList.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -63,7 +66,7 @@ public:
static void transform static void transform
( (
complexField& field, complexField& field,
const labelList& nn, const UList<int>& nn,
transformDirection fftDirection transformDirection fftDirection
); );
@ -71,28 +74,28 @@ public:
static tmp<complexField> forwardTransform static tmp<complexField> forwardTransform
( (
const tmp<complexField>& field, const tmp<complexField>& field,
const labelList& nn const UList<int>& nn
); );
static tmp<complexField> reverseTransform static tmp<complexField> reverseTransform
( (
const tmp<complexField>& field, const tmp<complexField>& field,
const labelList& nn const UList<int>& nn
); );
static tmp<complexVectorField> forwardTransform static tmp<complexVectorField> forwardTransform
( (
const tmp<complexVectorField>& field, const tmp<complexVectorField>& field,
const labelList& nn const UList<int>& nn
); );
static tmp<complexVectorField> reverseTransform static tmp<complexVectorField> reverseTransform
( (
const tmp<complexVectorField>& field, const tmp<complexVectorField>& field,
const labelList& nn const UList<int>& nn
); );
}; };

View File

@ -246,7 +246,7 @@ Foam::tmp<Foam::scalarField> Foam::noiseFFT::Pf
fft::reverseTransform fft::reverseTransform
( (
ReComplexField(tpn), ReComplexField(tpn),
labelList(1, tpn().size()) List<int>(1, tpn().size())
) )
) )
); );