Nektar++
Classes | Public Member Functions | Protected Attributes | Private Member Functions | Friends | List of all members
Nektar::LibUtilities::BasisKey Class Reference

Describes the specification for a Basis. More...

#include <Basis.h>

Classes

struct  opLess
 

Public Member Functions

 BasisKey (const BasisType btype, const int nummodes, const PointsKey pkey)
 Constructor. More...
 
 BasisKey (const BasisKey &B)
 Copy constructor. More...
 
 ~BasisKey ()
 Destructor. More...
 
BasisKeyoperator= (const BasisKey &)=default
 Assignment operator. More...
 
int GetNumModes () const
 Returns the order of the basis. More...
 
int GetTotNumModes () const
 
int GetNumPoints () const
 Return points order at which basis is defined. More...
 
int GetTotNumPoints () const
 
BasisType GetBasisType () const
 Return type of expansion basis. More...
 
PointsKey GetPointsKey () const
 Return distribution of points. More...
 
PointsType GetPointsType () const
 Return type of quadrature. More...
 
bool SamePoints (const BasisKey &x) const
 Determine if quadrature of expansion x matches this. More...
 
bool SameExp (const BasisKey &x) const
 Determine if basis expansion x matches this. More...
 
bool ExactIprodInt () const
 Determine if basis has exact integration for inner product. More...
 
bool Collocation () const
 Determine if basis has collocation properties. More...
 

Protected Attributes

int m_nummodes
 Expansion order. More...
 
BasisType m_basistype
 Expansion type. More...
 
PointsKey m_pointsKey
 Points specification. More...
 

Private Member Functions

 BasisKey ()
 

Friends

bool operator== (const BasisKey &x, const BasisKey &y)
 Overloaded Operators. More...
 
bool operator== (const BasisKey *x, const BasisKey &y)
 
bool operator== (const BasisKey &x, const BasisKey *y)
 
bool operator!= (const BasisKey &x, const BasisKey &y)
 
bool operator!= (const BasisKey *x, const BasisKey &y)
 
bool operator!= (const BasisKey &x, const BasisKey *y)
 
bool operator< (const BasisKey &lhs, const BasisKey &rhs)
 
bool opLess::operator() (const BasisKey &lhs, const BasisKey &rhs) const
 

Detailed Description

Describes the specification for a Basis.

Definition at line 49 of file Basis.h.

Constructor & Destructor Documentation

◆ BasisKey() [1/3]

Nektar::LibUtilities::BasisKey::BasisKey ( const BasisType  btype,
const int  nummodes,
const PointsKey  pkey 
)
inline

Constructor.

Definition at line 61 of file Basis.h.

62  :
63  m_nummodes(nummodes),
64  m_basistype(btype),
65  m_pointsKey(pkey)
66  {
67  }
PointsKey m_pointsKey
Points specification.
Definition: Basis.h:195
int m_nummodes
Expansion order.
Definition: Basis.h:193
BasisType m_basistype
Expansion type.
Definition: Basis.h:194

◆ BasisKey() [2/3]

Nektar::LibUtilities::BasisKey::BasisKey ( const BasisKey B)
inline

Copy constructor.

Definition at line 70 of file Basis.h.

70  :
71  m_nummodes(B.m_nummodes),
72  m_basistype(B.m_basistype),
73  m_pointsKey(B.m_pointsKey)
74  {
75  }

◆ ~BasisKey()

Nektar::LibUtilities::BasisKey::~BasisKey ( )
inline

Destructor.

Definition at line 78 of file Basis.h.

79  {
80  }

◆ BasisKey() [3/3]

Nektar::LibUtilities::BasisKey::BasisKey ( )
inlineprivate

Definition at line 198 of file Basis.h.

199  {
201  "Default Constructor BasisKey should never be called");
202  }
#define NEKERROR(type, msg)
Assert Level 0 – Fundamental assert which is used whether in FULLDEBUG, DEBUG or OPT compilation mode...
Definition: ErrorUtil.hpp:209
static const PointsKey NullPointsKey(0, eNoPointsType)

References Nektar::ErrorUtil::efatal, and NEKERROR.

