Nektar++
Classes | 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. More...
 
 PointsKey (const int &numpoints, const PointsType &pointstype, const NekDouble factor=NekConstants::kNekUnsetDouble)
 Constructor defining the number and distribution of points. More...
 
virtual ~PointsKey ()
 Destructor. More...
 
 PointsKey (const PointsKey &key)
 Copy constructor. More...
 
PointsKeyoperator= (const PointsKey &key)
 
unsigned int 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)
 
unsigned int GetPointsDim () const
 
unsigned int GetTotNumPoints () const
 

Protected Attributes

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

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 58 of file Points.h.

Constructor & Destructor Documentation

◆ PointsKey() [1/3]

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

Default constructor.

Definition at line 71 of file Points.h.

74  {
75  }
unsigned int m_numpoints
number of the points (as appropriately defined for PointsType)
Definition: Points.h:235
PointsType m_pointstype
Type of Points.
Definition: Points.h:237
NekDouble m_factor
optional factor
Definition: Points.h:238
static const NekDouble kNekUnsetDouble

◆ PointsKey() [2/3]

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

Constructor defining the number and distribution of points.

Definition at line 78 of file Points.h.

80  : m_numpoints(numpoints), m_pointstype(pointstype), m_factor(factor)
81  {
82  }

◆ ~PointsKey()

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

Destructor.

Definition at line 85 of file Points.h.

86  {
87  }

◆ PointsKey() [3/3]

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

Copy constructor.

Definition at line 90 of file Points.h.

91  {
92  *this = key; // defer to assignment operator
93  }

Member Function Documentation

◆ GetFactor()

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

Definition at line 114 of file Points.h.

115  {
116  return m_factor;
117  }

References m_factor.

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

◆ GetNumPoints()

unsigned int Nektar::LibUtilities::PointsKey::GetNumPoints ( ) const
inline

Definition at line 104 of file Points.h.

105  {
106  return m_numpoints;
107  }

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::BLPoints::CreateMatrix(), Nektar::LibUtilities::FourierPoints::CreateMatrix(), Nektar::LibUtilities::FourierSingleModePoints::CreateMatrix(), Nektar::LibUtilities::GaussPoints::CreateMatrix(), export_Points(), Nektar::LibUtilities::BasisKey::GetNumPoints(), Nektar::LibUtilities::Points< DataT >::GetNumPoints(), 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::LibUtilities::operator<<(), Nektar::LibUtilities::PhysGalerkinProject1D(), Nektar::LibUtilities::PhysGalerkinProject2D(), Nektar::LibUtilities::PhysGalerkinProject3D(), Nektar::MultiRegions::LocTraceToTraceMap::Setup(), Nektar::LibUtilities::Points< DataT >::v_CalculateBaryWeights(), Nektar::LibUtilities::FourierPoints::v_CalculateDerivMatrix(), Nektar::LibUtilities::GaussPoints::v_CalculateDerivMatrix(), Nektar::LibUtilities::PolyEPoints::v_CalculateDerivMatrix(), Nektar::LibUtilities::BLPoints::v_CalculatePoints(), Nektar::LibUtilities::FourierPoints::v_CalculatePoints(), Nektar::LibUtilities::FourierSingleModePoints::v_CalculatePoints(), Nektar::LibUtilities::GaussPoints::v_CalculatePoints(), Nektar::LibUtilities::PolyEPoints::v_CalculatePoints(), Nektar::LibUtilities::FourierPoints::v_CalculateWeights(), Nektar::LibUtilities::FourierSingleModePoints::v_CalculateWeights(), Nektar::LibUtilities::PolyEPoints::v_CalculateWeights(), Nektar::LocalRegions::NodalTriExp::v_ComputeTraceNormal(), Nektar::LocalRegions::QuadExp::v_ComputeTraceNormal(), Nektar::LocalRegions::TriExp::v_ComputeTraceNormal(), and Nektar::LibUtilities::PolyEPoints::v_GetI().

◆ GetPointsDim()

unsigned int Nektar::LibUtilities::PointsKey::GetPointsDim ( ) const
inline

Definition at line 147 of file Points.h.

