Nektar++
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

◆ getNumberOfBndCoefficients()

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

Definition at line 217 of file ShapeType.hpp.

References ASSERTL1, and ASSERTL2.

Referenced by Nektar::SpatialDomains::MeshPartition::CalculateElementWeight(), and Nektar::StdRegions::StdTetExp::v_NumBndryCoeffs().

218  {
219  ASSERTL2(Na > 1, "Order in 'a' direction must be > 1.");
220  ASSERTL2(Nb > 1, "Order in 'b' direction must be > 1.");
221  ASSERTL2(Nc > 1, "Order in 'c' direction must be > 1.");
222  ASSERTL1(Na <= Nc, "order in 'a' direction is higher "
223  "than order in 'c' direction");
224  ASSERTL1(Nb <= Nc, "order in 'b' direction is higher "
225  "than order in 'c' direction");
226 
227  int nCoef = Na*(Na+1)/2 + (Nb-Na)*Na // base
228  + Na*(Na+1)/2 + (Nc-Na)*Na // front
229  + 2*(Nb*(Nb+1)/2 + (Nc-Nb)*Nb)// 2 other sides
230  - Na - 2*Nb - 3*Nc // less edges
231  + 4; // plus vertices
232 
233  return nCoef;
234  }
#define ASSERTL2(condition, msg)
Assert Level 2 – Debugging which is used FULLDEBUG compilation mode. This level assert is designed t...
Definition: ErrorUtil.hpp:274
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:250

◆ getNumberOfCoefficients()

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 194 of file ShapeType.hpp.

References ASSERTL1, and ASSERTL2.

Referenced by Nektar::SpatialDomains::MeshPartition::CalculateElementWeight(), Nektar::LibUtilities::FieldIO::CheckFieldDefinition(), Nektar::MultiRegions::ExpList3D::ExpList3D(), Nektar::LibUtilities::GetNumberOfCoefficients(), Nektar::FieldUtils::ProcessEquiSpacedOutput::Process(), Nektar::StdRegions::StdTetExp::v_CalcNumberOfCoefficients(), and Nektar::StdRegions::StdTetExp::v_GenMatrix().

195  {
196  ASSERTL2(Na > 1, "Order in 'a' direction must be > 1.");
197  ASSERTL2(Nb > 1, "Order in 'b' direction must be > 1.");
198  ASSERTL2(Nc > 1, "Order in 'c' direction must be > 1.");
199  ASSERTL1(Na <= Nc, "order in 'a' direction is higher "
200  "than order in 'c' direction");
201  ASSERTL1(Nb <= Nc, "order in 'b' direction is higher "
202  "than order in 'c' direction");
203  int nCoef = 0;
204  for (int a = 0; a < Na; ++a)
205  {
206  for (int b = 0; b < Nb - a; ++b)
207  {
208  for (int c = 0; c < Nc - a - b; ++c)
209  {
210  ++nCoef;
211  }
212  }
213  }
214  return nCoef;
215  }
#define ASSERTL2(condition, msg)
Assert Level 2 – Debugging which is used FULLDEBUG compilation mode. This level assert is designed t...
Definition: ErrorUtil.hpp:274
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:250