Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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.
 BasisKey (const BasisKey &B)
 Copy constructor.
 ~BasisKey ()
 Destructor.
int GetNumModes () const
 Returns the order of the basis.
int GetTotNumModes () const
int GetNumPoints () const
 Return points order at which basis is defined.
int GetTotNumPoints () const
BasisType GetBasisType () const
 Return type of expansion basis.
PointsKey GetPointsKey () const
 Return distribution of points.
PointsType GetPointsType () const
 Return type of quadrature.
bool SamePoints (const BasisKey &x) const
 Determine if quadrature of expansion x matches this.
bool SameExp (const BasisKey &x) const
 Determine if basis expansion x matches this.
bool ExactIprodInt () const
 Determine if basis has exact integration for inner product.
bool Collocation () const
 Determine if basis has collocation properties.

Protected Attributes

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

Private Member Functions

 BasisKey ()

Friends

bool operator== (const BasisKey &x, const BasisKey &y)
 Overloaded Operators.
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.

:
m_nummodes(nummodes),
m_basistype(btype),
{
}
Nektar::LibUtilities::BasisKey::BasisKey ( const BasisKey B)
inline

Copy constructor.

Definition at line 71 of file Basis.h.

:
m_nummodes(B.m_nummodes),
m_basistype(B.m_basistype),
m_pointsKey(B.m_pointsKey)
{
}
Nektar::LibUtilities::BasisKey::~BasisKey ( )
inline

Destructor.

Definition at line 79 of file Basis.h.

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

Definition at line 193 of file Basis.h.

References ErrorUtil::efatal, and NEKERROR.

{
"Default Constructor BasisKey should never be called");
}

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

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

{
bool returnval = false;
switch(GetPointsType())
{
returnval = (GetNumPoints() >= GetNumModes());
break;
default:
break;
}
return returnval;
}
BasisType Nektar::LibUtilities::BasisKey::GetBasisType ( ) const
inline

Return type of expansion basis.

Definition at line 139 of file Basis.h.

References m_basistype.

Referenced by Nektar::LibUtilities::Basis::CalculateInterpMatrix(), Nektar::MultiRegions::ExpList1D::ExpList1D(), Nektar::MultiRegions::ExpList2D::ExpList2D(), Nektar::MultiRegions::ExpList3D::ExpList3D(), Nektar::CoupledLinearNS::GenPressureExp(), Nektar::LibUtilities::Basis::GetBasisType(), Nektar::LibUtilities::InterpCoeff1D(), Nektar::LibUtilities::InterpCoeff2D(), main(), Nektar::LibUtilities::operator<<(), Nektar::SpatialDomains::MeshGraph::SetExpansionsToEvenlySpacedPoints(), and Nektar::LibUtilities::Transposition::Transposition().

{
return m_basistype;
}
int Nektar::LibUtilities::BasisKey::GetNumModes ( ) const
inline

Returns the order of the basis.

Definition at line 84 of file Basis.h.

References m_nummodes.

Referenced by Nektar::LibUtilities::Basis::CalculateInterpMatrix(), Collocation(), ExactIprodInt(), Nektar::MultiRegions::ExpList1D::ExpList1D(), Nektar::MultiRegions::ExpList2D::ExpList2D(), Nektar::MultiRegions::ExpList3D::ExpList3D(), Nektar::LibUtilities::Basis::GenBasis(), Nektar::CoupledLinearNS::GenPressureExp(), Nektar::LibUtilities::Basis::GetNumModes(), Nektar::LibUtilities::InterpCoeff1D(), Nektar::LibUtilities::InterpCoeff2D(), Nektar::LibUtilities::InterpCoeff3D(), main(), Nektar::LibUtilities::operator<<(), Nektar::LibUtilities::operator==(), Nektar::SpatialDomains::MeshGraph::SetExpansionsToEvenlySpacedPoints(), Nektar::StdRegions::StdNodalPrismExp::StdNodalPrismExp(), Nektar::StdRegions::StdNodalTetExp::StdNodalTetExp(), Nektar::StdRegions::StdNodalTriExp::StdNodalTriExp(), Nektar::StdRegions::StdPrismExp::StdPrismExp(), Nektar::StdRegions::StdPyrExp::StdPyrExp(), Nektar::StdRegions::StdTetExp::StdTetExp(), Nektar::StdRegions::StdTriExp::StdTriExp(), and Nektar::LibUtilities::Transposition::Transposition().

