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
46#include <fftw3.h>
47
48namespace Nektar
49{
50template <typename Dim, typename DataType> class Array;
51
52namespace LibUtilities
53{
54class NekFFTW;
55
56// A shared pointer to the NekFFTW object
57typedef std::shared_ptr<NekFFTW> NekFFTWSharedPtr;
58
59class NekFFTW : public NektarFFT
60{
61public:
62 /// Creates an instance of this class
67
68 /// Name of class
69 static std::string className;
70
71 // constructor (initialisation of the FFTW planes and fill up the m_FFTW_w
72 // vector)
73 NekFFTW(int N);
74
75 // Distructor
76 ~NekFFTW() override;
77
78protected:
80 m_FFTW_w; // weights to convert arrays form Nektar++ to FFTW format
82 m_FFTW_w_inv; // weights to convert arrays from FFTW to Nektar++ format
83
84 Array<OneD, NekDouble> m_wsp; // Workspace area for transforms
85
86 fftw_plan m_plan_backward; // plan to execute a backward FFT in FFTW
87 fftw_plan m_plan_forward; // plan to execute a forward FFT in FFTW
88
90 Array<OneD, NekDouble> &outarray) override;
91
93 Array<OneD, NekDouble> &outarray) override;
94
95private:
96};
97
98} // end namespace LibUtilities
99} // end of namespace Nektar
100#endif // NEKTAR_LIB_UTILIITIES_FFT_NEKFFTW_H
void v_FFTBwdTrans(Array< OneD, NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
Definition NekFFTW.cpp:98
static NektarFFTSharedPtr create(int N)
Creates an instance of this class.
Definition NekFFTW.h:63
static std::string className
Name of class.
Definition NekFFTW.h:69
void v_FFTFwdTrans(Array< OneD, NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
Definition NekFFTW.cpp:77
Array< OneD, NekDouble > m_wsp
Definition NekFFTW.h:84
Array< OneD, NekDouble > m_FFTW_w
Definition NekFFTW.h:80
Array< OneD, NekDouble > m_FFTW_w_inv
Definition NekFFTW.h:82
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:57