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>

Collaboration diagram for Nektar::LibUtilities::BasisKey:
Collaboration graph
[legend]

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...
 
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 50 of file Basis.h.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 62 of file Basis.h.

63  :
64  m_nummodes(nummodes),
65  m_basistype(btype),
66  m_pointsKey(pkey)
67  {
68  }
BasisType m_basistype
Expansion type.
Definition: Basis.h:189
PointsKey m_pointsKey
Points specification.
Definition: Basis.h:190
int m_nummodes
Expansion order.
Definition: Basis.h:188
Nektar::LibUtilities::BasisKey::BasisKey ( const BasisKey B)
inline

Copy constructor.

Definition at line 71 of file Basis.h.

71  :
72  m_nummodes(B.m_nummodes),
73  m_basistype(B.m_basistype),
74  m_pointsKey(B.m_pointsKey)
75  {
76  }
BasisType m_basistype
Expansion type.
Definition: Basis.h:189
PointsKey m_pointsKey
Points specification.
Definition: Basis.h:190
int m_nummodes
Expansion order.
Definition: Basis.h:188
Nektar::LibUtilities::BasisKey::~BasisKey ( )
inline

Destructor.

Definition at line 79 of file Basis.h.

80  {
81  }
Nektar::LibUtilities::BasisKey::BasisKey ( )
inlineprivate

Definition at line 193 of file Basis.h.

References ErrorUtil::efatal, and NEKERROR.

194  {
196  "Default Constructor BasisKey should never be called");
197  }
static const PointsKey NullPointsKey(0, eNoPointsType)
#define NEKERROR(type, msg)
Assert Level 0 – Fundamental assert which is used whether in FULLDEBUG, DEBUG or OPT compilation mod...
Definition: ErrorUtil.hpp:158
PointsKey m_pointsKey
Points specification.
Definition: Basis.h:190

Member Function Documentation

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 692 of file Basis.cpp.

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().

693  {
694  return ((m_basistype == eGLL_Lagrange &&
696  GetNumModes() == GetNumPoints()) ||
699  GetNumModes() == GetNumPoints()));
700  }
Lagrange Polynomials using the Gauss points .
Definition: BasisType.h:54
PointsType GetPointsType() const
Return type of quadrature.
Definition: Basis.h:151
BasisType m_basistype
Expansion type.
Definition: Basis.h:189
1D Gauss-Gauss-Legendre quadrature points
Definition: PointsType.h:47
int GetNumPoints() const
Return points order at which basis is defined.
Definition: Basis.h:128
int GetNumModes() const
Returns the order of the basis.
Definition: Basis.h:84
Lagrange for SEM basis .
Definition: BasisType.h:53
1D Gauss-Lobatto-Legendre quadrature points
Definition: PointsType.h:50
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 665 of file Basis.cpp.

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().

666  {
667  bool returnval = false;
668 
669  switch(GetPointsType())
670  {
671  case eGaussGaussLegendre:
678  returnval = (GetNumPoints() >= GetNumModes());
679  break;
680 
681  default:
682  break;
683  }
684 
685  return returnval;
686  }
1D Gauss-Radau-Kronrod-Legendre quadrature points, pinned at x=-1
Definition: PointsType.h:60
1D Gauss-Radau-Legendre quadrature points, pinned at x=1
Definition: PointsType.h:49
PointsType GetPointsType() const
Return type of quadrature.
Definition: Basis.h:151
1D Gauss-Kronrod-Legendre quadrature points
Definition: PointsType.h:59
1D Gauss-Gauss-Legendre quadrature points
Definition: PointsType.h:47
1D Lobatto Kronrod quadrature points
Definition: PointsType.h:62
int GetNumPoints() const
Return points order at which basis is defined.
Definition: Basis.h:128
int GetNumModes() const
Returns the order of the basis.
Definition: Basis.h:84
1D Gauss-Lobatto-Legendre quadrature points
Definition: PointsType.h:50
1D Gauss-Radau-Legendre quadrature points, pinned at x=-1
Definition: PointsType.h:48
BasisType Nektar::LibUtilities::BasisKey::GetBasisType ( ) const
inline
int Nektar::LibUtilities::BasisKey::GetNumModes ( ) const
inline
int Nektar::LibUtilities::BasisKey::GetNumPoints ( ) const
inline
PointsKey Nektar::LibUtilities::BasisKey::GetPointsKey ( ) const
inline
PointsType Nektar::LibUtilities::BasisKey::GetPointsType ( ) const
inline
int Nektar::LibUtilities::BasisKey::GetTotNumModes ( ) const
inline
Todo:
Generalise to arbitrary polynomials

Definition at line 90 of file Basis.h.

References Nektar::LibUtilities::eChebyshev, 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::eMonomial, Nektar::LibUtilities::eOrtho_A, Nektar::LibUtilities::eOrtho_B, Nektar::LibUtilities::eOrtho_C, m_basistype, m_nummodes, and NEKERROR.

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

