Nektar++
Loading...
Searching...
No Matches
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// 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 wrapper around FFTW library
32//
33///////////////////////////////////////////////////////////////////////////////
34
35#ifndef NEKTAR_LIB_UTILIITIES_FFT_NEKFFTW_H
36#define NEKTAR_LIB_UTILIITIES_FFT_NEKFFTW_H
37
39
45
46namespace Nektar
47{
48template <typename Dim, typename DataType> class Array;
49
50namespace LibUtilities
51{
52class NekFFTW;
53
54// A shared pointer to the NekFFTW object
55typedef std::shared_ptr<NekFFTW> NekFFTWSharedPtr;
56
57class NekFFTW : public NektarFFT
58{
59public:
60 /// Creates an instance of this class
65
66 /// Name of class
67 static std::string className;
68
69 // constructor (initialisation of the FFTW planes and fill up the m_FFTW_w
70 // vector)
71 NekFFTW(int N);
72
73 // Distructor
74 ~NekFFTW() override;
75
76protected:
78 m_FFTW_w; // weights to convert arrays form Nektar++ to FFTW format
80 m_FFTW_w_inv; // weights to convert arrays from FFTW to Nektar++ format
81
82 Array<OneD, NekDouble> m_wsp; // Workspace area for transforms
83
84 void *m_plan_backward; // plan to execute a backward FFT in FFTW
85 void *m_plan_forward; // plan to execute a forward FFT in FFTW
86
88 Array<OneD, NekDouble> &outarray) override;
89
91 Array<OneD, NekDouble> &outarray) override;
92
93private:
94};
95
96} // end namespace LibUtilities
97} // end of namespace Nektar
98#endif // NEKTAR_LIB_UTILIITIES_FFT_NEKFFTW_H
void v_FFTBwdTrans(Array< OneD, NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
Definition NekFFTW.cpp:100
static NektarFFTSharedPtr create(int N)
Creates an instance of this class.
Definition NekFFTW.h:61
static std::string className
Name of class.
Definition NekFFTW.h:67
void v_FFTFwdTrans(Array< OneD, NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
Definition NekFFTW.cpp:79
Array< OneD, NekDouble > m_wsp
Definition NekFFTW.h:82
Array< OneD, NekDouble > m_FFTW_w
Definition NekFFTW.h:78
Array< OneD, NekDouble > m_FFTW_w_inv
Definition NekFFTW.h:80
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
std::shared_ptr< NektarFFT > NektarFFTSharedPtr
Definition NektarFFT.h:58
std::shared_ptr< NekFFTW > NekFFTWSharedPtr
Definition NekFFTW.h:55