Nektar++
FourierSingleModePoints.h
Go to the documentation of this file.
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 // File: FourierSingleModePoints.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 of 1D Fourier Single Mode space distribution
32 //
33 ///////////////////////////////////////////////////////////////////////////////
34 
35 #ifndef FOURIERSINGLEMODEPOINTS_H
36 #define FOURIERSINGLEMODEPOINTS_H
37 
38 #include <LibUtilities/BasicUtils/NekManager.hpp> // for NekManager
42 
43 namespace Nektar
44 {
45 namespace LibUtilities
46 {
47 class FourierSingleModePoints : public Points<NekDouble>
48 {
49 public:
51  {
52  }
53 
54  LIB_UTILITIES_EXPORT static std::shared_ptr<PointsBaseType> Create(
55  const PointsKey &key);
56  LIB_UTILITIES_EXPORT std::shared_ptr<NekMatrix<NekDouble>> CreateMatrix(
57  const PointsKey &pkey);
58 
60  {
61  namespace pl = std::placeholders;
62  m_InterpManager.RegisterCreator(
64  std::bind(&FourierSingleModePoints::CreateMatrix, this, pl::_1));
65  m_InterpManager.RegisterCreator(
67  std::bind(&FourierSingleModePoints::CreateMatrix, this, pl::_1));
68  m_InterpManager.RegisterCreator(
70  std::bind(&FourierSingleModePoints::CreateMatrix, this, pl::_1));
71  m_InterpManager.RegisterCreator(
73  std::bind(&FourierSingleModePoints::CreateMatrix, this, pl::_1));
74  m_InterpManager.RegisterCreator(
76  std::bind(&FourierSingleModePoints::CreateMatrix, this, pl::_1));
77  m_InterpManager.RegisterCreator(
79  std::bind(&FourierSingleModePoints::CreateMatrix, this, pl::_1));
80  m_InterpManager.RegisterCreator(
82  std::bind(&FourierSingleModePoints::CreateMatrix, this, pl::_1));
83  m_InterpManager.RegisterCreator(
85  std::bind(&FourierSingleModePoints::CreateMatrix, this, pl::_1));
86  m_InterpManager.RegisterCreator(
88  std::bind(&FourierSingleModePoints::CreateMatrix, this, pl::_1));
89  m_InterpManager.RegisterCreator(
90  PointsKey(0, eGaussRadauMAlpha0Beta2),
91  std::bind(&FourierSingleModePoints::CreateMatrix, this, pl::_1));
92  m_InterpManager.RegisterCreator(
93  PointsKey(0, eGaussRadauMAlpha1Beta0),
94  std::bind(&FourierSingleModePoints::CreateMatrix, this, pl::_1));
95  m_InterpManager.RegisterCreator(
96  PointsKey(0, eGaussRadauMAlpha2Beta0),
97  std::bind(&FourierSingleModePoints::CreateMatrix, this, pl::_1));
98  m_InterpManager.RegisterCreator(
100  std::bind(&FourierSingleModePoints::CreateMatrix, this, pl::_1));
101  m_InterpManager.RegisterCreator(
103  std::bind(&FourierSingleModePoints::CreateMatrix, this, pl::_1));
104  m_InterpManager.RegisterCreator(
106  std::bind(&FourierSingleModePoints::CreateMatrix, this, pl::_1));
107  }
108 
109 protected:
111  const PointsKey &pkey) override;
113  const Array<OneD, const NekDouble> &x) override;
115  unsigned int numpoints, const Array<OneD, const NekDouble> &x) override;
116 
117 private:
118  static bool initPointsManager[];
119 
120  /// Default constructor should not be called except by Create method.
122 
123  /// Copy constructor should not be called.
125 
126  virtual void v_CalculatePoints() override;
127  virtual void v_CalculateWeights() override;
128  virtual void v_CalculateDerivMatrix() override;
129 
130  void CalculateInterpMatrix(unsigned int npts,
131  const Array<OneD, const NekDouble> &xpoints,
132  Array<OneD, NekDouble> &interp);
133 
135 }; // class FourierPoints
136 } // namespace LibUtilities
137 } // namespace Nektar
138 
139 #endif // FOURIERSINGLEMODEPOINTS_H
#define LIB_UTILITIES_EXPORT
std::shared_ptr< NekMatrix< NekDouble > > MatrixSharedPtrType
static std::shared_ptr< PointsBaseType > Create(const PointsKey &key)
FourierSingleModePoints(const FourierSingleModePoints &points)
Copy constructor should not be called.
FourierSingleModePoints()
Default constructor should not be called except by Create method.
void CalculateInterpMatrix(unsigned int npts, const Array< OneD, const NekDouble > &xpoints, Array< OneD, NekDouble > &interp)
std::shared_ptr< NekMatrix< NekDouble > > CreateMatrix(const PointsKey &pkey)
virtual const MatrixSharedPtrType v_GetI(const PointsKey &pkey) override
NekDouble PeriodicSincFunction(const NekDouble x, const NekDouble h)
Stores a set of points of datatype DataT, defined by a PointKey.
Definition: Points.h:254
NekManager< PointsKey, NekMatrix< DataType >, PointsKey::opLess > m_InterpManager
Definition: Points.h:383
Defines a specification for a set of points.
Definition: Points.h:59
@ eGaussRadauMLegendre
1D Gauss-Radau-Legendre quadrature points, pinned at x=-1
Definition: PointsType.h:49
@ eGaussRadauMAlpha0Beta1
Gauss Radau pinned at x=-1,.
Definition: PointsType.h:60
@ eGaussLobattoChebyshev
1D Gauss-Lobatto-Legendre quadrature points
Definition: PointsType.h:59
@ eFourierEvenlySpaced
1D Evenly-spaced points using Fourier Fit
Definition: PointsType.h:76
@ eGaussRadauPChebyshev
1D Gauss-Radau-Chebyshev quadrature points, pinned at x=1
Definition: PointsType.h:57
@ eGaussRadauMChebyshev
1D Gauss-Radau-Chebyshev quadrature points, pinned at x=-1
Definition: PointsType.h:55
@ eGaussLobattoLegendre
1D Gauss-Lobatto-Legendre quadrature points
Definition: PointsType.h:53
@ eGaussGaussChebyshev
1D Gauss-Gauss-Chebyshev quadrature points
Definition: PointsType.h:54
@ ePolyEvenlySpaced
1D Evenly-spaced points using Lagrange polynomial
Definition: PointsType.h:75
@ eGaussGaussLegendre
1D Gauss-Gauss-Legendre quadrature points
Definition: PointsType.h:48
@ eFourierSingleModeSpaced
1D Non Evenly-spaced points for Single Mode analysis
Definition: PointsType.h:77
@ eGaussRadauPLegendre
1D Gauss-Radau-Legendre quadrature points, pinned at x=1
Definition: PointsType.h:51
The above copyright notice and this permission notice shall be included.
Definition: CoupledSolver.h:2
double NekDouble