35 #ifndef NEKTAR_LIB_UTILITIES_BASIC_UTILS_SHAPE_TYPE_H
36 #define NEKTAR_LIB_UTILITIES_BASIC_UTILS_SHAPE_TYPE_H
41 #include <boost/core/ignore_unused.hpp>
51 namespace LibUtilities
80 "NoGeomShapeType",
"Point",
"Segment",
"Triangle",
"Quadrilateral",
81 "Tetrahedron",
"Pyramid",
"Prism",
"Hexahedron",
106 boost::ignore_unused(Na);
119 ASSERTL2(Na > 0,
"Order in 'a' direction must be > 0.");
120 ASSERTL2(Nb > 0,
"Order in 'b' direction must be > 0.");
121 ASSERTL1(Na <= Nb,
"order in 'a' direction is higher "
122 "than order in 'b' direction");
123 return Na * (Na + 1) / 2 + Na * (Nb - Na);
128 ASSERTL2(Na > 1,
"Order in 'a' direction must be > 1.");
129 ASSERTL2(Nb > 1,
"Order in 'b' direction must be > 1.");
130 ASSERTL1(Na <= Nb,
"order in 'a' direction is higher "
131 "than order in 'b' direction");
132 return (Na - 1) + 2 * (Nb - 1);
136 namespace StdQuadData
143 ASSERTL2(Na > 0,
"Order in 'a' direction must be > 0.");
144 ASSERTL2(Nb > 0,
"Order in 'b' direction must be > 0.");
150 ASSERTL2(Na > 1,
"Order in 'a' direction must be > 1.");
151 ASSERTL2(Nb > 1,
"Order in 'b' direction must be > 1.");
152 return 2 * (Na - 1) + 2 * (Nb - 1);
160 ASSERTL2(Na > 1,
"Order in 'a' direction must be > 1.");
161 ASSERTL2(Nb > 1,
"Order in 'b' direction must be > 1.");
162 ASSERTL2(Nc > 1,
"Order in 'c' direction must be > 1.");
168 ASSERTL2(Na > 1,
"Order in 'a' direction must be > 1.");
169 ASSERTL2(Nb > 1,
"Order in 'b' direction must be > 1.");
170 ASSERTL2(Nc > 1,
"Order in 'c' direction must be > 1.");
171 return 2 * Na * Nb + 2 * Na * Nc + 2 * Nb * Nc - 4 * (Na + Nb + Nc) + 8;
194 ASSERTL2(Na > 1,
"Order in 'a' direction must be > 1.");
195 ASSERTL2(Nb > 1,
"Order in 'b' direction must be > 1.");
196 ASSERTL2(Nc > 1,
"Order in 'c' direction must be > 1.");
197 ASSERTL1(Na <= Nc,
"order in 'a' direction is higher "
198 "than order in 'c' direction");
199 ASSERTL1(Nb <= Nc,
"order in 'b' direction is higher "
200 "than order in 'c' direction");
202 for (
int a = 0; a < Na; ++a)
204 for (
int b = 0; b < Nb - a; ++b)
206 for (
int c = 0; c < Nc - a - b; ++c)
217 ASSERTL2(Na > 1,
"Order in 'a' direction must be > 1.");
218 ASSERTL2(Nb > 1,
"Order in 'b' direction must be > 1.");
219 ASSERTL2(Nc > 1,
"Order in 'c' direction must be > 1.");
220 ASSERTL1(Na <= Nc,
"order in 'a' direction is higher "
221 "than order in 'c' direction");
222 ASSERTL1(Nb <= Nc,
"order in 'b' direction is higher "
223 "than order in 'c' direction");
225 int nCoef = Na * (Na + 1) / 2 + (Nb - Na) * Na
226 + Na * (Na + 1) / 2 + (Nc - Na) * Na
227 + 2 * (Nb * (Nb + 1) / 2 + (Nc - Nb) * Nb)
228 - Na - 2 * Nb - 3 * Nc
239 ASSERTL1(Na > 1,
"Order in 'a' direction must be > 1.");
240 ASSERTL1(Nb > 1,
"Order in 'b' direction must be > 1.");
241 ASSERTL1(Nc > 1,
"Order in 'c' direction must be > 1.");
242 ASSERTL1(Na <= Nc,
"Order in 'a' direction is higher "
243 "than order in 'c' direction.");
244 ASSERTL1(Nb <= Nc,
"Order in 'b' direction is higher "
245 "than order in 'c' direction.");
251 for (
int a = 0; a < Na; ++a)
253 for (
int b = 0; b < Nb; ++b)
255 for (
int c = 0; c < Nc - std::max(a, b); ++c)
266 ASSERTL1(Na > 1,
"Order in 'a' direction must be > 1.");
267 ASSERTL1(Nb > 1,
"Order in 'b' direction must be > 1.");
268 ASSERTL1(Nc > 1,
"Order in 'c' direction must be > 1.");
269 ASSERTL1(Na <= Nc,
"Order in 'a' direction is higher "
270 "than order in 'c' direction.");
271 ASSERTL1(Nb <= Nc,
"Order in 'b' direction is higher "
272 "than order in 'c' direction.");
275 + 2 * (Na * (Na + 1) / 2 + (Nc - Na) * Na)
276 + 2 * (Nb * (Nb + 1) / 2 + (Nc - Nb) * Nb)
277 - 2 * Na - 2 * Nb - 4 * Nc
282 namespace StdPrismData
286 ASSERTL1(Na > 1,
"Order in 'a' direction must be > 1.");
287 ASSERTL1(Nb > 1,
"Order in 'b' direction must be > 1.");
288 ASSERTL1(Nc > 1,
"Order in 'c' direction must be > 1.");
289 ASSERTL1(Na <= Nc,
"Order in 'a' direction is higher "
290 "than order in 'c' direction.");
297 ASSERTL1(Na > 1,
"Order in 'a' direction must be > 1.");
298 ASSERTL1(Nb > 1,
"Order in 'b' direction must be > 1.");
299 ASSERTL1(Nc > 1,
"Order in 'c' direction must be > 1.");
300 ASSERTL1(Na <= Nc,
"Order in 'a' direction is higher "
301 "than order in 'c' direction.");
303 return Na * Nb + 2 * Nb * Nc
304 + 2 * (Na * (Na + 1) / 2 + (Nc - Na) * Na)
305 - 2 * Na - 3 * Nb - 4 * Nc
311 std::vector<unsigned int> &
modes,
318 returnval =
modes[offset];
325 returnval =
modes[offset] *
modes[offset + 1];
375 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.