Member Function Documentation

◆ Collocation()

bool Nektar::LibUtilities::BasisKey::Collocation ( ) const

Determine if basis has collocation properties.

Determine if basis has collocation property, i.e. GLL_Lagrange with Lobatto integration of appropriate order, Gauss_Lagrange with Gauss integration of appropriate order.

Definition at line 860 of file Foundations/Basis.cpp.

861  {
862  return ((m_basistype == eGLL_Lagrange &&
864  GetNumModes() == GetNumPoints()) ||
867  GetNumModes() == GetNumPoints()));
868  }
int GetNumPoints() const
Return points order at which basis is defined.
Definition: Basis.h:133
int GetNumModes() const
Returns the order of the basis.
Definition: Basis.h:86
PointsType GetPointsType() const
Return type of quadrature.
Definition: Basis.h:156
@ eGaussLobattoLegendre
1D Gauss-Lobatto-Legendre quadrature points
Definition: PointsType.h:51
@ eGaussGaussLegendre
1D Gauss-Gauss-Legendre quadrature points
Definition: PointsType.h:48
@ eGauss_Lagrange
Lagrange Polynomials using the Gauss points .
Definition: BasisType.h:55
@ eGLL_Lagrange
Lagrange for SEM basis .
Definition: BasisType.h:54

References Nektar::LibUtilities::eGauss_Lagrange, Nektar::LibUtilities::eGaussGaussLegendre, Nektar::LibUtilities::eGaussLobattoLegendre, Nektar::LibUtilities::eGLL_Lagrange, GetNumModes(), GetNumPoints(), GetPointsType(), and m_basistype.

Referenced by Nektar::LibUtilities::Basis::Collocation(), and export_Basis().

◆ ExactIprodInt()

bool Nektar::LibUtilities::BasisKey::ExactIprodInt ( void  ) const

Determine if basis has exact integration for inner product.

Determine if polynomial basis can be eactly integrated with itself.

Definition at line 833 of file Foundations/Basis.cpp.

834  {
835  bool returnval = false;
836 
837  switch(GetPointsType())
838  {
839  case eGaussGaussLegendre:
846  returnval = (GetNumPoints() >= GetNumModes());
847  break;
848 
849  default:
850  break;
851  }
852 
853  return returnval;
854  }
@ eGaussRadauMLegendre
1D Gauss-Radau-Legendre quadrature points, pinned at x=-1
Definition: PointsType.h:49
@ eGaussKronrodLegendre
1D Gauss-Kronrod-Legendre quadrature points
Definition: PointsType.h:60
@ eGaussRadauKronrodMLegendre
1D Gauss-Radau-Kronrod-Legendre quadrature points, pinned at x=-1
Definition: PointsType.h:61
@ eGaussLobattoKronrodLegendre
1D Lobatto Kronrod quadrature points
Definition: PointsType.h:63
@ eGaussRadauPLegendre
1D Gauss-Radau-Legendre quadrature points, pinned at x=1
Definition: PointsType.h:50

References Nektar::LibUtilities::eGaussGaussLegendre, Nektar::LibUtilities::eGaussKronrodLegendre, Nektar::LibUtilities::eGaussLobattoKronrodLegendre, Nektar::LibUtilities::eGaussLobattoLegendre, Nektar::LibUtilities::eGaussRadauKronrodMLegendre, Nektar::LibUtilities::eGaussRadauMLegendre, Nektar::LibUtilities::eGaussRadauPLegendre, GetNumModes(), GetNumPoints(), and GetPointsType().

Referenced by Nektar::LibUtilities::Basis::ExactIprodInt().

◆ GetBasisType()

BasisType Nektar::LibUtilities::BasisKey::GetBasisType ( ) const
inline

◆ GetNumModes()

int Nektar::LibUtilities::BasisKey::GetNumModes ( ) const
inline

◆ GetNumPoints()

int Nektar::LibUtilities::BasisKey::GetNumPoints ( ) const
inline

◆ GetPointsKey()

PointsKey Nektar::LibUtilities::BasisKey::GetPointsKey ( ) const
inline

◆ GetPointsType()

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

◆ GetTotNumModes()

