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

Functions

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

Function Documentation

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

Definition at line 209 of file ShapeType.hpp.

References ASSERTL1, and ASSERTL2.

{
ASSERTL2(Na > 1, "Order in 'a' direction must be > 1.");
ASSERTL2(Nb > 1, "Order in 'b' direction must be > 1.");
ASSERTL2(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");
int nCoef = Na*(Na+1)/2 + (Nb-Na)*Na // base
+ Na*(Na+1)/2 + (Nc-Na)*Na // front
+ 2*(Nb*(Nb+1)/2 + (Nc-Nb)*Nb)// 2 other sides
- Na - 2*Nb - 3*Nc // less edges
+ 4; // plus vertices
return nCoef;
}
int Nektar::LibUtilities::StdTetData::getNumberOfCoefficients ( int  Na,
int  Nb,
int  Nc 
)
inline

Adds up the number of cells in a truncated Nc by Nc by Nc pyramid, where the longest Na rows and longest Nb columns are kept. Example: (Na, Nb, Nc) = (3, 4, 5); The number of coefficients is the sum of the elements of the following matrix:

|5 4 3 2 0| |4 3 2 0 | |3 2 0 | |0 0 | |0 |

Sum = 28 = number of tet coefficients.

Definition at line 186 of file ShapeType.hpp.

References ASSERTL1, and ASSERTL2.

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

{
ASSERTL2(Na > 1, "Order in 'a' direction must be > 1.");
ASSERTL2(Nb > 1, "Order in 'b' direction must be > 1.");
ASSERTL2(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");
int nCoef = 0;
for (int a = 0; a < Na; ++a)
{
for (int b = 0; b < Nb - a; ++b)
{
for (int c = 0; c < Nc - a - b; ++c)
{
++nCoef;
}
}
}
return nCoef;
}