33 #ifndef NEKTAR_LIB_UTILITIES_BASIC_UTILS_SHAPE_TYPE_H
34 #define NEKTAR_LIB_UTILITIES_BASIC_UTILS_SHAPE_TYPE_H
39 #include <boost/core/ignore_unused.hpp>
49 namespace LibUtilities
78 "NoGeomShapeType",
"Point",
"Segment",
"Triangle",
"Quadrilateral",
79 "Tetrahedron",
"Pyramid",
"Prism",
"Hexahedron",
104 boost::ignore_unused(Na);
117 ASSERTL2(Na > 0,
"Order in 'a' direction must be > 0.");
118 ASSERTL2(Nb > 0,
"Order in 'b' direction must be > 0.");
119 ASSERTL1(Na <= Nb,
"order in 'a' direction is higher "
120 "than order in 'b' direction");
121 return Na * (Na + 1) / 2 + Na * (Nb - Na);
126 ASSERTL2(Na > 1,
"Order in 'a' direction must be > 1.");
127 ASSERTL2(Nb > 1,
"Order in 'b' direction must be > 1.");
128 ASSERTL1(Na <= Nb,
"order in 'a' direction is higher "
129 "than order in 'b' direction");
130 return (Na - 1) + 2 * (Nb - 1);
134 namespace StdQuadData
141 ASSERTL2(Na > 0,
"Order in 'a' direction must be > 0.");
142 ASSERTL2(Nb > 0,
"Order in 'b' direction must be > 0.");
148 ASSERTL2(Na > 1,
"Order in 'a' direction must be > 1.");
149 ASSERTL2(Nb > 1,
"Order in 'b' direction must be > 1.");
150 return 2 * (Na - 1) + 2 * (Nb - 1);
158 ASSERTL2(Na > 1,
"Order in 'a' direction must be > 1.");
159 ASSERTL2(Nb > 1,
"Order in 'b' direction must be > 1.");
160 ASSERTL2(Nc > 1,
"Order in 'c' direction must be > 1.");
166 ASSERTL2(Na > 1,
"Order in 'a' direction must be > 1.");
167 ASSERTL2(Nb > 1,
"Order in 'b' direction must be > 1.");
168 ASSERTL2(Nc > 1,
"Order in 'c' direction must be > 1.");
169 return 2 * Na * Nb + 2 * Na * Nc + 2 * Nb * Nc - 4 * (Na + Nb + Nc) + 8;
192 ASSERTL2(Na > 1,
"Order in 'a' direction must be > 1.");
193 ASSERTL2(Nb > 1,
"Order in 'b' direction must be > 1.");
194 ASSERTL2(Nc > 1,
"Order in 'c' direction must be > 1.");
195 ASSERTL1(Na <= Nc,
"order in 'a' direction is higher "
196 "than order in 'c' direction");
197 ASSERTL1(Nb <= Nc,
"order in 'b' direction is higher "
198 "than order in 'c' direction");
200 for (
int a = 0; a < Na; ++a)
202 for (
int b = 0; b < Nb - a; ++b)
204 for (
int c = 0; c < Nc - a - b; ++c)
215 ASSERTL2(Na > 1,
"Order in 'a' direction must be > 1.");
216 ASSERTL2(Nb > 1,
"Order in 'b' direction must be > 1.");
217 ASSERTL2(Nc > 1,
"Order in 'c' direction must be > 1.");
218 ASSERTL1(Na <= Nc,
"order in 'a' direction is higher "
219 "than order in 'c' direction");
220 ASSERTL1(Nb <= Nc,
"order in 'b' direction is higher "
221 "than order in 'c' direction");
223 int nCoef = Na * (Na + 1) / 2 + (Nb - Na) * Na
224 + Na * (Na + 1) / 2 + (Nc - Na) * Na
225 + 2 * (Nb * (Nb + 1) / 2 + (Nc - Nb) * Nb)
226 - Na - 2 * Nb - 3 * Nc
237 ASSERTL1(Na > 1,
"Order in 'a' direction must be > 1.");
238 ASSERTL1(Nb > 1,
"Order in 'b' direction must be > 1.");
239 ASSERTL1(Nc > 1,
"Order in 'c' direction must be > 1.");
240 ASSERTL1(Na <= Nc,
"Order in 'a' direction is higher "
241 "than order in 'c' direction.");
242 ASSERTL1(Nb <= Nc,
"Order in 'b' direction is higher "
243 "than order in 'c' direction.");
249 for (
int a = 0; a < Na; ++a)
251 for (
int b = 0; b < Nb; ++b)
253 for (
int c = 0; c < Nc - std::max(a, b); ++c)
264 ASSERTL1(Na > 1,
"Order in 'a' direction must be > 1.");
265 ASSERTL1(Nb > 1,
"Order in 'b' direction must be > 1.");
266 ASSERTL1(Nc > 1,
"Order in 'c' direction must be > 1.");
267 ASSERTL1(Na <= Nc,
"Order in 'a' direction is higher "
268 "than order in 'c' direction.");
269 ASSERTL1(Nb <= Nc,
"Order in 'b' direction is higher "
270 "than order in 'c' direction.");
273 + 2 * (Na * (Na + 1) / 2 + (Nc - Na) * Na)
274 + 2 * (Nb * (Nb + 1) / 2 + (Nc - Nb) * Nb)
275 - 2 * Na - 2 * Nb - 4 * Nc
280 namespace StdPrismData
284 ASSERTL1(Na > 1,
"Order in 'a' direction must be > 1.");
285 ASSERTL1(Nb > 1,
"Order in 'b' direction must be > 1.");
286 ASSERTL1(Nc > 1,
"Order in 'c' direction must be > 1.");
287 ASSERTL1(Na <= Nc,
"Order in 'a' direction is higher "
288 "than order in 'c' direction.");
295 ASSERTL1(Na > 1,
"Order in 'a' direction must be > 1.");
296 ASSERTL1(Nb > 1,
"Order in 'b' direction must be > 1.");
297 ASSERTL1(Nc > 1,
"Order in 'c' direction must be > 1.");
298 ASSERTL1(Na <= Nc,
"Order in 'a' direction is higher "
299 "than order in 'c' direction.");
301 return Na * Nb + 2 * Nb * Nc
302 + 2 * (Na * (Na + 1) / 2 + (Nc - Na) * Na)
303 - 2 * Na - 3 * Nb - 4 * Nc
309 std::vector<unsigned int> &
modes,
316 returnval =
modes[offset];
323 returnval =
modes[offset] *
modes[offset + 1];
373 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...
int getNumberOfCoefficients(int Na, int Nb, int Nc)
int getNumberOfBndCoefficients(int Na, int Nb, int Nc)
int getNumberOfCoefficients(int Na, int Nb, int Nc)
int getNumberOfBndCoefficients(int Na, int Nb, int Nc)
int getNumberOfCoefficients(int Na, int Nb, int Nc)
int getNumberOfBndCoefficients(int Na, int Nb, int Nc)
int getNumberOfCoefficients(int Na, int Nb)
int getNumberOfBndCoefficients(int Na, int Nb)
int getNumberOfCoefficients(int Na)
int getNumberOfBndCoefficients(int Na)
int getNumberOfBndCoefficients(int Na, int Nb, int Nc)
int getNumberOfCoefficients(int Na, int Nb, int Nc)
int getNumberOfCoefficients(int Na, int Nb)
int getNumberOfBndCoefficients(int Na, int Nb)
const char *const ShapeTypeMap[SIZE_ShapeType]
int GetNumberOfCoefficients(ShapeType shape, std::vector< unsigned int > &modes, int offset=0)
constexpr unsigned int ShapeTypeDimMap[SIZE_ShapeType]
The above copyright notice and this permission notice shall be included.