int Nektar::LibUtilities::BasisKey::GetTotNumModes ( ) const
inline
Todo:
Generalise to arbitrary polynomials

Definition at line 92 of file Basis.h.

93  {
94  int value = 0;
95 
96  switch(m_basistype)
97  {
98  case eOrtho_B:
99  case eModified_B:
100  value = m_nummodes*(m_nummodes+1)/2;
101  break;
102 
103  case eModified_C:
104  case eOrtho_C:
105  value = m_nummodes*(m_nummodes+1)*(m_nummodes+2)/6;
106  break;
107  case eModifiedPyr_C:
108  case eOrthoPyr_C:
109  value = m_nummodes*(m_nummodes+1)*(2*m_nummodes+1)/6;
110  break;
111  case eOrtho_A:
112  case eModified_A:
113  case eFourier:
114  case eGLL_Lagrange:
115  case eGauss_Lagrange:
116  case eLegendre:
117  case eChebyshev:
118  case eMonomial:
119  case eFourierSingleMode:
120  case eFourierHalfModeRe:
121  case eFourierHalfModeIm:
122  value = m_nummodes;
123  break;
124 
125  default:
126  NEKERROR(ErrorUtil::efatal,"Unknown basis being used");
127  }
128  return value;
129  }
@ eModified_B
Principle Modified Functions .
Definition: BasisType.h:49
@ eOrtho_A
Principle Orthogonal Functions .
Definition: BasisType.h:45
@ eModified_C
Principle Modified Functions .
Definition: BasisType.h:50
@ eMonomial
Monomial polynomials .
Definition: BasisType.h:58
@ eFourierSingleMode
Fourier ModifiedExpansion with just the first mode .
Definition: BasisType.h:59
@ eChebyshev
Chebyshev Polynomials .
Definition: BasisType.h:57
@ eLegendre
Legendre Polynomials . Same as Ortho_A.
Definition: BasisType.h:56
@ eOrtho_C
Principle Orthogonal Functions .
Definition: BasisType.h:47
@ eModifiedPyr_C
Principle Modified Functions .
Definition: BasisType.h:52
@ eOrtho_B
Principle Orthogonal Functions .
Definition: BasisType.h:46
@ eModified_A
Principle Modified Functions .
Definition: BasisType.h:48
@ eFourierHalfModeIm
Fourier Modified expansions with just the imaginary part of the first mode
Definition: BasisType.h:61
@ eFourierHalfModeRe
Fourier Modified expansions with just the real part of the first mode
Definition: BasisType.h:60
@ eOrthoPyr_C
Principle Orthogonal Functions .
Definition: BasisType.h:51
@ eFourier
Fourier Expansion .
Definition: BasisType.h:53

References Nektar::LibUtilities::eChebyshev, Nektar::ErrorUtil::efatal, Nektar::LibUtilities::eFourier, Nektar::LibUtilities::eFourierHalfModeIm, Nektar::LibUtilities::eFourierHalfModeRe, Nektar::LibUtilities::eFourierSingleMode, Nektar::LibUtilities::eGauss_Lagrange, Nektar::LibUtilities::eGLL_Lagrange, Nektar::LibUtilities::eLegendre, Nektar::LibUtilities::eModified_A, Nektar::LibUtilities::eModified_B, Nektar::LibUtilities::eModified_C, Nektar::LibUtilities::eModifiedPyr_C, Nektar::LibUtilities::eMonomial, Nektar::LibUtilities::eOrtho_A, Nektar::LibUtilities::eOrtho_B, Nektar::LibUtilities::eOrtho_C, Nektar::LibUtilities::eOrthoPyr_C, m_basistype, m_nummodes, and NEKERROR.

Referenced by export_Basis(), and Nektar::LibUtilities::Basis::GetTotNumModes().

◆ GetTotNumPoints()

int Nektar::LibUtilities::BasisKey::GetTotNumPoints ( ) const
inline

Definition at line 138 of file Basis.h.

139  {
140  return m_pointsKey.GetTotNumPoints();
141  }
unsigned int GetTotNumPoints() const
Definition: Points.h:180

