35 #ifndef NEKTAR_LIB_UTILITIES_BASIC_UTILS_SHAPE_TYPE_H
36 #define NEKTAR_LIB_UTILITIES_BASIC_UTILS_SHAPE_TYPE_H
48 namespace LibUtilities
113 ASSERTL2(Na > 1,
"Order in 'a' direction must be > 1.");
114 ASSERTL2(Nb > 1,
"Order in 'b' direction must be > 1.");
115 ASSERTL1(Na <= Nb,
"order in 'a' direction is higher "
116 "than order in 'b' direction");
117 return Na*(Na+1)/2 + Na*(Nb-Na);
122 ASSERTL2(Na > 1,
"Order in 'a' direction must be > 1.");
123 ASSERTL2(Nb > 1,
"Order in 'b' direction must be > 1.");
124 ASSERTL1(Na <= Nb,
"order in 'a' direction is higher "
125 "than order in 'b' direction");
126 return (Na-1) + 2*(Nb-1);
130 namespace StdQuadData
134 ASSERTL2(Na > 1,
"Order in 'a' direction must be > 1.");
135 ASSERTL2(Nb > 1,
"Order in 'b' direction must be > 1.");
141 ASSERTL2(Na > 1,
"Order in 'a' direction must be > 1.");
142 ASSERTL2(Nb > 1,
"Order in 'b' direction must be > 1.");
143 return 2*(Na-1) + 2*(Nb-1);
153 ASSERTL2(Na > 1,
"Order in 'a' direction must be > 1.");
154 ASSERTL2(Nb > 1,
"Order in 'b' direction must be > 1.");
155 ASSERTL2(Nc > 1,
"Order in 'c' direction must be > 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.");
164 return 2*Na*Nb + 2*Na*Nc + 2*Nb*Nc
165 - 4*(Na + Nb + Nc) + 8;
188 ASSERTL2(Na > 1,
"Order in 'a' direction must be > 1.");
189 ASSERTL2(Nb > 1,
"Order in 'b' direction must be > 1.");
190 ASSERTL2(Nc > 1,
"Order in 'c' direction must be > 1.");
191 ASSERTL1(Na <= Nc,
"order in 'a' direction is higher "
192 "than order in 'c' direction");
193 ASSERTL1(Nb <= Nc,
"order in 'b' direction is higher "
194 "than order in 'c' direction");
196 for (
int a = 0; a < Na; ++a)
198 for (
int b = 0; b < Nb - a; ++b)
200 for (
int c = 0; c < Nc - a - b; ++c)
211 ASSERTL2(Na > 1,
"Order in 'a' direction must be > 1.");
212 ASSERTL2(Nb > 1,
"Order in 'b' direction must be > 1.");
213 ASSERTL2(Nc > 1,
"Order in 'c' direction must be > 1.");
214 ASSERTL1(Na <= Nc,
"order in 'a' direction is higher "
215 "than order in 'c' direction");
216 ASSERTL1(Nb <= Nc,
"order in 'b' direction is higher "
217 "than order in 'c' direction");
219 int nCoef = Na*(Na+1)/2 + (Nb-Na)*Na
220 + Na*(Na+1)/2 + (Nc-Na)*Na
221 + 2*(Nb*(Nb+1)/2 + (Nc-Nb)*Nb)
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.");
243 const int Pi = Na - 2, Qi = Nb - 2, Ri = Nc - 2;
246 Pi * 2 + Qi * 2 + Ri * 4 +
248 Pi * (2*Ri - Pi - 1) +
249 Qi * (2*Ri - Qi - 1);
252 for (
int a = 0; a < Pi - 1; ++a)
254 for (
int b = 0; b < Qi - a - 1; ++b)
256 for (
int c = 0; c < Ri - a - b -1; ++c)
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.");
277 + 2*(Na*(Na+1)/2 + (Nc-Na)*Na)
278 + 2*(Nb*(Nb+1)/2 + (Nc-Nb)*Nb)
284 namespace StdPrismData
288 ASSERTL1(Na > 1,
"Order in 'a' direction must be > 1.");
289 ASSERTL1(Nb > 1,
"Order in 'b' direction must be > 1.");
290 ASSERTL1(Nc > 1,
"Order in 'c' direction must be > 1.");
291 ASSERTL1(Na <= Nc,
"Order in 'a' direction is higher "
292 "than order in 'c' direction.");
299 ASSERTL1(Na > 1,
"Order in 'a' direction must be > 1.");
300 ASSERTL1(Nb > 1,
"Order in 'b' direction must be > 1.");
301 ASSERTL1(Nc > 1,
"Order in 'c' direction must be > 1.");
302 ASSERTL1(Na <= Nc,
"Order in 'a' direction is higher "
303 "than order in 'c' direction.");
305 return Na*Nb + 2*Nb*Nc
306 + 2*( Na*(Na+1)/2 + (Nc-Na)*Na )
318 returnval = modes[offset];
324 returnval = modes[offset]*modes[offset+1];
336 returnval = modes[offset]*modes[offset+1]*modes[offset+2];
339 ASSERTL0(
false,
"Unknown Shape Type");