91  {
92  int value = 0;
93 
94  switch(m_basistype)
95  {
96  case eOrtho_B:
97  case eModified_B:
98  value = m_nummodes*(m_nummodes+1)/2;
99  break;
100 
101  case eModified_C:
102  case eOrtho_C:
103  value = m_nummodes*(m_nummodes+1)*(m_nummodes+2)/6;
104  break;
105 
106  case eOrtho_A:
107  case eModified_A:
108  case eFourier:
109  case eGLL_Lagrange:
110  case eGauss_Lagrange:
111  case eLegendre:
112  case eChebyshev:
113  case eMonomial:
114  case eFourierSingleMode:
115  case eFourierHalfModeRe:
116  case eFourierHalfModeIm:
117  value = m_nummodes;
118  break;
119 
120  default:
121  NEKERROR(ErrorUtil::efatal,"Unknown basis being used");
122  }
123  return value;
124  }
#define NEKERROR(type, msg)
Assert Level 0 – Fundamental assert which is used whether in FULLDEBUG, DEBUG or OPT compilation mod...
Definition: ErrorUtil.hpp:158
Principle Modified Functions .
Definition: BasisType.h:51
Principle Modified Functions .
Definition: BasisType.h:49
Lagrange Polynomials using the Gauss points .
Definition: BasisType.h:54
Fourier Expansion .
Definition: BasisType.h:52
Chebyshev Polynomials .
Definition: BasisType.h:56
BasisType m_basistype
Expansion type.
Definition: Basis.h:189
Principle Orthogonal Functions .
Definition: BasisType.h:47
Fourier Modified expansions with just the real part of the first mode .
Definition: BasisType.h:59
Principle Modified Functions .
Definition: BasisType.h:50
int m_nummodes
Expansion order.
Definition: Basis.h:188
Principle Orthogonal Functions .
Definition: BasisType.h:48
Principle Orthogonal Functions .
Definition: BasisType.h:46
Fourier Modified expansions with just the imaginary part of the first mode .
Definition: BasisType.h:60
Fourier ModifiedExpansion with just the first mode .
Definition: BasisType.h:58
Legendre Polynomials . Same as Ortho_A.
Definition: BasisType.h:55
Lagrange for SEM basis .
Definition: BasisType.h:53
Monomial polynomials .
Definition: BasisType.h:57
int Nektar::LibUtilities::BasisKey::GetTotNumPoints ( ) const
inline

Definition at line 133 of file Basis.h.

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

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

134  {
135  return m_pointsKey.GetTotNumPoints();
136  }
PointsKey m_pointsKey
Points specification.
Definition: Basis.h:190
unsigned int GetTotNumPoints() const
Definition: Points.h:175
bool Nektar::LibUtilities::BasisKey::SameExp ( const BasisKey x) const
inline

Determine if basis expansion x matches this.

Definition at line 163 of file Basis.h.

References m_basistype, and m_nummodes.

164  {
165  return ((x.m_nummodes == m_nummodes)
166  &&(x.m_basistype == m_basistype));
167  }
BasisType m_basistype
Expansion type.
Definition: Basis.h:189
int m_nummodes
Expansion order.
Definition: Basis.h:188
bool Nektar::LibUtilities::BasisKey::SamePoints ( const BasisKey x) const
inline

Determine if quadrature of expansion x matches this.

Definition at line 157 of file Basis.h.

References m_pointsKey.

158  {
159  return (x.m_pointsKey == m_pointsKey);
160  }
PointsKey m_pointsKey
Points specification.
Definition: Basis.h:190

Friends And Related Function Documentation

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

Definition at line 723 of file Basis.cpp.

724  {
725  return (!(x == y));
726  }
bool operator!= ( const BasisKey x,
const BasisKey y 
)
friend

Definition at line 729 of file Basis.cpp.

730  {
731  return (!(*x == y));
732  }
bool operator!= ( const BasisKey x,
const BasisKey y 
)
friend

Definition at line 735 of file Basis.cpp.

736  {
737  return (!(x == *y));
738  }
bool operator< ( const BasisKey lhs,
const BasisKey rhs 
)
friend

Definition at line 49 of file Basis.cpp.

50  {
51  PointsKey lhsPointsKey = lhs.GetPointsKey();
52  PointsKey rhsPointsKey = rhs.GetPointsKey();
53 
54  if (lhsPointsKey < rhsPointsKey)
55  {
56  return true;
57  }
58  if (lhsPointsKey != rhsPointsKey)
59  {
60  return false;
61  }
62 
63  if (lhs.m_nummodes < rhs.m_nummodes)
64  {
65  return true;
66  }
67  if (lhs.m_nummodes > rhs.m_nummodes)
68  {
69  return false;
70  }
71 
72  return (lhs.m_basistype < rhs.m_basistype);
73  }
StandardMatrixTag & lhs
bool operator== ( const BasisKey x,
const BasisKey y 
)
friend

Overloaded Operators.

Definition at line 703 of file Basis.cpp.

704  {
705  return (x.GetPointsKey() == y.GetPointsKey() &&
706  x.m_basistype == y.m_basistype &&
707  x.GetNumModes() == y.GetNumModes());
708  }
bool operator== ( const BasisKey x,
const BasisKey y 
)
friend

Definition at line 711 of file Basis.cpp.

712  {
713  return (*x == y);
714  }
bool operator== ( const BasisKey x,
const BasisKey y 
)
friend

Definition at line 717 of file Basis.cpp.

718  {
719  return (x == *y);
720  }
bool opLess::operator() ( const BasisKey lhs,
const BasisKey rhs 
) const
friend

Member Data Documentation

BasisType Nektar::LibUtilities::BasisKey::m_basistype
protected
int Nektar::LibUtilities::BasisKey::m_nummodes
protected

Expansion order.

Definition at line 188 of file Basis.h.

Referenced by GetNumModes(), GetTotNumModes(), Nektar::LibUtilities::operator<(), and SameExp().

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

Points specification.

Definition at line 190 of file Basis.h.

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