Nektar++
GaussPoints.h
Go to the documentation of this file.
1///////////////////////////////////////////////////////////////////////////////
2//
3// File: GaussPoints.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 GaussPoints Distributions
32//
33///////////////////////////////////////////////////////////////////////////////
34
35#ifndef GAUSSPOINTS_H
36#define GAUSSPOINTS_H
37
39
40namespace Nektar
41{
42namespace LibUtilities
43{
44class GaussPoints : public Points<NekDouble>
45{
46public:
47 virtual ~GaussPoints()
48 {
49 }
50
51 LIB_UTILITIES_EXPORT static std::shared_ptr<Points<NekDouble>> Create(
52 const PointsKey &pkey);
53
54 LIB_UTILITIES_EXPORT std::shared_ptr<NekMatrix<NekDouble>> CreateMatrix(
55 const PointsKey &pkey);
56
57 LIB_UTILITIES_EXPORT std::shared_ptr<NekMatrix<NekDouble>> CreateGPMatrix(
58 const PointsKey &pkey);
59
61 {
62 namespace pl = std::placeholders;
63 m_InterpManager.RegisterCreator(
65 std::bind(&GaussPoints::CreateMatrix, this, pl::_1));
66 m_InterpManager.RegisterCreator(
68 std::bind(&GaussPoints::CreateMatrix, this, pl::_1));
69 m_InterpManager.RegisterCreator(
71 std::bind(&GaussPoints::CreateMatrix, this, pl::_1));
72 m_InterpManager.RegisterCreator(
74 std::bind(&GaussPoints::CreateMatrix, this, pl::_1));
75 m_InterpManager.RegisterCreator(
77 std::bind(&GaussPoints::CreateMatrix, this, pl::_1));
78 m_InterpManager.RegisterCreator(
80 std::bind(&GaussPoints::CreateMatrix, this, pl::_1));
81 m_InterpManager.RegisterCreator(
83 std::bind(&GaussPoints::CreateMatrix, this, pl::_1));
84 m_InterpManager.RegisterCreator(
86 std::bind(&GaussPoints::CreateMatrix, this, pl::_1));
87 m_InterpManager.RegisterCreator(
89 std::bind(&GaussPoints::CreateMatrix, this, pl::_1));
90 m_InterpManager.RegisterCreator(
91 PointsKey(0, eGaussRadauMAlpha0Beta2),
92 std::bind(&GaussPoints::CreateMatrix, this, pl::_1));
93 m_InterpManager.RegisterCreator(
94 PointsKey(0, eGaussRadauMAlpha1Beta0),
95 std::bind(&GaussPoints::CreateMatrix, this, pl::_1));
96 m_InterpManager.RegisterCreator(
97 PointsKey(0, eGaussRadauMAlpha2Beta0),
98 std::bind(&GaussPoints::CreateMatrix, this, pl::_1));
99 m_InterpManager.RegisterCreator(
100 PointsKey(0, eGaussKronrodLegendre),
101 std::bind(&GaussPoints::CreateMatrix, this, pl::_1));
102 m_InterpManager.RegisterCreator(
104 std::bind(&GaussPoints::CreateMatrix, this, pl::_1));
105 m_InterpManager.RegisterCreator(
107 std::bind(&GaussPoints::CreateMatrix, this, pl::_1));
108 m_InterpManager.RegisterCreator(
110 std::bind(&GaussPoints::CreateMatrix, this, pl::_1));
111 m_InterpManager.RegisterCreator(
113 std::bind(&GaussPoints::CreateMatrix, this, pl::_1));
114 m_InterpManager.RegisterCreator(
116 std::bind(&GaussPoints::CreateMatrix, this, pl::_1));
117 m_InterpManager.RegisterCreator(
119 std::bind(&GaussPoints::CreateMatrix, this, pl::_1));
120 m_InterpManager.RegisterCreator(
122 std::bind(&GaussPoints::CreateMatrix, this, pl::_1));
123 m_GalerkinProjectionManager.RegisterCreator(
125 std::bind(&GaussPoints::CreateGPMatrix, this, pl::_1));
126 m_GalerkinProjectionManager.RegisterCreator(
128 std::bind(&GaussPoints::CreateGPMatrix, this, pl::_1));
129 m_GalerkinProjectionManager.RegisterCreator(
131 std::bind(&GaussPoints::CreateGPMatrix, this, pl::_1));
132 m_GalerkinProjectionManager.RegisterCreator(
134 std::bind(&GaussPoints::CreateGPMatrix, this, pl::_1));
135 m_GalerkinProjectionManager.RegisterCreator(
137 std::bind(&GaussPoints::CreateGPMatrix, this, pl::_1));
138 m_GalerkinProjectionManager.RegisterCreator(
140 std::bind(&GaussPoints::CreateGPMatrix, this, pl::_1));
141 m_GalerkinProjectionManager.RegisterCreator(
143 std::bind(&GaussPoints::CreateGPMatrix, this, pl::_1));
144 m_GalerkinProjectionManager.RegisterCreator(
146 std::bind(&GaussPoints::CreateGPMatrix, this, pl::_1));
147 m_GalerkinProjectionManager.RegisterCreator(
149 std::bind(&GaussPoints::CreateGPMatrix, this, pl::_1));
150 m_GalerkinProjectionManager.RegisterCreator(
151 PointsKey(0, eGaussRadauMAlpha0Beta2),
152 std::bind(&GaussPoints::CreateGPMatrix, this, pl::_1));
153 m_GalerkinProjectionManager.RegisterCreator(
154 PointsKey(0, eGaussRadauMAlpha1Beta0),
155 std::bind(&GaussPoints::CreateGPMatrix, this, pl::_1));
156 m_GalerkinProjectionManager.RegisterCreator(
157 PointsKey(0, eGaussRadauMAlpha2Beta0),
158 std::bind(&GaussPoints::CreateGPMatrix, this, pl::_1));
159 m_GalerkinProjectionManager.RegisterCreator(
160 PointsKey(0, eGaussKronrodLegendre),
161 std::bind(&GaussPoints::CreateGPMatrix, this, pl::_1));
162 m_GalerkinProjectionManager.RegisterCreator(
164 std::bind(&GaussPoints::CreateGPMatrix, this, pl::_1));
165 m_GalerkinProjectionManager.RegisterCreator(
167 std::bind(&GaussPoints::CreateGPMatrix, this, pl::_1));
168 m_GalerkinProjectionManager.RegisterCreator(
170 std::bind(&GaussPoints::CreateGPMatrix, this, pl::_1));
171 m_GalerkinProjectionManager.RegisterCreator(
173 std::bind(&GaussPoints::CreateGPMatrix, this, pl::_1));
174 m_GalerkinProjectionManager.RegisterCreator(
176 std::bind(&GaussPoints::CreateGPMatrix, this, pl::_1));
177 m_GalerkinProjectionManager.RegisterCreator(
179 std::bind(&GaussPoints::CreateGPMatrix, this, pl::_1));
180 m_GalerkinProjectionManager.RegisterCreator(
182 std::bind(&GaussPoints::CreateGPMatrix, this, pl::_1));
183 }
184
185protected:
186 LIB_UTILITIES_EXPORT virtual const std::shared_ptr<NekMatrix<NekDouble>> v_GetI(
187 const PointsKey &pkey) override;
188 LIB_UTILITIES_EXPORT virtual const std::shared_ptr<NekMatrix<NekDouble>> v_GetI(
189 const Array<OneD, const NekDouble> &x) override;
190 LIB_UTILITIES_EXPORT virtual const std::shared_ptr<NekMatrix<NekDouble>> v_GetI(
191 size_t numpoints, const Array<OneD, const NekDouble> &x) override;
192 LIB_UTILITIES_EXPORT virtual const std::shared_ptr<NekMatrix<NekDouble>>
193 v_GetGalerkinProjection(const PointsKey &pkey) override;
194
195private:
196 static bool initPointsManager[];
197
198 GaussPoints() = delete;
199 GaussPoints(const GaussPoints &points) = delete;
200
201 virtual void v_CalculatePoints() override final;
202 virtual void v_CalculateWeights() override final;
203 virtual void v_CalculateDerivMatrix() override final;
204
205 void CalculateInterpMatrix(size_t npts,
206 const Array<OneD, const NekDouble> &xpoints,
207 Array<OneD, NekDouble> &interp);
208
210 const PointsKey &pkey);
211
212}; // class GaussPoints
213} // namespace LibUtilities
214} // namespace Nektar
215
216#endif // GAUSSPOINTS_H
#define LIB_UTILITIES_EXPORT
static std::shared_ptr< Points< NekDouble > > Create(const PointsKey &pkey)
std::shared_ptr< NekMatrix< NekDouble > > CreateGPMatrix(const PointsKey &pkey)
virtual const std::shared_ptr< NekMatrix< NekDouble > > v_GetGalerkinProjection(const PointsKey &pkey) override
GaussPoints(const GaussPoints &points)=delete
virtual void v_CalculateWeights() override final
virtual void v_CalculateDerivMatrix() override final
virtual void v_CalculatePoints() override final
Definition: GaussPoints.cpp:77
std::shared_ptr< NekMatrix< NekDouble > > CreateMatrix(const PointsKey &pkey)
GaussPoints(const PointsKey &pkey)
Definition: GaussPoints.h:60
virtual const std::shared_ptr< NekMatrix< NekDouble > > v_GetI(const PointsKey &pkey) override
void CalculateInterpMatrix(size_t npts, const Array< OneD, const NekDouble > &xpoints, Array< OneD, NekDouble > &interp)
std::shared_ptr< NekMatrix< NekDouble > > CalculateGalerkinProjectionMatrix(const PointsKey &pkey)
Stores a set of points of datatype DataT, defined by a PointKey.
Definition: Points.h:240
NekManager< PointsKey, NekMatrix< DataType >, PointsKey::opLess > m_InterpManager
Definition: Points.h:369
NekManager< PointsKey, NekMatrix< DataType >, PointsKey::opLess > m_GalerkinProjectionManager
Definition: Points.h:371
Defines a specification for a set of points.
Definition: Points.h:55
@ eGaussRadauMLegendre
1D Gauss-Radau-Legendre quadrature points, pinned at x=-1
Definition: PointsType.h:49
@ eBoundaryLayerPoints
1D power law distribution for boundary layer points
Definition: PointsType.h:79
@ eGaussRadauMAlpha0Beta1
Gauss Radau pinned at x=-1,.
Definition: PointsType.h:60
@ eGaussRadauKronrodMLegendre
1D Gauss-Radau-Kronrod-Legendre quadrature points, pinned at x=-1
Definition: PointsType.h:69
@ 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
@ eGaussRadauKronrodMAlpha1Beta0
1D Gauss-Radau-Kronrod-Legendre pinned at x=-1,
Definition: PointsType.h:71
@ eGaussLobattoLegendre
1D Gauss-Lobatto-Legendre quadrature points
Definition: PointsType.h:53
@ eGaussGaussChebyshev
1D Gauss-Gauss-Chebyshev quadrature points
Definition: PointsType.h:54
@ eBoundaryLayerPointsRev
1D power law distribution for boundary layer points
Definition: PointsType.h:81
@ ePolyEvenlySpaced
1D Evenly-spaced points using Lagrange polynomial
Definition: PointsType.h:75
@ eGaussLobattoKronrodLegendre
1D Lobatto Kronrod quadrature points
Definition: PointsType.h:74
@ eGaussGaussLegendre
1D Gauss-Gauss-Legendre quadrature points
Definition: PointsType.h:48
@ 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