Nektar++
Loading...
Searching...
No Matches
Classes | Public Member Functions | Static Public Member Functions | Protected Attributes | Friends | List of all members
Nektar::LibUtilities::PointsKey Class Reference

Defines a specification for a set of points. More...

#include <Points.h>

Classes

struct  opLess
 

Public Member Functions

 PointsKey (void)
 Default constructor.
 
 PointsKey (const size_t &numpoints, const PointsType &pointstype, const NekDouble factor=NekConstants::kNekUnsetDouble)
 Constructor defining the number and distribution of points.
 
virtual ~PointsKey ()
 Destructor.
 
 PointsKey (const PointsKey &key)=default
 Copy constructor.
 
PointsKeyoperator= (const PointsKey &key)=default
 
size_t GetNumPoints () const
 
PointsType GetPointsType () const
 
NekDouble GetFactor () const
 
bool operator== (const PointsKey &key)
 
bool operator== (const PointsKey *y)
 
bool operator!= (const PointsKey &y)
 
bool operator!= (const PointsKey *y)
 
size_t GetPointsDim () const
 
size_t GetTotNumPoints () const
 
PointsKey GetEquivalentPointsKey (const PointsType ptype)
 

Static Public Member Functions

static void GetEffectiveQuadRange (const LibUtilities::PointsKey &pkey, int &q_begin, int &q_end)
 offset the m_nq_begin and m_nq_end according to the points type
 
static int GetDegreeOfExactness (const PointsType ptype, const int npt)
 Get degree of exactness for quadrature points.
 

Protected Attributes

size_t m_numpoints
 number of the points (as appropriately defined for PointsType)
 
PointsType m_pointstype
 Type of Points.
 
NekDouble m_factor
 optional factor
 

Friends

bool operator== (const PointsKey &lhs, const PointsKey &rhs)
 
bool operator< (const PointsKey &lhs, const PointsKey &rhs)
 
bool opLess::operator() (const PointsKey &lhs, const PointsKey &rhs) const
 

Detailed Description

Defines a specification for a set of points.

Specification for a set of points. This includes the total number of points, as well as their distribution.

Definition at line 49 of file Points.h.

Constructor & Destructor Documentation

◆ PointsKey() [1/3]

Nektar::LibUtilities::PointsKey::PointsKey ( void  )
inline

Default constructor.

Definition at line 62 of file Points.h.

65 {
66 }
size_t m_numpoints
number of the points (as appropriately defined for PointsType)
Definition Points.h:298
PointsType m_pointstype
Type of Points.
Definition Points.h:300
NekDouble m_factor
optional factor
Definition Points.h:301
static const NekDouble kNekUnsetDouble

Referenced by GetEquivalentPointsKey().

◆ PointsKey() [2/3]

Nektar::LibUtilities::PointsKey::PointsKey ( const size_t &  numpoints,
const PointsType pointstype,
const NekDouble  factor = NekConstants::kNekUnsetDouble 
)
inline

Constructor defining the number and distribution of points.

Definition at line 69 of file Points.h.

71 : m_numpoints(numpoints), m_pointstype(pointstype), m_factor(factor)
72 {
73 }

◆ ~PointsKey()

virtual Nektar::LibUtilities::PointsKey::~PointsKey ( )
inlinevirtual

Destructor.

Definition at line 76 of file Points.h.

77 {
78 }

◆ PointsKey() [3/3]

Nektar::LibUtilities::PointsKey::PointsKey ( const PointsKey key)
default

Copy constructor.

Member Function Documentation

◆ GetDegreeOfExactness()

static int Nektar::LibUtilities::PointsKey::GetDegreeOfExactness ( const PointsType  ptype,
const int  npt 
)
inlinestatic

Get degree of exactness for quadrature points.

Definition at line 245 of file Points.h.