References Nektar::LibUtilities::PointsKey::GetTotNumPoints(), and m_pointsKey.

Referenced by export_Basis(), and Nektar::LibUtilities::Basis::GetTotNumPoints().

◆ operator=()

BasisKey& Nektar::LibUtilities::BasisKey::operator= ( const BasisKey )
default

Assignment operator.

◆ SameExp()

bool Nektar::LibUtilities::BasisKey::SameExp ( const BasisKey x) const
inline

Determine if basis expansion x matches this.

Definition at line 168 of file Basis.h.

169  {
170  return ((x.m_nummodes == m_nummodes)
171  &&(x.m_basistype == m_basistype));
172  }

References m_basistype, and m_nummodes.

◆ SamePoints()

bool Nektar::LibUtilities::BasisKey::SamePoints ( const BasisKey x) const
inline

Determine if quadrature of expansion x matches this.

Definition at line 162 of file Basis.h.

163  {
164  return (x.m_pointsKey == m_pointsKey);
165  }

References m_pointsKey.

Friends And Related Function Documentation

◆ operator!= [1/3]

bool operator!= ( const BasisKey x,
const BasisKey y 
)
friend

Definition at line 891 of file Foundations/Basis.cpp.

892  {
893  return (!(x == y));
894  }

◆ operator!= [2/3]

bool operator!= ( const BasisKey x,
const BasisKey y 
)
friend

Definition at line 903 of file Foundations/Basis.cpp.

904  {
905  return (!(x == *y));
906  }

◆ operator!= [3/3]

bool operator!= ( const BasisKey x,
const BasisKey y 
)
friend

Definition at line 897 of file Foundations/Basis.cpp.

898  {
899  return (!(*x == y));
900  }

◆ operator<

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

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

52  {
53  PointsKey lhsPointsKey = lhs.GetPointsKey();
54  PointsKey rhsPointsKey = rhs.GetPointsKey();
55 
56  if (lhsPointsKey < rhsPointsKey)
57  {
58  return true;
59  }
60  if (lhsPointsKey != rhsPointsKey)
61  {
62  return false;
63  }
64 
65  if (lhs.m_nummodes < rhs.m_nummodes)
66  {
67  return true;
68  }
69  if (lhs.m_nummodes > rhs.m_nummodes)
70  {
71  return false;
72  }
73 
74  return (lhs.m_basistype < rhs.m_basistype);
75  }
StandardMatrixTag boost::call_traits< LhsDataType >::const_reference rhs
StandardMatrixTag & lhs

◆ operator== [1/3]

bool operator== ( const BasisKey x,
const BasisKey y 
)
friend

Overloaded Operators.

Definition at line 871 of file Foundations/Basis.cpp.

872  {
873  return (x.GetPointsKey() == y.GetPointsKey() &&
874  x.m_basistype == y.m_basistype &&
875  x.GetNumModes() == y.GetNumModes());
876  }

◆ operator== [2/3]

bool operator== ( const BasisKey x,
const BasisKey y 
)
friend

Definition at line 885 of file Foundations/Basis.cpp.

886  {
887  return (x == *y);
888  }

◆ operator== [3/3]

bool operator== ( const BasisKey x,
const BasisKey y 
)
friend

Definition at line 879 of file Foundations/Basis.cpp.

880  {
881  return (*x == y);
882  }

◆ opLess::operator()

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

Member Data Documentation

◆ m_basistype

BasisType Nektar::LibUtilities::BasisKey::m_basistype
protected

Expansion type.

Definition at line 194 of file Basis.h.

Referenced by Collocation(), GetBasisType(), GetTotNumModes(), and SameExp().

◆ m_nummodes

int Nektar::LibUtilities::BasisKey::m_nummodes
protected

Expansion order.

Definition at line 193 of file Basis.h.

Referenced by GetNumModes(), GetTotNumModes(), and SameExp().

◆ m_pointsKey

PointsKey Nektar::LibUtilities::BasisKey::m_pointsKey
protected

Points specification.

Definition at line 195 of file Basis.h.

Referenced by GetNumPoints(), GetPointsKey(), GetPointsType(), GetTotNumPoints(), and SamePoints().