Nektar++
Loading...
Searching...
No Matches
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_InterpManager.RegisterCreator(
123 std::bind(&GaussPoints::CreateMatrix, this, pl::_1));
124 m_InterpManager.RegisterCreator(
126 std::bind(&GaussPoints::CreateMatrix, 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(
150 std::bind(&GaussPoints::CreateGPMatrix, this, pl::_1));
151 m_GalerkinProjectionManager.RegisterCreator(
153 std::bind(&GaussPoints::CreateGPMatrix, this, pl::_1));
154 m_GalerkinProjectionManager.RegisterCreator(
155 PointsKey(0, eGaussRadauMAlpha0Beta2),
156 std::bind(&GaussPoints::CreateGPMatrix, this, pl::_1));
157 m_GalerkinProjectionManager.RegisterCreator(
158 PointsKey(0, eGaussRadauMAlpha1Beta0),
159 std::bind(&GaussPoints::CreateGPMatrix, this, pl::_1));
160 m_GalerkinProjectionManager.RegisterCreator(
161 PointsKey(0, eGaussRadauMAlpha2Beta0),
162 std::bind(&GaussPoints::CreateGPMatrix, this, pl::_1));
163 m_GalerkinProjectionManager.RegisterCreator(
164 PointsKey(0, eGaussKronrodLegendre),
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 m_GalerkinProjectionManager.RegisterCreator(
183 std::bind(&GaussPoints::CreateGPMatrix, this, pl::_1));
184 m_GalerkinProjectionManager.RegisterCreator(
186 std::bind(&GaussPoints::CreateGPMatrix, this, pl::_1));
187 m_GalerkinProjectionManager.RegisterCreator(
189 std::bind(&GaussPoints::CreateGPMatrix, this, pl::_1));
190 m_GalerkinProjectionManager.RegisterCreator(
192 std::bind(&GaussPoints::CreateGPMatrix, this, pl::_1));
193 }
194
195protected:
196 LIB_UTILITIES_EXPORT const std::shared_ptr<NekMatrix<NekDouble>> v_GetI(
197 const PointsKey &pkey) override;
198 LIB_UTILITIES_EXPORT const std::shared_ptr<NekMatrix<NekDouble>> v_GetI(
199 const Array<OneD, const NekDouble> &x) override;
200 LIB_UTILITIES_EXPORT const std::shared_ptr<NekMatrix<NekDouble>> v_GetI(
201 size_t numpoints, const Array<OneD, const NekDouble> &x) override;
202 LIB_UTILITIES_EXPORT const std::shared_ptr<NekMatrix<NekDouble>>
203 v_GetGalerkinProjection(const PointsKey &pkey) override;
204
205private:
206 static bool initPointsManager[];
207
208 GaussPoints() = delete;
209 GaussPoints(const GaussPoints &points) = delete;
210
211 void v_CalculatePoints() final;
212 void v_CalculateWeights() final;
213 void v_CalculateDerivMatrix() final;
214
215 void CalculateInterpMatrix(size_t npts,
216 const Array<OneD, const NekDouble> &xpoints,
217 Array<OneD, NekDouble> &interp);
218
220 const PointsKey &pkey);
221
222}; // class GaussPoints
223} // namespace Nektar::LibUtilities
224
225#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
@ eGaussLegendreWithMP
1D Gauss-Legendre quadrature points with additional x=-1 and x=1 end points
Definition PointsType.h:95
@ 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
@ eGaussLegendreWithM
1D Gauss-Legendre quadrature points with additional x=-1 point
Definition PointsType.h:97
@ 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
STL namespace.