247 {
248 switch (ptype)
249 {
252 {
253 return 2 * npt - 1;
254 }
256 {
257 return 2 * (npt - 2) - 1;
258 }
260 {
261 return 2 * (npt - 1) - 1;
262 }
267 case eGaussRadauMAlpha0Beta2:
268 case eGaussRadauMAlpha1Beta0:
269 case eGaussRadauMAlpha2Beta0:
270 {
271 return 2 * npt - 2;
272 }
275 {
276 return 2 * npt - 3;
277 }
278 case eGaussKronrodLegendre:
279 {
280 return 3 * (npt - 1) / 2 + 1;
281 }
284 {
285 return 3 * (npt - 2) / 2; // not for sure
286 }
288 {
289 return 3 * (npt - 3) / 2; // not for sure
290 }
291 default:
292 break; // make it happy
293 }
294 return npt;
295 }
@ 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
@ 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
@ 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
@ 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

References Nektar::LibUtilities::eGaussGaussChebyshev, Nektar::LibUtilities::eGaussGaussLegendre, Nektar::LibUtilities::eGaussLegendreWithM, Nektar::LibUtilities::eGaussLegendreWithMP, Nektar::LibUtilities::eGaussLobattoChebyshev, Nektar::LibUtilities::eGaussLobattoKronrodLegendre, Nektar::LibUtilities::eGaussLobattoLegendre, Nektar::LibUtilities::eGaussRadauKronrodMAlpha1Beta0, Nektar::LibUtilities::eGaussRadauKronrodMLegendre, Nektar::LibUtilities::eGaussRadauMAlpha0Beta1, Nektar::LibUtilities::eGaussRadauMChebyshev, Nektar::LibUtilities::eGaussRadauMLegendre, and Nektar::LibUtilities::eGaussRadauPLegendre.

Referenced by GetEquivalentPointsKey().

◆ GetEffectiveQuadRange()

static void Nektar::LibUtilities::PointsKey::GetEffectiveQuadRange ( const LibUtilities::PointsKey pkey,
int &  q_begin,
int &  q_end 
)
inlinestatic

offset the m_nq_begin and m_nq_end according to the points type

Definition at line 219 of file Points.h.

221 {
222 switch (pkey.GetPointsType())
223 {
225 {
226 q_begin = 1;
227 q_end = pkey.GetNumPoints();
228 }
229 break;
231 {
232 q_begin = 1;
233 q_end = pkey.GetNumPoints() - 1;
234 }
235 break;
236 default:
237 {
238 q_begin = 0;
239 q_end = pkey.GetNumPoints();
240 }
241 }
242 }

References Nektar::LibUtilities::eGaussLegendreWithM, Nektar::LibUtilities::eGaussLegendreWithMP, GetNumPoints(), and GetPointsType().

Referenced by Nektar::LocalRegions::GetTraceQuadRange(), Nektar::MultiRegions::LocTraceToTraceMap::InterpLocEdgesToTrace(), Nektar::MultiRegions::LocTraceToTraceMap::InterpLocEdgesToTraceTranspose(), Nektar::MultiRegions::LocTraceToTraceMap::InterpLocFacesToTrace(), Nektar::MultiRegions::LocTraceToTraceMap::InterpLocFacesToTraceTranspose(), Nektar::MultiRegions::LocTraceToTraceMap::InterpTraceToLocEdges(), and Nektar::MultiRegions::LocTraceToTraceMap::InterpTraceToLocFaces().

◆ GetEquivalentPointsKey()

PointsKey Nektar::LibUtilities::PointsKey::GetEquivalentPointsKey ( const PointsType  ptype)

Definition at line 92 of file Foundations/Points.cpp.

93{
94 auto required_degree = GetDegreeOfExactness(m_pointstype, m_numpoints);
95 int npoints = 2;
96 while (GetDegreeOfExactness(ptype, npoints) < required_degree)
97 {
98 ++npoints;
99 }
100 return PointsKey(npoints, ptype);
101}
static int GetDegreeOfExactness(const PointsType ptype, const int npt)
Get degree of exactness for quadrature points.
Definition Points.h:245
PointsKey(void)
Default constructor.
Definition Points.h:62

