Nektar++
NektarFFT.h
Go to the documentation of this file.
1///////////////////////////////////////////////////////////////////////////////
2//
3// File: NektarFFT.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// Permission is hereby granted, free of charge, to any person obtaining a
14// copy of this software and associated documentation files (the "Software"),
15// to deal in the Software without restriction, including without limitation
16// the rights to use, copy, modify, merge, publish, distribute, sublicense,
17// and/or sell copies of the Software, and to permit persons to whom the
18// Software is furnished to do so, subject to the following conditions:
19//
20// The above copyright notice and this permission notice shall be included
21// in all copies or substantial portions of the Software.
22//
23// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
24// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
26// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
28// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
29// DEALINGS IN THE SOFTWARE.
30//
31// Description: Header file for the Fast Fourier Transform class in Nektar++
32//
33///////////////////////////////////////////////////////////////////////////////
34
35#ifndef NEKTAR_LIB_UTILIITIES_FFT_NEKTARFFT_H
36#define NEKTAR_LIB_UTILIITIES_FFT_NEKTARFFT_H
37
41
42namespace Nektar
43{
44template <typename Dim, typename DataType> class Array;
45
46namespace LibUtilities
47{
48/**
49 * The NektarFFT class is a virtual class to manage the use of the FFT to do
50 * Fwd/Bwd transformations and convolutions. The function here defined will link
51 * to a proper implementation of the FFT algorithm. Depending on the user
52 * definition the functions can link to a class which is a wrapper around the
53 * FFTW library or to a specific FFT implementation.
54 */
55class NektarFFT;
56
57// A shared pointer to the NektarFFT object
58typedef std::shared_ptr<NektarFFT> NektarFFTSharedPtr;
59
60/// Datatype of the NekFactory used to instantiate classes derived from
61/// the NektarFFT class.
63
65
67{
68public:
69 /// Initialises NektarFFT class members.
71
72 // Distructor
74
75 /**
76 * m_N is the dimension of the Fourier transform.
77 * It means that the coefficient vector and the vector of the variable in
78 * physical space have size m_N. It is becasue everything is managed just
79 * with real data.
80 */
81 int m_N;
82
83 /**
84 * Forward transformation to pass from physical to coefficient space using
85 * the FFT. This method will take the place of the Matrix-Vector
86 * multiplication input: N = number of Fourier points inarray =
87 * vector in physical space (length N) output: outarray = vector in
88 * coefficient space (length N)
89 */
92
93 /**
94 * Backward transformation to pass from coefficient to physical space using
95 * the FFT. This method will take the place of the Matrix-Vector
96 * multiplication input: N = number of Fourier points inarrray =
97 * vector in coefficient space (length N) output: outarray = vector in
98 * physical space (length N)
99 */
102
103protected:
104 virtual void v_FFTFwdTrans(Array<OneD, NekDouble> &phys,
106
107 virtual void v_FFTBwdTrans(Array<OneD, NekDouble> &coef,
109
110private:
111};
112} // end namespace LibUtilities
113} // end of namespace Nektar
114#endif // NEKTAR_LIB_UTILIITIES_FFT_NEKTARFFT_H
#define LIB_UTILITIES_EXPORT
Provides a generic Factory class.
virtual void v_FFTBwdTrans(Array< OneD, NekDouble > &coef, Array< OneD, NekDouble > &phys)
Definition: NektarFFT.cpp:94
void FFTBwdTrans(Array< OneD, NekDouble > &coef, Array< OneD, NekDouble > &phys)
Definition: NektarFFT.cpp:83
void FFTFwdTrans(Array< OneD, NekDouble > &phy, Array< OneD, NekDouble > &coef)
Definition: NektarFFT.cpp:77
virtual void v_FFTFwdTrans(Array< OneD, NekDouble > &phys, Array< OneD, NekDouble > &coef)
Definition: NektarFFT.cpp:89
NektarFFT(int N)
Initialises NektarFFT class members.
Definition: NektarFFT.cpp:56
NektarFFTFactory & GetNektarFFTFactory()
Definition: NektarFFT.cpp:65
LibUtilities::NekFactory< std::string, NektarFFT, int > NektarFFTFactory
Datatype of the NekFactory used to instantiate classes derived from the NektarFFT class.
Definition: NektarFFT.h:62
std::shared_ptr< NektarFFT > NektarFFTSharedPtr
Definition: NektarFFT.h:58