Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties 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.

Referenced by Nektar::LibUtilities::MeshPartition::CalculateElementWeight(), and Nektar::StdRegions::StdPyrExp::v_NumBndryCoeffs().

267  {
268  ASSERTL1(Na > 1, "Order in 'a' direction must be > 1.");
269  ASSERTL1(Nb > 1, "Order in 'b' direction must be > 1.");
270  ASSERTL1(Nc > 1, "Order in 'c' direction must be > 1.");
271  ASSERTL1(Na <= Nc, "Order in 'a' direction is higher "
272  "than order in 'c' direction.");
273  ASSERTL1(Nb <= Nc, "Order in 'b' direction is higher "
274  "than order in 'c' direction.");
275 
276  return Na*Nb // base
277  + 2*(Na*(Na+1)/2 + (Nc-Na)*Na) // front and back
278  + 2*(Nb*(Nb+1)/2 + (Nc-Nb)*Nb) // sides
279  - 2*Na - 2*Nb - 4*Nc // less edges
280  + 5; // plus vertices
281  }
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:228
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::MeshPartition::CalculateElementWeight(), Nektar::LibUtilities::FieldIO::CheckFieldDefinition(), Nektar::LibUtilities::GetNumberOfCoefficients(), Nektar::FieldUtils::ProcessEquiSpacedOutput::SetupEquiSpacedField(), and Nektar::StdRegions::StdPyrExp::v_CalcNumberOfCoefficients().

233  {
234  ASSERTL1(Na > 1, "Order in 'a' direction must be > 1.");
235  ASSERTL1(Nb > 1, "Order in 'b' direction must be > 1.");
236  ASSERTL1(Nc > 1, "Order in 'c' direction must be > 1.");
237  ASSERTL1(Na <= Nc, "Order in 'a' direction is higher "
238  "than order in 'c' direction.");
239  ASSERTL1(Nb <= Nc, "Order in 'b' direction is higher "
240  "than order in 'c' direction.");
241 
242  // Count number of coefficients explicitly.
243  const int Pi = Na - 2, Qi = Nb - 2, Ri = Nc - 2;
244  int nCoeff =
245  5 + // vertices
246  Pi * 2 + Qi * 2 + Ri * 4 + // base edges
247  Pi * Qi + // base quad
248  Pi * (2*Ri - Pi - 1) + // p-r triangles;
249  Qi * (2*Ri - Qi - 1); // q-r triangles;
250 
251  // Count number of interior tet modes
252  for (int a = 0; a < Pi - 1; ++a)
253  {
254  for (int b = 0; b < Qi - a - 1; ++b)
255  {
256  for (int c = 0; c < Ri - a - b -1; ++c)
257  {
258  ++nCoeff;
259  }
260  }
261  }
262 
263  return nCoeff;
264  }
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:228