References GetDegreeOfExactness(), m_numpoints, m_pointstype, and PointsKey().

◆ GetFactor()

NekDouble Nektar::LibUtilities::PointsKey::GetFactor ( ) const
inline

Definition at line 95 of file Points.h.

96 {
97 return m_factor;
98 }

References m_factor.

Referenced by Nektar::LibUtilities::BLPoints::v_CalculatePoints().

◆ GetNumPoints()

size_t Nektar::LibUtilities::PointsKey::GetNumPoints ( ) const
inline

Definition at line 85 of file Points.h.

86 {
87 return m_numpoints;
88 }

References m_numpoints.

Referenced by Nektar::MultiRegions::LocTraceToTraceMap::CalcLocTracePhysToTraceIDMap_2D(), Nektar::MultiRegions::LocTraceToTraceMap::CalcLocTracePhysToTraceIDMap_3D(), Nektar::LibUtilities::GaussPoints::CalculateGalerkinProjectionMatrix(), Nektar::LibUtilities::FourierPoints::CalculateInterpMatrix(), Nektar::LibUtilities::GaussPoints::CalculateInterpMatrix(), Nektar::LibUtilities::PolyEPoints::CalculateInterpMatrix(), Nektar::LibUtilities::FourierPoints::CreateMatrix(), Nektar::LibUtilities::GaussPoints::CreateMatrix(), export_Points(), GetEffectiveQuadRange(), Nektar::LibUtilities::BasisKey::GetNumPoints(), Nektar::LibUtilities::Points< DataT >::GetNumPoints(), Nektar::LibUtilities::Interp1D(), Nektar::LibUtilities::Interp1D(), Nektar::LibUtilities::Interp2D(), Nektar::LibUtilities::Interp3D(), Nektar::MultiRegions::LocTraceToTraceMap::InterpLocEdgesToTrace(), Nektar::MultiRegions::LocTraceToTraceMap::InterpLocEdgesToTraceTranspose(), Nektar::MultiRegions::LocTraceToTraceMap::InterpLocFacesToTrace(), Nektar::MultiRegions::LocTraceToTraceMap::InterpLocFacesToTraceTranspose(), Nektar::MultiRegions::LocTraceToTraceMap::InterpTraceToLocEdges(), Nektar::MultiRegions::LocTraceToTraceMap::InterpTraceToLocFaces(), Nektar::MultiRegions::LocTraceToTraceMap::LocTraceToTraceMap(), Nektar::LibUtilities::operator<<(), Nektar::LibUtilities::PhysGalerkinProject1D(), Nektar::LibUtilities::PhysGalerkinProject1D(), Nektar::LibUtilities::PhysGalerkinProject2D(), Nektar::LibUtilities::PhysGalerkinProject3D(), Nektar::LibUtilities::GaussPoints::v_CalculateDerivMatrix(), Nektar::LibUtilities::PolyEPoints::v_CalculateDerivMatrix(), Nektar::LibUtilities::FourierPoints::v_CalculateDerivMatrix(), Nektar::LibUtilities::GaussPoints::v_CalculatePoints(), Nektar::LibUtilities::PolyEPoints::v_CalculatePoints(), Nektar::LibUtilities::BLPoints::v_CalculatePoints(), Nektar::LibUtilities::FourierPoints::v_CalculatePoints(), Nektar::LibUtilities::FourierSingleModePoints::v_CalculatePoints(), Nektar::LibUtilities::PolyEPoints::v_CalculateWeights(), Nektar::LibUtilities::FourierPoints::v_CalculateWeights(), Nektar::LibUtilities::FourierSingleModePoints::v_CalculateWeights(), Nektar::LocalRegions::QuadExp::v_ComputeTraceNormal(), Nektar::LocalRegions::TriExp::v_ComputeTraceNormal(), and Nektar::LibUtilities::PolyEPoints::v_GetI().

◆ GetPointsDim()

size_t Nektar::LibUtilities::PointsKey::GetPointsDim ( ) const
inline