{
return m_nummodes;
}
int Nektar::LibUtilities::BasisKey::GetNumPoints ( ) const
inline

Return points order at which basis is defined.

Definition at line 128 of file Basis.h.

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

Referenced by Collocation(), ExactIprodInt(), Nektar::MultiRegions::ExpList1D::ExpList1D(), Nektar::MultiRegions::ExpList2D::ExpList2D(), Nektar::MultiRegions::ExpList3D::ExpList3D(), Nektar::LibUtilities::Basis::GetNumPoints(), and Nektar::LibUtilities::Transposition::Transposition().

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

Return distribution of points.

Definition at line 145 of file Basis.h.

References m_pointsKey.

Referenced by Nektar::MultiRegions::ExpList2D::ExpList2D(), Nektar::LibUtilities::Basis::GenBasis(), Nektar::CoupledLinearNS::GenPressureExp(), Nektar::LibUtilities::Basis::GetI(), Nektar::LibUtilities::Basis::GetPointsKey(), Nektar::LibUtilities::Interp1D(), Nektar::LibUtilities::Interp2D(), Nektar::LibUtilities::Interp3D(), main(), Nektar::LibUtilities::operator<(), Nektar::LibUtilities::operator<<(), Nektar::LibUtilities::operator==(), Nektar::LibUtilities::PhysGalerkinProject1D(), Nektar::LibUtilities::PhysGalerkinProject2D(), Nektar::LibUtilities::PhysGalerkinProject3D(), Nektar::SpatialDomains::QuadGeom::QuadGeom(), and Nektar::SpatialDomains::TriGeom::TriGeom().

{
return m_pointsKey;
}
PointsType Nektar::LibUtilities::BasisKey::GetPointsType ( ) const
inline

Return type of quadrature.

Definition at line 151 of file Basis.h.

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

Referenced by Collocation(), ExactIprodInt(), Nektar::MultiRegions::ExpList1D::ExpList1D(), Nektar::MultiRegions::ExpList2D::ExpList2D(), and Nektar::LibUtilities::Basis::GetPointsType().

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

{
int value = 0;
switch(m_basistype)
{
case eOrtho_B:
value = m_nummodes*(m_nummodes+1)/2;
break;
case eOrtho_C:
value = m_nummodes*(m_nummodes+1)*(m_nummodes+2)/6;
break;
case eOrtho_A:
case eFourier:
case eLegendre:
case eChebyshev:
case eMonomial:
value = m_nummodes;
break;
default:
NEKERROR(ErrorUtil::efatal,"Unknown basis being used");
}
return value;
}
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().

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.

{
return ((x.m_nummodes == m_nummodes)
&&(x.m_basistype == m_basistype));
}
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.

{
return (x.m_pointsKey == m_pointsKey);
}

Friends And Related Function Documentation

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

Definition at line 723 of file Basis.cpp.

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

Definition at line 729 of file Basis.cpp.

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

Definition at line 735 of file Basis.cpp.

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

Definition at line 49 of file Basis.cpp.

{
PointsKey lhsPointsKey = lhs.GetPointsKey();
PointsKey rhsPointsKey = rhs.GetPointsKey();
if (lhsPointsKey < rhsPointsKey)
{
return true;
}
if (lhsPointsKey != rhsPointsKey)
{
return false;
}
if (lhs.m_nummodes < rhs.m_nummodes)
{
return true;
}
if (lhs.m_nummodes > rhs.m_nummodes)
{
return false;
}
return (lhs.m_basistype < rhs.m_basistype);
}
bool operator== ( const BasisKey x,
const BasisKey y 
)
friend

Overloaded Operators.

Definition at line 703 of file Basis.cpp.

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

Definition at line 711 of file Basis.cpp.

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

Definition at line 717 of file Basis.cpp.

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

Member Data Documentation

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

Expansion type.

Definition at line 189 of file Basis.h.

Referenced by Collocation(), GetBasisType(), GetTotNumModes(), Nektar::LibUtilities::BasisKey::opLess::operator()(), Nektar::LibUtilities::operator<(), Nektar::LibUtilities::operator==(), and SameExp().

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