Nektar++
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
library
LibUtilities
FFT
NekFFTW.h
Go to the documentation of this file.
1
///////////////////////////////////////////////////////////////////////////////
2
//
3
// File NekFFTW.h
4
//
5
// For more information, please see: http://www.nektar.info
6
//
7
// The MIT License
8
//
9
// Copyright (c) 2006 Division of Applied Mathematics, Brown University (USA),
10
// Department of Aeronautics, Imperial College London (UK), and Scientific
11
// Computing and Imaging Institute, University of Utah (USA).
12
//
13
// License for the specific language governing rights and limitations under
14
// Permission is hereby granted, free of charge, to any person obtaining a
15
// copy of this software and associated documentation files (the "Software"),
16
// to deal in the Software without restriction, including without limitation
17
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
18
// and/or sell copies of the Software, and to permit persons to whom the
19
// Software is furnished to do so, subject to the following conditions:
20
//
21
// The above copyright notice and this permission notice shall be included
22
// in all copies or substantial portions of the Software.
23
//
24
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
25
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
27
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
28
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
29
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
30
// DEALINGS IN THE SOFTWARE.
31
//
32
// Description: Header file for the wrapper around FFTW library
33
//
34
///////////////////////////////////////////////////////////////////////////////
35
36
#ifndef NEKTAR_LIB_UTILIITIES_FFT_NEKFFTW_H
37
#define NEKTAR_LIB_UTILIITIES_FFT_NEKFFTW_H
38
39
#include <
LibUtilities/FFT/NektarFFT.h
>
40
41
#include <
LibUtilities/BasicUtils/NekManager.hpp
>
42
#include <
LibUtilities/BasicUtils/SharedArray.hpp
>
43
#include <
LibUtilities/Memory/NekMemoryManager.hpp
>
44
#include <
LibUtilities/BasicConst/NektarUnivTypeDefs.hpp
>
45
#include <
LibUtilities/BasicConst/NektarUnivConsts.hpp
>
46
47
#include <fftw3.h>
48
49
namespace
Nektar
50
{
51
template
<
typename
Dim,
typename
DataType>
52
class
Array;
53
54
namespace
LibUtilities
55
{
56
class
NekFFTW
;
57
58
// A shared pointer to the NekFFTW object
59
typedef
boost::shared_ptr<NekFFTW>
NekFFTWSharedPtr
;
60
61
class
NekFFTW
:
public
NektarFFT
62
{
63
public
:
64
65
/// Creates an instance of this class
66
static
NektarFFTSharedPtr
create
(
int
N)
67
{
68
return
MemoryManager<NekFFTW>::AllocateSharedPtr
(N);
69
}
70
71
/// Name of class
72
static
std::string
className
;
73
74
// constructor (initialisation of the FFTW planes and fill up the m_FFTW_w vector)
75
NekFFTW
(
int
N);
76
77
// Distructor
78
virtual
~NekFFTW
();
79
80
81
82
virtual
void
v_FFTFwdTrans
(Array<OneD,NekDouble> &inarray, Array<OneD,NekDouble> &outarray);
83
84
virtual
void
v_FFTBwdTrans
(Array<OneD,NekDouble> &inarray, Array<OneD,NekDouble> &outarray);
85
86
87
88
protected
:
89
90
Array<OneD,NekDouble>
m_FFTW_w
;
// weights to convert arrays form Nektar++ to FFTW format
91
Array<OneD,NekDouble>
m_FFTW_w_inv
;
// weights to convert arrays from FFTW to Nektar++ format
92
93
Array<OneD,NekDouble>
phys
;
94
Array<OneD,NekDouble>
coef
;
95
96
Array<OneD,NekDouble>
m_wsp
;
// Workspace area for transforms
97
98
fftw_plan
plan_backward
;
// plan to execute a backward FFT in FFTW
99
fftw_plan
plan_forward
;
// plan to execute a forward FFT in FFTW
100
/**
101
* Reshuffling routines to put the coefficients in Nektar++/FFTW format.
102
* The routines take as an input the number of points N, the vector of coeffcients
103
* and the vector containing the weights of the numerical integration.
104
* The routines modify directly the coef vector.
105
*/
106
void
Reshuffle_FFTW2Nek
(Array<OneD,NekDouble> &
coef
);
107
108
void
Reshuffle_Nek2FFTW
(Array<OneD,NekDouble> &
coef
);
109
110
111
112
private
:
113
};
114
115
}
//end namespace LibUtilities
116
}
//end of namespace Nektar
117
#endif //NEKTAR_LIB_UTILIITIES_FFT_NEKFFTW_H
Generated on Sun Mar 15 2015 00:11:33 for Nektar++ by
1.8.1.2