Definition at line 128 of file Points.h.

129 {
130 size_t dimpoints = 1;
131
132 switch (m_pointstype)
133 {
134 case eNodalTriElec:
135 case eNodalTriFekete:
137 case eNodalTriSPI:
138 case eNodalQuadElec:
139 dimpoints = 2;
140 break;
141
142 case eNodalTetElec:
145 case eNodalPrismElec:
146 case eNodalHexElec:
147 dimpoints = 3;
148 break;
149
150 default:
151 break;
152 }
153
154 return dimpoints;
155 }
@ eNodalPrismEvenlySpaced
3D Evenly-spaced points on a Prism
Definition PointsType.h:86
@ eNodalTriFekete
2D Nodal Fekete Points on a Triangle
Definition PointsType.h:82
@ eNodalTriElec
2D Nodal Electrostatic Points on a Triangle
Definition PointsType.h:81
@ eNodalTriEvenlySpaced
2D Evenly-spaced points on a Triangle
Definition PointsType.h:83
@ eNodalHexElec
3D GLL for hex
Definition PointsType.h:94
@ eNodalQuadElec
2D GLL for quad
Definition PointsType.h:93
@ eNodalTetEvenlySpaced
3D Evenly-spaced points on a Tetrahedron
Definition PointsType.h:84
@ eNodalPrismElec
3D electrostatically spaced points on a Prism
Definition PointsType.h:87
@ eNodalTetElec
3D Nodal Electrostatic Points on a Tetrahedron
Definition PointsType.h:85
@ eNodalTriSPI
2D Nodal Symmetric positive internal triangle (Whitherden, Vincent)
Definition PointsType.h:88

References Nektar::LibUtilities::eNodalHexElec, Nektar::LibUtilities::eNodalPrismElec, Nektar::LibUtilities::eNodalPrismEvenlySpaced, Nektar::LibUtilities::eNodalQuadElec, Nektar::LibUtilities::eNodalTetElec, Nektar::LibUtilities::eNodalTetEvenlySpaced, Nektar::LibUtilities::eNodalTriElec, Nektar::LibUtilities::eNodalTriEvenlySpaced, Nektar::LibUtilities::eNodalTriFekete, Nektar::LibUtilities::eNodalTriSPI, and m_pointstype.

Referenced by export_Points(), Nektar::LibUtilities::Basis::GetI(), Nektar::LibUtilities::Points< DataT >::GetPointsDim(), Nektar::LibUtilities::FourierPoints::v_GetI(), Nektar::LibUtilities::GaussPoints::v_GetI(), Nektar::LibUtilities::NodalPrismElec::v_GetI(), Nektar::LibUtilities::NodalPrismEvenlySpaced::v_GetI(), Nektar::LibUtilities::NodalTetElec::v_GetI(), Nektar::LibUtilities::NodalTetEvenlySpaced::v_GetI(), Nektar::LibUtilities::NodalTriElec::v_GetI(), Nektar::LibUtilities::NodalTriEvenlySpaced::v_GetI(), Nektar::LibUtilities::NodalTriFekete::v_GetI(), and Nektar::LibUtilities::PolyEPoints::v_GetI().

◆ GetPointsType()

PointsType Nektar::LibUtilities::PointsKey::GetPointsType ( ) const
inline

Definition at line 90 of file Points.h.

91 {
92 return m_pointstype;
93 }

References m_pointstype.

