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
105 boost::ignore_unused(Na);
118 ASSERTL2(Na > 0,
"Order in 'a' direction must be > 0.");
119 ASSERTL2(Nb > 0,
"Order in 'b' direction must be > 0.");
120 ASSERTL1(Na <= Nb,
"order in 'a' direction is higher " 121 "than order in 'b' direction");
122 return Na*(Na+1)/2 + Na*(Nb-Na);
127 ASSERTL2(Na > 1,
"Order in 'a' direction must be > 1.");
128 ASSERTL2(Nb > 1,
"Order in 'b' direction must be > 1.");
129 ASSERTL1(Na <= Nb,
"order in 'a' direction is higher " 130 "than order in 'b' direction");
131 return (Na-1) + 2*(Nb-1);
135 namespace StdQuadData
142 ASSERTL2(Na > 0,
"Order in 'a' direction must be > 0.");
143 ASSERTL2(Nb > 0,
"Order in 'b' direction must be > 0.");
149 ASSERTL2(Na > 1,
"Order in 'a' direction must be > 1.");
150 ASSERTL2(Nb > 1,
"Order in 'b' direction must be > 1.");
151 return 2*(Na-1) + 2*(Nb-1);
161 ASSERTL2(Na > 1,
"Order in 'a' direction must be > 1.");
162 ASSERTL2(Nb > 1,
"Order in 'b' direction must be > 1.");
163 ASSERTL2(Nc > 1,
"Order in 'c' direction must be > 1.");
169 ASSERTL2(Na > 1,
"Order in 'a' direction must be > 1.");
170 ASSERTL2(Nb > 1,
"Order in 'b' direction must be > 1.");
171 ASSERTL2(Nc > 1,
"Order in 'c' direction must be > 1.");
172 return 2*Na*Nb + 2*Na*Nc + 2*Nb*Nc
173 - 4*(Na + Nb + Nc) + 8;
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");
204 for (
int a = 0; a < Na; ++a)
206 for (
int b = 0; b < Nb - a; ++b)
208 for (
int c = 0; c < Nc - a - b; ++c)
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");
227 int nCoef = Na*(Na+1)/2 + (Nb-Na)*Na
228 + Na*(Na+1)/2 + (Nc-Na)*Na
229 + 2*(Nb*(Nb+1)/2 + (Nc-Nb)*Nb)
242 ASSERTL1(Na > 1,
"Order in 'a' direction must be > 1.");
243 ASSERTL1(Nb > 1,
"Order in 'b' direction must be > 1.");
244 ASSERTL1(Nc > 1,
"Order in 'c' direction must be > 1.");
245 ASSERTL1(Na <= Nc,
"Order in 'a' direction is higher " 246 "than order in 'c' direction.");
247 ASSERTL1(Nb <= Nc,
"Order in 'b' direction is higher " 248 "than order in 'c' direction.");
254 for (
int a = 0; a < Na; ++a)
256 for (
int b = 0; b < Nb; ++b)
258 for (
int c = 0; c < Nc - std::max(a,b); ++c)
269 ASSERTL1(Na > 1,
"Order in 'a' direction must be > 1.");
270 ASSERTL1(Nb > 1,
"Order in 'b' direction must be > 1.");
271 ASSERTL1(Nc > 1,
"Order in 'c' direction must be > 1.");
272 ASSERTL1(Na <= Nc,
"Order in 'a' direction is higher " 273 "than order in 'c' direction.");
274 ASSERTL1(Nb <= Nc,
"Order in 'b' direction is higher " 275 "than order in 'c' direction.");
278 + 2*(Na*(Na+1)/2 + (Nc-Na)*Na)
279 + 2*(Nb*(Nb+1)/2 + (Nc-Nb)*Nb)
285 namespace StdPrismData
289 ASSERTL1(Na > 1,
"Order in 'a' direction must be > 1.");
290 ASSERTL1(Nb > 1,
"Order in 'b' direction must be > 1.");
291 ASSERTL1(Nc > 1,
"Order in 'c' direction must be > 1.");
292 ASSERTL1(Na <= Nc,
"Order in 'a' direction is higher " 293 "than order in 'c' direction.");
300 ASSERTL1(Na > 1,
"Order in 'a' direction must be > 1.");
301 ASSERTL1(Nb > 1,
"Order in 'b' direction must be > 1.");
302 ASSERTL1(Nc > 1,
"Order in 'c' direction must be > 1.");
303 ASSERTL1(Na <= Nc,
"Order in 'a' direction is higher " 304 "than order in 'c' direction.");
306 return Na*Nb + 2*Nb*Nc
307 + 2*( Na*(Na+1)/2 + (Nc-Na)*Na )
319 returnval = modes[offset];
325 returnval = modes[offset]*modes[offset+1];
337 returnval = modes[offset]*modes[offset+1]*modes[offset+2];
372 returnval = na*nb*nc;
#define NEKERROR(type, msg)
Assert Level 0 – Fundamental assert which is used whether in FULLDEBUG, DEBUG or OPT compilation mod...
int getNumberOfCoefficients(int Na, int Nb, int Nc)
int getNumberOfCoefficients(int Na, int Nb, int Nc)
const char *const ShapeTypeMap[]
int GetNumberOfCoefficients(ShapeType shape, std::vector< unsigned int > &modes, int offset)
int getNumberOfCoefficients(int Na)
int getNumberOfCoefficients(int Na, int Nb)
int getNumberOfBndCoefficients(int Na)
int getNumberOfCoefficients(int Na, int Nb, int Nc)
#define ASSERTL2(condition, msg)
Assert Level 2 – Debugging which is used FULLDEBUG compilation mode. This level assert is designed t...
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
const unsigned int ShapeTypeDimMap[SIZE_ShapeType]