Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Functions
Nektar::LibUtilities::StdPyrData Namespace Reference

Functions

int getNumberOfCoefficients (int Na, int Nb, int Nc)
int getNumberOfBndCoefficients (int Na, int Nb, int Nc)

Function Documentation

int Nektar::LibUtilities::StdPyrData::getNumberOfBndCoefficients ( int  Na,
int  Nb,
int  Nc 
)
inline

Definition at line 266 of file ShapeType.hpp.

References ASSERTL1.

{
ASSERTL1(Na > 1, "Order in 'a' direction must be > 1.");
ASSERTL1(Nb > 1, "Order in 'b' direction must be > 1.");
ASSERTL1(Nc > 1, "Order in 'c' direction must be > 1.");
ASSERTL1(Na <= Nc, "Order in 'a' direction is higher "
"than order in 'c' direction.");
ASSERTL1(Nb <= Nc, "Order in 'b' direction is higher "
"than order in 'c' direction.");
return Na*Nb // base
+ 2*(Na*(Na+1)/2 + (Nc-Na)*Na) // front and back
+ 2*(Nb*(Nb+1)/2 + (Nc-Nb)*Nb) // sides
- 2*Na - 2*Nb - 4*Nc // less edges
+ 5; // plus vertices
}
int Nektar::LibUtilities::StdPyrData::getNumberOfCoefficients ( int  Na,
int  Nb,
int  Nc 
)
inline

Definition at line 232 of file ShapeType.hpp.

References ASSERTL1.

Referenced by Nektar::LibUtilities::GetNumberOfCoefficients().

{
ASSERTL1(Na > 1, "Order in 'a' direction must be > 1.");
ASSERTL1(Nb > 1, "Order in 'b' direction must be > 1.");
ASSERTL1(Nc > 1, "Order in 'c' direction must be > 1.");
ASSERTL1(Na <= Nc, "Order in 'a' direction is higher "
"than order in 'c' direction.");
ASSERTL1(Nb <= Nc, "Order in 'b' direction is higher "
"than order in 'c' direction.");
// Count number of coefficients explicitly.
const int Pi = Na - 2, Qi = Nb - 2, Ri = Nc - 2;
int nCoeff =
5 + // vertices
Pi * 2 + Qi * 2 + Ri * 4 + // base edges
Pi * Qi + // base quad
Pi * (2*Ri - Pi - 1) + // p-r triangles;
Qi * (2*Ri - Qi - 1); // q-r triangles;
// Count number of interior tet modes
for (int a = 0; a < Pi - 1; ++a)
{
for (int b = 0; b < Qi - a - 1; ++b)
{
for (int c = 0; c < Ri - a - b -1; ++c)
{
++nCoeff;
}
}
}
return nCoeff;
}