Referenced by Nektar::LibUtilities::GaussPoints::CalculateInterpMatrix(), export_Points(), GetEffectiveQuadRange(), Nektar::LibUtilities::BasisKey::GetPointsType(), Nektar::LibUtilities::Points< DataT >::GetPointsType(), Nektar::MultiRegions::LocTraceToTraceMap::LocTraceToTraceMap(), Nektar::StdRegions::StdNodalPrismExp::ModalToNodal(), Nektar::StdRegions::StdNodalTetExp::ModalToNodal(), Nektar::StdRegions::StdNodalTriExp::ModalToNodal(), Nektar::StdRegions::StdNodalPrismExp::NodalToModal(), Nektar::StdRegions::StdNodalTetExp::NodalToModal(), Nektar::StdRegions::StdNodalPrismExp::NodalToModalTranspose(), Nektar::StdRegions::StdNodalTetExp::NodalToModalTranspose(), Nektar::StdRegions::StdNodalTriExp::NodalToModalTranspose(), Nektar::LibUtilities::operator<<(), Nektar::LibUtilities::GaussPoints::v_CalculateDerivMatrix(), Nektar::LibUtilities::GaussPoints::v_CalculatePoints(), Nektar::LibUtilities::BLPoints::v_CalculatePoints(), Nektar::LocalRegions::NodalPrismExp::v_CreateStdMatrix(), Nektar::LocalRegions::NodalTetExp::v_CreateStdMatrix(), Nektar::LocalRegions::NodalTriExp::v_CreateStdMatrix(), Nektar::StdRegions::StdExpansion::v_FwdTrans(), Nektar::LocalRegions::Expansion::v_FwdTrans(), Nektar::LocalRegions::NodalPrismExp::v_GetLinStdExp(), Nektar::LocalRegions::NodalTetExp::v_GetLinStdExp(), Nektar::LocalRegions::NodalTriExp::v_GetLinStdExp(), Nektar::LocalRegions::NodalPrismExp::v_GetStdExp(), Nektar::LocalRegions::NodalTetExp::v_GetStdExp(), Nektar::LocalRegions::NodalTriExp::v_GetStdExp(), and Nektar::StdRegions::StdNodalTriExp::v_NodalToModal().

◆ GetTotNumPoints()

size_t Nektar::LibUtilities::PointsKey::GetTotNumPoints ( ) const
inline

Definition at line 158 of file Points.h.

159 {
160 size_t totpoints = m_numpoints;
161
162 switch (m_pointstype)
163 {
164 case eNodalTriElec:
165 case eNodalTriFekete:
167 totpoints = m_numpoints * (m_numpoints + 1) / 2;
168 break;
169 case eNodalTriSPI:
171 "This method cannot be implemented");
172 break;
173
174 case eNodalQuadElec:
175 totpoints = m_numpoints * m_numpoints;
176 break;
177
178 case eNodalTetElec:
180 totpoints =
181 m_numpoints * (m_numpoints + 1) * (m_numpoints + 2) / 6;
182 break;
183 case eNodalTetSPI:
185 "This method cannot be implemented");
186 break;
187
189 case eNodalPrismElec:
190 totpoints = m_numpoints * m_numpoints * (m_numpoints + 1) / 2;
191 break;
192 case eNodalPrismSPI:
194 "This method cannot be implemented");
195 break;
196
197 case eNodalHexElec:
198 totpoints = m_numpoints * m_numpoints * m_numpoints;
199 break;
200
201 default:
202 break;
203 }
204
205 return totpoints;
206 }
#define NEKERROR(type, msg)
Assert Level 0 – Fundamental assert which is used whether in FULLDEBUG, DEBUG or OPT compilation mode...
@ eNodalPrismSPI
3D prism SPI
Definition PointsType.h:92
@ eNodalTetSPI
3D Nodal Symmetric positive internal tet (Whitherden, Vincent)
Definition PointsType.h:90

References Nektar::ErrorUtil::efatal, Nektar::LibUtilities::eNodalHexElec, Nektar::LibUtilities::eNodalPrismElec, Nektar::LibUtilities::eNodalPrismEvenlySpaced, Nektar::LibUtilities::eNodalPrismSPI, Nektar::LibUtilities::eNodalQuadElec, Nektar::LibUtilities::eNodalTetElec, Nektar::LibUtilities::eNodalTetEvenlySpaced, Nektar::LibUtilities::eNodalTetSPI, Nektar::LibUtilities::eNodalTriElec, Nektar::LibUtilities::eNodalTriEvenlySpaced, Nektar::LibUtilities::eNodalTriFekete, Nektar::LibUtilities::eNodalTriSPI, m_numpoints, m_pointstype, and NEKERROR.

