Nektar++
FourierPoints.h
Go to the documentation of this file.
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 // File FourierPoints.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 Evenly-Spaced Point Definitions
32 //
33 ///////////////////////////////////////////////////////////////////////////////
34 
35 #ifndef FOURIERPOINTS_H
36 #define FOURIERPOINTS_H
37 
41 #include <LibUtilities/BasicUtils/NekManager.hpp> // for NekManager
42 
43 
44 namespace Nektar
45 {
46  namespace LibUtilities
47  {
48  class FourierPoints: public Points<NekDouble>
49  {
50  public:
51  virtual ~FourierPoints()
52  {
53  }
54 
55  LIB_UTILITIES_EXPORT static std::shared_ptr< PointsBaseType > Create(const PointsKey &key);
56  LIB_UTILITIES_EXPORT std::shared_ptr< NekMatrix<NekDouble> > CreateMatrix(const PointsKey &pkey);
57 
60  LIB_UTILITIES_EXPORT const MatrixSharedPtrType GetI(unsigned int numpoints, const Array<OneD, const NekDouble>& x);
61 
63  {
64  namespace pl = std::placeholders;
65  m_InterpManager.RegisterCreator(PointsKey(0, eGaussGaussLegendre),
66  std::bind(&FourierPoints::CreateMatrix, this, pl::_1));
68  std::bind(&FourierPoints::CreateMatrix, this, pl::_1));
70  std::bind(&FourierPoints::CreateMatrix, this, pl::_1));
72  std::bind(&FourierPoints::CreateMatrix, this, pl::_1));
74  std::bind(&FourierPoints::CreateMatrix, this, pl::_1));
76  std::bind(&FourierPoints::CreateMatrix, this, pl::_1));
78  std::bind(&FourierPoints::CreateMatrix, this, pl::_1));
80  std::bind(&FourierPoints::CreateMatrix, this, pl::_1));
82  std::bind(&FourierPoints::CreateMatrix, this, pl::_1));
84  std::bind(&FourierPoints::CreateMatrix, this, pl::_1));
86  std::bind(&FourierPoints::CreateMatrix, this, pl::_1));
88  std::bind(&FourierPoints::CreateMatrix, this, pl::_1));
89  m_InterpManager.RegisterCreator(PointsKey(0, ePolyEvenlySpaced),
90  std::bind(&FourierPoints::CreateMatrix, this, pl::_1));
92  std::bind(&FourierPoints::CreateMatrix, this, pl::_1));
93  }
94 
95  private:
96  static bool initPointsManager[];
97  /// Default constructor should not be called except by Create method.
98  FourierPoints();
99 
100  /// Copy constructor should not be called.
101  FourierPoints(const FourierPoints &points);
102 
103  void CalculatePoints();
104  void CalculateWeights();
105  void CalculateDerivMatrix();
106 
107  void CalculateInterpMatrix(unsigned int npts, const Array<OneD, const NekDouble>& xpoints,
108  Array<OneD, NekDouble>& interp);
110  }; // class FourierPoints
111  } // end of namespace
112 } // end of namespace
113 
114 
115 #endif //FOURIERPOINTS_H
1D Gauss-Radau-Chebyshev quadrature points, pinned at x=-1
Definition: PointsType.h:53
1D Gauss-Radau-Legendre quadrature points, pinned at x=1
Definition: PointsType.h:50
FourierPoints(const PointsKey &key)
Definition: FourierPoints.h:62
Stores a set of points of datatype DataT, defined by a PointKey.
1D Gauss-Gauss-Legendre quadrature points
Definition: PointsType.h:48
Gauss Radau pinned at x=-1, .
Definition: PointsType.h:58
1D Evenly-spaced points using Lagrange polynomial
Definition: PointsType.h:64
void CalculateInterpMatrix(unsigned int npts, const Array< OneD, const NekDouble > &xpoints, Array< OneD, NekDouble > &interp)
1D Evenly-spaced points using Fourier Fit
Definition: PointsType.h:65
std::shared_ptr< NekMatrix< DataType > > MatrixSharedPtrType
Definition: Points.h:254
const MatrixSharedPtrType GetI(const PointsKey &pkey)
#define LIB_UTILITIES_EXPORT
NekManager< PointsKey, NekMatrix< DataType >, PointsKey::opLess > m_InterpManager
Definition: Points.h:384
1D Gauss-Radau-Chebyshev quadrature points, pinned at x=1
Definition: PointsType.h:54
1D Gauss-Gauss-Chebyshev quadrature points
Definition: PointsType.h:52
Defines a specification for a set of points.
Definition: Points.h:59
double NekDouble
FourierPoints()
Default constructor should not be called except by Create method.
Gauss Radau pinned at x=-1, .
Definition: PointsType.h:59
static std::shared_ptr< PointsBaseType > Create(const PointsKey &key)
std::shared_ptr< NekMatrix< NekDouble > > CreateMatrix(const PointsKey &pkey)
NekDouble PeriodicSincFunction(const NekDouble x, const NekDouble h)
Gauss Radau pinned at x=-1, .
Definition: PointsType.h:57
Gauss Radau pinned at x=-1, .
Definition: PointsType.h:56
1D Gauss-Lobatto-Legendre quadrature points
Definition: PointsType.h:51
1D Gauss-Radau-Legendre quadrature points, pinned at x=-1
Definition: PointsType.h:49
1D Gauss-Lobatto-Legendre quadrature points
Definition: PointsType.h:55