35#ifndef NEKTAR_LIB_UTILITIES_BASIC_UTILS_SHAPE_TYPE_H
36#define NEKTAR_LIB_UTILITIES_BASIC_UTILS_SHAPE_TYPE_H
82 "NoGeomShapeType",
"Point",
"Segment",
"Triangle",
83 "Quadrilateral",
"Tetrahedron",
"Pyramid",
"Prism",
84 "Hexahedron",
"NodalTri",
"NodalTet",
"NodalPrism"};
123 ASSERTL2(Na > 0,
"Order in 'a' direction must be > 0.");
124 ASSERTL2(Nb > 0,
"Order in 'b' direction must be > 0.");
125 ASSERTL1(Na <= Nb,
"order in 'a' direction is higher "
126 "than order in 'b' direction");
127 return Na * (Na + 1) / 2 + Na * (Nb - Na);
132 ASSERTL2(Na > 1,
"Order in 'a' direction must be > 1.");
133 ASSERTL2(Nb > 1,
"Order in 'b' direction must be > 1.");
134 ASSERTL1(Na <= Nb,
"order in 'a' direction is higher "
135 "than order in 'b' direction");
136 return (Na - 1) + 2 * (Nb - 1);
141namespace StdNodalTriData
145 ASSERTL1(Na == Nb,
"order in 'a' direction needs to be the same as "
146 "b' direction for nodaltri");
147 return Na * (Nb + 1) / 2;
152 ASSERTL1(Na == Nb,
"order in 'a' direction needs to be the same as "
153 "b' direction for nodaltri");
154 return (Na - 1) + 2 * (Nb - 1);
165 ASSERTL2(Na > 0,
"Order in 'a' direction must be > 0.");
166 ASSERTL2(Nb > 0,
"Order in 'b' direction must be > 0.");
172 ASSERTL2(Na > 1,
"Order in 'a' direction must be > 1.");
173 ASSERTL2(Nb > 1,
"Order in 'b' direction must be > 1.");
174 return 2 * (Na - 1) + 2 * (Nb - 1);
182 ASSERTL2(Na > 1,
"Order in 'a' direction must be > 1.");
183 ASSERTL2(Nb > 1,
"Order in 'b' direction must be > 1.");
184 ASSERTL2(Nc > 1,
"Order in 'c' direction must be > 1.");
190 ASSERTL2(Na > 1,
"Order in 'a' direction must be > 1.");
191 ASSERTL2(Nb > 1,
"Order in 'b' direction must be > 1.");
192 ASSERTL2(Nc > 1,
"Order in 'c' direction must be > 1.");
193 return 2 * Na * Nb + 2 * Na * Nc + 2 * Nb * Nc - 4 * (Na + Nb + Nc) + 8;
216 ASSERTL2(Na > 1,
"Order in 'a' direction must be > 1.");
217 ASSERTL2(Nb > 1,
"Order in 'b' direction must be > 1.");
218 ASSERTL2(Nc > 1,
"Order in 'c' direction must be > 1.");
219 ASSERTL1(Na <= Nc,
"order in 'a' direction is higher "
220 "than order in 'c' direction");
221 ASSERTL1(Nb <= Nc,
"order in 'b' direction is higher "
222 "than order in 'c' direction");
223 int nCoef = Na * Nb * Nc - Na * Nc * (Na - 1) / 2 - Na * Nb * (Nb - 1) / 2 +
224 Na * (Na - 1) * (Na - 2) / 6;
229 ASSERTL2(Na > 1,
"Order in 'a' direction must be > 1.");
230 ASSERTL2(Nb > 1,
"Order in 'b' direction must be > 1.");
231 ASSERTL2(Nc > 1,
"Order in 'c' direction must be > 1.");
232 ASSERTL1(Na <= Nc,
"order in 'a' direction is higher "
233 "than order in 'c' direction");
234 ASSERTL1(Nb <= Nc,
"order in 'b' direction is higher "
235 "than order in 'c' direction");
237 int nCoef = Na * (Na + 1) / 2 + (Nb - Na) * Na
238 + Na * (Na + 1) / 2 + (Nc - Na) * Na
239 + 2 * (Nb * (Nb + 1) / 2 + (Nc - Nb) * Nb)
240 - Na - 2 * Nb - 3 * Nc
247namespace StdNodalTetData
266 ASSERTL1(Na == Nb,
"order in 'a' direction needs to be the same as "
267 "b' direction for nodaltet");
268 ASSERTL1(Nb == Nc,
"order in 'a' direction needs to be the same as "
269 "c' direction for nodaltet");
270 return Na * (Nb + 1) * (Nc + 2) / 6;
275 ASSERTL1(Na == Nb,
"order in 'a' direction needs to be the same as "
276 "b' direction for nodaltet");
277 ASSERTL1(Nb == Nc,
"order in 'a' direction needs to be the same as "
278 "c' direction for nodaltet");
279 int nCoef = Na * (Na + 1) / 2 + (Nb - Na) * Na
280 + Na * (Na + 1) / 2 + (Nc - Na) * Na
281 + 2 * (Nb * (Nb + 1) / 2 + (Nc - Nb) * Nb)
282 - Na - 2 * Nb - 3 * Nc
293 ASSERTL1(Na > 1,
"Order in 'a' direction must be > 1.");
294 ASSERTL1(Nb > 1,
"Order in 'b' direction must be > 1.");
295 ASSERTL1(Nc > 1,
"Order in 'c' direction must be > 1.");
296 ASSERTL1(Na <= Nc,
"Order in 'a' direction is higher "
297 "than order in 'c' direction.");
298 ASSERTL1(Nb <= Nc,
"Order in 'b' direction is higher "
299 "than order in 'c' direction.");
305 for (
int a = 0; a < Na; ++a)
307 for (
int b = 0; b < Nb; ++b)
309 for (
int c = 0; c < Nc - std::max(a, b); ++c)
320 ASSERTL1(Na > 1,
"Order in 'a' direction must be > 1.");
321 ASSERTL1(Nb > 1,
"Order in 'b' direction must be > 1.");
322 ASSERTL1(Nc > 1,
"Order in 'c' direction must be > 1.");
323 ASSERTL1(Na <= Nc,
"Order in 'a' direction is higher "
324 "than order in 'c' direction.");
325 ASSERTL1(Nb <= Nc,
"Order in 'b' direction is higher "
326 "than order in 'c' direction.");
329 + 2 * (Na * (Na + 1) / 2 + (Nc - Na) * Na)
330 + 2 * (Nb * (Nb + 1) / 2 + (Nc - Nb) * Nb)
331 - 2 * Na - 2 * Nb - 4 * Nc
336namespace StdPrismData
340 ASSERTL1(Na > 1,
"Order in 'a' direction must be > 1.");
341 ASSERTL1(Nb > 1,
"Order in 'b' direction must be > 1.");
342 ASSERTL1(Nc > 1,
"Order in 'c' direction must be > 1.");
343 ASSERTL1(Na <= Nc,
"Order in 'a' direction is higher "
344 "than order in 'c' direction.");
351 ASSERTL1(Na > 1,
"Order in 'a' direction must be > 1.");
352 ASSERTL1(Nb > 1,
"Order in 'b' direction must be > 1.");
353 ASSERTL1(Nc > 1,
"Order in 'c' direction must be > 1.");
354 ASSERTL1(Na <= Nc,
"Order in 'a' direction is higher "
355 "than order in 'c' direction.");
357 return Na * Nb + 2 * Nb * Nc
358 + 2 * (Na * (Na + 1) / 2 + (Nc - Na) * Na)
359 - 2 * Na - 3 * Nb - 4 * Nc
364namespace StdNodalPrismData
368 ASSERTL1(Na > 1,
"Order in 'a' direction must be > 1.");
369 ASSERTL1(Nb > 1,
"Order in 'b' direction must be > 1.");
370 ASSERTL1(Nc > 1,
"Order in 'c' direction must be > 1.");
371 ASSERTL1(Na <= Nc,
"Order in 'a' direction is higher "
372 "than order in 'c' direction.");
379 ASSERTL1(Na > 1,
"Order in 'a' direction must be > 1.");
380 ASSERTL1(Nb > 1,
"Order in 'b' direction must be > 1.");
381 ASSERTL1(Nc > 1,
"Order in 'c' direction must be > 1.");
382 ASSERTL1(Na <= Nc,
"Order in 'a' direction is higher "
383 "than order in 'c' direction.");
385 return Na * Nb + 2 * Nb * Nc
386 + 2 * (Na * (Na + 1) / 2 + (Nc - Na) * Na)
387 - 2 * Na - 3 * Nb - 4 * Nc
393 std::vector<unsigned int> &modes,
400 returnval = modes[offset];
408 modes[offset], modes[offset + 1]);
411 returnval = modes[offset] * modes[offset + 1];
415 modes[offset], modes[offset + 1], modes[offset + 2]);
419 modes[offset], modes[offset + 1], modes[offset + 2]);
423 modes[offset], modes[offset + 1], modes[offset + 2]);
426 returnval = modes[offset] * modes[offset + 1] * modes[offset + 2];
437 int nb = 0,
int nc = 0)
470 returnval = na * nb * nc;
#define NEKERROR(type, msg)
Assert Level 0 – Fundamental assert which is used whether in FULLDEBUG, DEBUG or OPT compilation mode...
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode....
#define ASSERTL2(condition, msg)
Assert Level 2 – Debugging which is used FULLDEBUG compilation mode. This level assert is designed to...
constexpr int getNumberOfBndCoefficients(int Na, int Nb, int Nc)
constexpr int getNumberOfCoefficients(int Na, int Nb, int Nc)
constexpr int getNumberOfCoefficients(int Na, int Nb, int Nc)
constexpr int getNumberOfBndCoefficients(int Na, int Nb, int Nc)
constexpr int getNumberOfCoefficients(int Na, int Nb, int Nc)
constexpr int getNumberOfBndCoefficients(int Na, int Nb, int Nc)
constexpr int getNumberOfCoefficients(int Na, int Nb)
constexpr int getNumberOfBndCoefficients(int Na, int Nb)
constexpr int getNumberOfCoefficients(int Na, int Nb, int Nc)
constexpr int getNumberOfBndCoefficients(int Na, int Nb, int Nc)
constexpr int getNumberOfBndCoefficients(int Na, int Nb, int Nc)
constexpr int getNumberOfCoefficients(int Na, int Nb, int Nc)
constexpr int getNumberOfBndCoefficients(int Na, int Nb)
constexpr int getNumberOfCoefficients(int Na, int Nb)
constexpr int getNumberOfBndCoefficients(int Na)
constexpr int getNumberOfCoefficients(int Na)
constexpr int getNumberOfCoefficients(int Na, int Nb, int Nc)
constexpr int getNumberOfBndCoefficients(int Na, int Nb, int Nc)
constexpr int getNumberOfBndCoefficients(int Na, int Nb)
constexpr int getNumberOfCoefficients(int Na, int Nb)
const char *const ShapeTypeMap[SIZE_ShapeType]
constexpr int GetNumberOfCoefficients(ShapeType shape, std::vector< unsigned int > &modes, int offset=0)
constexpr unsigned int ShapeTypeDimMap[SIZE_ShapeType]