Referenced by export_Points(), Nektar::LibUtilities::BasisKey::GetTotNumPoints(), Nektar::LibUtilities::Points< DataT >::GetTotNumPoints(), Nektar::LibUtilities::GaussPoints::v_CalculateDerivMatrix(), Nektar::LibUtilities::NodalTetElec::v_CalculatePoints(), Nektar::LibUtilities::NodalTriElec::v_CalculatePoints(), and Nektar::LibUtilities::NodalTriFekete::v_CalculatePoints().

◆ operator!=() [1/2]

bool Nektar::LibUtilities::PointsKey::operator!= ( const PointsKey y)
inline

Definition at line 117 of file Points.h.

118 {
119 return (!(*this == y));
120 }

◆ operator!=() [2/2]

bool Nektar::LibUtilities::PointsKey::operator!= ( const PointsKey y)
inline

Definition at line 122 of file Points.h.

123 {
124 return (!(*this == *y));
125 }

◆ operator=()

PointsKey & Nektar::LibUtilities::PointsKey::operator= ( const PointsKey key)
default

◆ operator==() [1/2]

bool Nektar::LibUtilities::PointsKey::operator== ( const PointsKey key)
inline

Definition at line 100 of file Points.h.

101 {
102
103 if (fabs(m_factor - key.m_factor) < NekConstants::kNekZeroTol)
104 {
105 return (m_numpoints == key.m_numpoints &&
106 m_pointstype == key.m_pointstype);
107 }
108
109 return false;
110 }
static const NekDouble kNekZeroTol

References Nektar::NekConstants::kNekZeroTol, m_factor, m_numpoints, and m_pointstype.

◆ operator==() [2/2]

bool Nektar::LibUtilities::PointsKey::operator== ( const PointsKey y)
inline

Definition at line 112 of file Points.h.

113 {
114 return (*this == *y);
115 }

Friends And Related Symbol Documentation

◆ operator<

bool operator< ( const PointsKey lhs,
const PointsKey rhs 
)
friend

Definition at line 51 of file Foundations/Points.cpp.

52{
53 if (lhs.m_pointstype < rhs.m_pointstype)
54 {
55 return true;
56 }
57
58 if (lhs.m_pointstype > rhs.m_pointstype)
59 {
60 return false;
61 }
62
63 if (lhs.m_numpoints < rhs.m_numpoints)
64 {
65 return true;
66 }
67
68 if (lhs.m_numpoints > rhs.m_numpoints)
69 {
70 return false;
71 }
72
73 if (lhs.m_factor < rhs.m_factor)
74 {
75 return true;
76 }
77
78 if (lhs.m_factor > rhs.m_factor)
79 {
80 return false;
81 }
82
83 return false;
84}

◆ operator==

bool operator== ( const PointsKey lhs,
const PointsKey rhs 
)
friend

Definition at line 45 of file Foundations/Points.cpp.

46{
47 return (lhs.m_numpoints == rhs.m_numpoints &&
48 lhs.m_pointstype == rhs.m_pointstype);
49}

◆ opLess::operator()

bool opLess::operator() ( const PointsKey lhs,
const PointsKey rhs 
) const
friend

Member Data Documentation

◆ m_factor

NekDouble Nektar::LibUtilities::PointsKey::m_factor
protected

optional factor

Definition at line 301 of file Points.h.

Referenced by GetFactor(), and operator==().

◆ m_numpoints

size_t Nektar::LibUtilities::PointsKey::m_numpoints
protected

number of the points (as appropriately defined for PointsType)

Definition at line 298 of file Points.h.

Referenced by GetEquivalentPointsKey(), GetNumPoints(), GetTotNumPoints(), and operator==().

◆ m_pointstype

PointsType Nektar::LibUtilities::PointsKey::m_pointstype
protected