Nektar++
FourierSingleModePoints.h
Go to the documentation of this file.
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 // File FourierSingleMode.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 
41 #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(const PointsKey &key);
55  LIB_UTILITIES_EXPORT std::shared_ptr< NekMatrix<NekDouble> > CreateMatrix(const PointsKey &pkey);
56 
59  LIB_UTILITIES_EXPORT const MatrixSharedPtrType GetI(unsigned int numpoints, const Array<OneD, const NekDouble>& x);
60 
62  {
63  namespace pl = std::placeholders;
64  m_InterpManager.RegisterCreator(PointsKey(0, eGaussGaussLegendre),
65  std::bind(&FourierSingleModePoints::CreateMatrix, this, pl::_1));
67  std::bind(&FourierSingleModePoints::CreateMatrix, this, pl::_1));
69  std::bind(&FourierSingleModePoints::CreateMatrix, this, pl::_1));
71  std::bind(&FourierSingleModePoints::CreateMatrix, this, pl::_1));
73  std::bind(&FourierSingleModePoints::CreateMatrix, this, pl::_1));
75  std::bind(&FourierSingleModePoints::CreateMatrix, this, pl::_1));
77  std::bind(&FourierSingleModePoints::CreateMatrix, this, pl::_1));
79  std::bind(&FourierSingleModePoints::CreateMatrix, this, pl::_1));
81  std::bind(&FourierSingleModePoints::CreateMatrix, this, pl::_1));
83  std::bind(&FourierSingleModePoints::CreateMatrix, this, pl::_1));
85  std::bind(&FourierSingleModePoints::CreateMatrix, this, pl::_1));
87  std::bind(&FourierSingleModePoints::CreateMatrix, this, pl::_1));
88  m_InterpManager.RegisterCreator(PointsKey(0, ePolyEvenlySpaced),
89  std::bind(&FourierSingleModePoints::CreateMatrix, this, pl::_1));
91  std::bind(&FourierSingleModePoints::CreateMatrix, this, pl::_1));
93  std::bind(&FourierSingleModePoints::CreateMatrix, this, pl::_1));
94  }
95 
96  private:
97  static bool initPointsManager[];
98 
99  /// Default constructor should not be called except by Create method.
101 
102  /// Copy constructor should not be called.
104 
105  void CalculatePoints();
106  void CalculateWeights();
107  void CalculateDerivMatrix();
108 
109  void CalculateInterpMatrix(unsigned int npts, const Array<OneD, const NekDouble>& xpoints,
110  Array<OneD, NekDouble>& interp);
112  }; // class FourierPoints
113  } // end of namespace
114 } // end of namespace
115 
116 
117 #endif //FOURIERSINGLEMODEPOINTS_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
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
#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
FourierSingleModePoints()
Default constructor should not be called except by Create method.
static std::shared_ptr< PointsBaseType > Create(const PointsKey &key)
NekDouble PeriodicSincFunction(const NekDouble x, const NekDouble h)
1D Non Evenly-spaced points for Single Mode analysis
Definition: PointsType.h:66
Gauss Radau pinned at x=-1, .
Definition: PointsType.h:59
const MatrixSharedPtrType GetI(const PointsKey &pkey)
Gauss Radau pinned at x=-1, .
Definition: PointsType.h:57
Gauss Radau pinned at x=-1, .
Definition: PointsType.h:56
std::shared_ptr< NekMatrix< NekDouble > > CreateMatrix(const PointsKey &pkey)
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