148  {
149  int dimpoints = 1;
150 
151  switch (m_pointstype)
152  {
153  case eNodalTriElec:
154  case eNodalTriFekete:
156  case eNodalTriSPI:
157  case eNodalQuadElec:
158  dimpoints = 2;
159  break;
160 
161  case eNodalTetElec:
164  case eNodalPrismElec:
165  case eNodalHexElec:
166  dimpoints = 3;
167  break;
168 
169  default:
170  break;
171  }
172 
173  return dimpoints;
174  }
@ eNodalPrismEvenlySpaced
3D Evenly-spaced points on a Prism
Definition: PointsType.h:88
@ eNodalTriFekete
2D Nodal Fekete Points on a Triangle
Definition: PointsType.h:84
@ eNodalTriElec
2D Nodal Electrostatic Points on a Triangle
Definition: PointsType.h:83
@ eNodalTriEvenlySpaced
2D Evenly-spaced points on a Triangle
Definition: PointsType.h:85
@ eNodalHexElec
3D GLL for hex
Definition: PointsType.h:96
@ eNodalQuadElec
2D GLL for quad
Definition: PointsType.h:95
@ eNodalTetEvenlySpaced
3D Evenly-spaced points on a Tetrahedron
Definition: PointsType.h:86
@ eNodalPrismElec
3D electrostatically spaced points on a Prism
Definition: PointsType.h:89
@ eNodalTetElec
3D Nodal Electrostatic Points on a Tetrahedron
Definition: PointsType.h:87
@ eNodalTriSPI
2D Nodal Symmetric positive internal triangle (Whitherden, Vincent)
Definition: PointsType.h:90

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::Points< DataT >::v_CalculateDerivMatrix(), Nektar::LibUtilities::BLPoints::v_GetI(), Nektar::LibUtilities::FourierPoints::v_GetI(), Nektar::LibUtilities::FourierSingleModePoints::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

◆ GetTotNumPoints()

unsigned int Nektar::LibUtilities::PointsKey::GetTotNumPoints ( ) const
inline

Definition at line 177 of file Points.h.

178  {
179  int totpoints = m_numpoints;
180 
181  switch (m_pointstype)
182  {
183  case eNodalTriElec:
184  case eNodalTriFekete:
186  totpoints = m_numpoints * (m_numpoints + 1) / 2;
187  break;
188  case eNodalTriSPI:
190  "This method cannot be implemented");
191  break;
192 
193  case eNodalQuadElec:
194  totpoints = m_numpoints * m_numpoints;
195  break;
196 
197  case eNodalTetElec:
199  totpoints =
200  m_numpoints * (m_numpoints + 1) * (m_numpoints + 2) / 6;
201  break;
202  case eNodalTetSPI:
204  "This method cannot be implemented");
205  break;
206 
208  case eNodalPrismElec:
209  totpoints = m_numpoints * m_numpoints * (m_numpoints + 1) / 2;
210  break;
211  case eNodalPrismSPI:
213  "This method cannot be implemented");
214  break;
215 
216  case eNodalHexElec:
217  totpoints = m_numpoints * m_numpoints * m_numpoints;
218  break;
219 
220  default:
221  break;
222  }
223 
224  return totpoints;
225  }
#define NEKERROR(type, msg)
Assert Level 0 – Fundamental assert which is used whether in FULLDEBUG, DEBUG or OPT compilation mode...
Definition: ErrorUtil.hpp:209
@ eNodalPrismSPI
3D prism SPI
Definition: PointsType.h:94
@ eNodalTetSPI
3D Nodal Symmetric positive internal tet (Whitherden, Vincent)
Definition: PointsType.h:92

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 136 of file Points.h.

137  {
138  return (!(*this == y));
139  }

◆ operator!=() [2/2]

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

Definition at line 141 of file Points.h.

142  {
143  return (!(*this == *y));
144  }

◆ operator=()

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

Definition at line 95 of file Points.h.

96  {
97  m_numpoints = key.m_numpoints;
98  m_pointstype = key.m_pointstype;
99  m_factor = key.m_factor;
100 
101  return *this;
102  }

References m_factor, m_numpoints, and m_pointstype.

◆ operator==() [1/2]

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

Definition at line 119 of file Points.h.

120  {
121 
122  if (fabs(m_factor - key.m_factor) < NekConstants::kNekZeroTol)
123  {
124  return (m_numpoints == key.m_numpoints &&
125  m_pointstype == key.m_pointstype);
126  }
127 
128  return false;
129  }
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 131 of file Points.h.

132  {
133  return (*this == *y);
134  }

Friends And Related Function Documentation

◆ operator<

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

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

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

◆ operator==

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

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

49 {
50  return (lhs.m_numpoints == rhs.m_numpoints &&
51  lhs.m_pointstype == rhs.m_pointstype);
52 }

◆ 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 238 of file Points.h.

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

◆ m_numpoints

unsigned int Nektar::LibUtilities::PointsKey::m_numpoints
protected

number of the points (as appropriately defined for PointsType)

Definition at line 235 of file Points.h.

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

◆ m_pointstype

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