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
41{
42class GaussPoints : public Points<NekDouble>
43{
44public:
45 ~GaussPoints() override
46 {
47 }
48
49 LIB_UTILITIES_EXPORT static std::shared_ptr<Points<NekDouble>> Create(
50 const PointsKey &pkey);
51
52 LIB_UTILITIES_EXPORT std::shared_ptr<NekMatrix<NekDouble>> CreateMatrix(
53 const PointsKey &pkey);
54
55 LIB_UTILITIES_EXPORT std::shared_ptr<NekMatrix<NekDouble>> CreateGPMatrix(
56 const PointsKey &pkey);
57
59 {
60 namespace pl = std::placeholders;
61 m_InterpManager.RegisterCreator(
63 std::bind(&GaussPoints::CreateMatrix, this, pl::_1));
64 m_InterpManager.RegisterCreator(
66 std::bind(&GaussPoints::CreateMatrix, this, pl::_1));
67 m_InterpManager.RegisterCreator(
69 std::bind(&GaussPoints::CreateMatrix, this, pl::_1));
70 m_InterpManager.RegisterCreator(
72 std::bind(&GaussPoints::CreateMatrix, this, pl::_1));
73 m_InterpManager.RegisterCreator(
75 std::bind(&GaussPoints::CreateMatrix, this, pl::_1));
76 m_InterpManager.RegisterCreator(
78 std::bind(&GaussPoints::CreateMatrix, this, pl::_1));
79 m_InterpManager.RegisterCreator(
81 std::bind(&GaussPoints::CreateMatrix, this, pl::_1));
82 m_InterpManager.RegisterCreator(
84 std::bind(&GaussPoints::CreateMatrix, this, pl::_1));
85 m_InterpManager.RegisterCreator(
87 std::bind(&GaussPoints::CreateMatrix, this, pl::_1));
88 m_InterpManager.RegisterCreator(
89 PointsKey(0, eGaussRadauMAlpha0Beta2),
90 std::bind(&GaussPoints::CreateMatrix, this, pl::_1));
91 m_InterpManager.RegisterCreator(
92 PointsKey(0, eGaussRadauMAlpha1Beta0),
93 std::bind(&GaussPoints::CreateMatrix, this, pl::_1));
94 m_InterpManager.RegisterCreator(
95 PointsKey(0, eGaussRadauMAlpha2Beta0),
96 std::bind(&GaussPoints::CreateMatrix, this, pl::_1));
97 m_InterpManager.RegisterCreator(
98 PointsKey(0, eGaussKronrodLegendre),
99 std::bind(&GaussPoints::CreateMatrix, this, pl::_1));
100 m_InterpManager.RegisterCreator(
102 std::bind(&GaussPoints::CreateMatrix, this, pl::_1));
103 m_InterpManager.RegisterCreator(
105 std::bind(&GaussPoints::CreateMatrix, this, pl::_1));
106 m_InterpManager.RegisterCreator(
108 std::bind(&GaussPoints::CreateMatrix, this, pl::_1));
109 m_InterpManager.RegisterCreator(
111 std::bind(&GaussPoints::CreateMatrix, this, pl::_1));
112 m_InterpManager.RegisterCreator(
114 std::bind(&GaussPoints::CreateMatrix, this, pl::_1));
115 m_InterpManager.RegisterCreator(
117 std::bind(&GaussPoints::CreateMatrix, this, pl::_1));
118 m_InterpManager.RegisterCreator(
120 std::bind(&GaussPoints::CreateMatrix, this, pl::_1));
121 m_GalerkinProjectionManager.RegisterCreator(
123 std::bind(&GaussPoints::CreateGPMatrix, this, pl::_1));
124 m_GalerkinProjectionManager.RegisterCreator(
126 std::bind(&GaussPoints::CreateGPMatrix, this, pl::_1));
127 m_GalerkinProjectionManager.RegisterCreator(
129 std::bind(&GaussPoints::CreateGPMatrix, this, pl::_1));
130 m_GalerkinProjectionManager.RegisterCreator(
132 std::bind(&GaussPoints::CreateGPMatrix, this, pl::_1));
133 m_GalerkinProjectionManager.RegisterCreator(
135 std::bind(&GaussPoints::CreateGPMatrix, this, pl::_1));
136 m_GalerkinProjectionManager.RegisterCreator(
138 std::bind(&GaussPoints::CreateGPMatrix, this, pl::_1));
139 m_GalerkinProjectionManager.RegisterCreator(
141 std::bind(&GaussPoints::CreateGPMatrix, this, pl::_1));
142 m_GalerkinProjectionManager.RegisterCreator(
144 std::bind(&GaussPoints::CreateGPMatrix, this, pl::_1));
145 m_GalerkinProjectionManager.RegisterCreator(
147 std::bind(&GaussPoints::CreateGPMatrix, this, pl::_1));
148 m_GalerkinProjectionManager.RegisterCreator(
149 PointsKey(0, eGaussRadauMAlpha0Beta2),
150 std::bind(&GaussPoints::CreateGPMatrix, this, pl::_1));
151 m_GalerkinProjectionManager.RegisterCreator(
152 PointsKey(0, eGaussRadauMAlpha1Beta0),
153 std::bind(&GaussPoints::CreateGPMatrix, this, pl::_1));
154 m_GalerkinProjectionManager.RegisterCreator(
155 PointsKey(0, eGaussRadauMAlpha2Beta0),
156 std::bind(&GaussPoints::CreateGPMatrix, this, pl::_1));
157 m_GalerkinProjectionManager.RegisterCreator(
158 PointsKey(0, eGaussKronrodLegendre),
159 std::bind(&GaussPoints::CreateGPMatrix, this, pl::_1));
160 m_GalerkinProjectionManager.RegisterCreator(
162 std::bind(&GaussPoints::CreateGPMatrix, this, pl::_1));
163 m_GalerkinProjectionManager.RegisterCreator(
165 std::bind(&GaussPoints::CreateGPMatrix, this, pl::_1));
166 m_GalerkinProjectionManager.RegisterCreator(
168 std::bind(&GaussPoints::CreateGPMatrix, this, pl::_1));
169 m_GalerkinProjectionManager.RegisterCreator(
171 std::bind(&GaussPoints::CreateGPMatrix, this, pl::_1));
172 m_GalerkinProjectionManager.RegisterCreator(
174 std::bind(&GaussPoints::CreateGPMatrix, this, pl::_1));
175 m_GalerkinProjectionManager.RegisterCreator(
177 std::bind(&GaussPoints::CreateGPMatrix, this, pl::_1));
178 m_GalerkinProjectionManager.RegisterCreator(
180 std::bind(&GaussPoints::CreateGPMatrix, this, pl::_1));
181 }
182
183protected:
184 LIB_UTILITIES_EXPORT const std::shared_ptr<NekMatrix<NekDouble>> v_GetI(
185 const PointsKey &pkey) override;
186 LIB_UTILITIES_EXPORT const std::shared_ptr<NekMatrix<NekDouble>> v_GetI(
187 const Array<OneD, const NekDouble> &x) override;
188 LIB_UTILITIES_EXPORT const std::shared_ptr<NekMatrix<NekDouble>> v_GetI(
189 size_t numpoints, const Array<OneD, const NekDouble> &x) override;
190 LIB_UTILITIES_EXPORT const std::shared_ptr<NekMatrix<NekDouble>>
191 v_GetGalerkinProjection(const PointsKey &pkey) override;
192
193private:
194 static bool initPointsManager[];
195
196 GaussPoints() = delete;
197 GaussPoints(const GaussPoints &points) = delete;
198
199 void v_CalculatePoints() final;
200 void v_CalculateWeights() final;
201 void v_CalculateDerivMatrix() final;
202
203 void CalculateInterpMatrix(size_t npts,
204 const Array<OneD, const NekDouble> &xpoints,
205 Array<OneD, NekDouble> &interp);
206
208 const PointsKey &pkey);
209
210}; // class GaussPoints
211} // namespace Nektar::LibUtilities
212
213#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)
const std::shared_ptr< NekMatrix< NekDouble > > v_GetGalerkinProjection(const PointsKey &pkey) override
GaussPoints(const GaussPoints &points)=delete
std::shared_ptr< NekMatrix< NekDouble > > CreateMatrix(const PointsKey &pkey)
GaussPoints(const PointsKey &pkey)
Definition: GaussPoints.h:58
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:235
NekManager< PointsKey, NekMatrix< DataType >, PointsKey::opLess > m_InterpManager
Definition: Points.h:364
NekManager< PointsKey, NekMatrix< DataType >, PointsKey::opLess > m_GalerkinProjectionManager
Definition: Points.h:366
Defines a specification for a set of points.
Definition: Points.h:50
@ eGaussRadauMLegendre
1D Gauss-Radau-Legendre quadrature points, pinned at x=-1
Definition: PointsType.h:47
@ eBoundaryLayerPoints
1D power law distribution for boundary layer points
Definition: PointsType.h:77
@ eGaussRadauMAlpha0Beta1
Gauss Radau pinned at x=-1,.
Definition: PointsType.h:58
@ eGaussRadauKronrodMLegendre
1D Gauss-Radau-Kronrod-Legendre quadrature points, pinned at x=-1
Definition: PointsType.h:67
@ eGaussLobattoChebyshev
1D Gauss-Lobatto-Legendre quadrature points
Definition: PointsType.h:57
@ eFourierEvenlySpaced
1D Evenly-spaced points using Fourier Fit
Definition: PointsType.h:74
@ eGaussRadauPChebyshev
1D Gauss-Radau-Chebyshev quadrature points, pinned at x=1
Definition: PointsType.h:55
@ eGaussRadauMChebyshev
1D Gauss-Radau-Chebyshev quadrature points, pinned at x=-1
Definition: PointsType.h:53
@ eGaussRadauKronrodMAlpha1Beta0
1D Gauss-Radau-Kronrod-Legendre pinned at x=-1,
Definition: PointsType.h:69
@ eGaussLobattoLegendre
1D Gauss-Lobatto-Legendre quadrature points
Definition: PointsType.h:51
@ eGaussGaussChebyshev
1D Gauss-Gauss-Chebyshev quadrature points
Definition: PointsType.h:52
@ eBoundaryLayerPointsRev
1D power law distribution for boundary layer points
Definition: PointsType.h:79
@ ePolyEvenlySpaced
1D Evenly-spaced points using Lagrange polynomial
Definition: PointsType.h:73
@ eGaussLobattoKronrodLegendre
1D Lobatto Kronrod quadrature points
Definition: PointsType.h:72
@ eGaussGaussLegendre
1D Gauss-Gauss-Legendre quadrature points
Definition: PointsType.h:46
@ eGaussRadauPLegendre
1D Gauss-Radau-Legendre quadrature points, pinned at x=1
Definition: PointsType.h:49
double NekDouble