37 libmesh_error_msg(
"Hierarchic polynomials require the element type \nbecause edge orientation is needed.");
52 libmesh_assert_greater (totalorder, 0);
60 const Real zeta1 = p(0);
61 const Real zeta2 = p(1);
62 const Real zeta0 = 1. - zeta1 - zeta2;
64 libmesh_assert_less (i, (totalorder+1u)*(totalorder+2u)/2);
65 libmesh_assert (elem->
type() ==
TRI6 || totalorder < 2);
75 else if (i < totalorder + 2u)
78 if (zeta0 + zeta1 == 0.)
81 const unsigned int basisorder = i - 1;
84 if (basisorder%2 && (elem->
point(0) > elem->
point(1)))
87 Real edgeval = (zeta1 - zeta0) / (zeta1 + zeta0);
88 Real crossfunc = zeta0 + zeta1;
89 for (
unsigned int n=1; n != basisorder; ++n)
90 crossfunc *= (zeta0 + zeta1);
92 return f0 * crossfunc *
96 else if (i < 2u*totalorder + 1)
99 if (zeta1 + zeta2 == 0.)
102 const unsigned int basisorder = i - totalorder;
105 if (basisorder%2 && (elem->
point(1) > elem->
point(2)))
108 Real edgeval = (zeta2 - zeta1) / (zeta2 + zeta1);
109 Real crossfunc = zeta2 + zeta1;
110 for (
unsigned int n=1; n != basisorder; ++n)
111 crossfunc *= (zeta2 + zeta1);
113 return f1 * crossfunc *
115 basisorder, edgeval);
117 else if (i < 3u*totalorder)
120 if (zeta0 + zeta2 == 0.)
123 const unsigned int basisorder = i - (2u*totalorder) + 1;
126 if (basisorder%2 && (elem->
point(2) > elem->
point(0)))
129 Real edgeval = (zeta0 - zeta2) / (zeta0 + zeta2);
130 Real crossfunc = zeta0 + zeta2;
131 for (
unsigned int n=1; n != basisorder; ++n)
132 crossfunc *= (zeta0 + zeta2);
134 return f2 * crossfunc *
136 basisorder, edgeval);
141 const unsigned int basisnum = i - (3u*totalorder);
147 for (
unsigned int n = 0; n != exp0; ++n)
149 for (
unsigned int n = 0; n != exp1; ++n)
159 libmesh_assert_less (totalorder, 2);
160 libmesh_fallthrough();
166 const Real xi = p(0);
167 const Real eta = p(1);
169 libmesh_assert_less (i, (totalorder+1u)*(totalorder+1u));
188 else if (i < totalorder + 3u)
189 { i0 = i - 2; i1 = 0; }
190 else if (i < 2u*totalorder + 2)
191 { i0 = 1; i1 = i - totalorder - 1; }
192 else if (i < 3u*totalorder + 1)
193 { i0 = i - 2u*totalorder; i1 = 1; }
194 else if (i < 4u*totalorder)
195 { i0 = 0; i1 = i - 3u*totalorder + 1; }
199 unsigned int basisnum = i - 4*totalorder;
208 if ((i0%2) && (i0 > 2) && (i1 == 0))
210 else if ((i0%2) && (i0>2) && (i1 == 1))
212 else if ((i0 == 0) && (i1%2) && (i1>2))
214 else if ((i0 == 1) && (i1%2) && (i1>2))
222 libmesh_error_msg(
"ERROR: Unsupported element type = " << elem->
type());
237 libmesh_error_msg(
"Hierarchic polynomials require the element type \nbecause edge orientation is needed.");
246 const unsigned int i,
247 const unsigned int j,
250 libmesh_assert(elem);
256 libmesh_assert_greater (totalorder, 0);
265 const Real eps = 1.e-6;
267 libmesh_assert_less (j, 2);
274 const Point pp(p(0)+eps, p(1));
275 const Point pm(p(0)-eps, p(1));
284 const Point pp(p(0), p(1)+eps);
285 const Point pm(p(0), p(1)-eps);
292 libmesh_error_msg(
"Invalid derivative index j = " << j);
298 libmesh_assert_less (totalorder, 2);
299 libmesh_fallthrough();
305 const Real xi = p(0);
306 const Real eta = p(1);
308 libmesh_assert_less (i, (totalorder+1u)*(totalorder+1u));
327 else if (i < totalorder + 3u)
328 { i0 = i - 2; i1 = 0; }
329 else if (i < 2u*totalorder + 2)
330 { i0 = 1; i1 = i - totalorder - 1; }
331 else if (i < 3u*totalorder + 1u)
332 { i0 = i - 2u*totalorder; i1 = 1; }
333 else if (i < 4u*totalorder)
334 { i0 = 0; i1 = i - 3u*totalorder + 1; }
338 unsigned int basisnum = i - 4*totalorder;
347 if ((i0%2) && (i0 > 2) && (i1 == 0))
349 else if ((i0%2) && (i0>2) && (i1 == 1))
351 else if ((i0 == 0) && (i1%2) && (i1>2))
353 else if ((i0 == 1) && (i1%2) && (i1>2))
369 libmesh_error_msg(
"Invalid derivative index j = " << j);
374 libmesh_error_msg(
"ERROR: Unsupported element type = " << type);
389 libmesh_error_msg(
"Hierarchic polynomials require the element type \nbecause edge orientation is needed.");
398 const unsigned int i,
399 const unsigned int j,
402 libmesh_assert(elem);
406 const Real eps = 1.e-6;
415 pp =
Point(p(0)+eps, p(1));
416 pm =
Point(p(0)-eps, p(1));
424 pp =
Point(p(0), p(1)+eps);
425 pm =
Point(p(0), p(1)-eps);
433 pp =
Point(p(0), p(1)+eps);
434 pm =
Point(p(0), p(1)-eps);
439 libmesh_error_msg(
"Invalid derivative index j = " << j);
const unsigned int invalid_uint
static OutputShape shape(const ElemType t, const Order o, const unsigned int i, const Point &p)
The base class for all geometric element types.
const unsigned char triangular_number_row[]
static OutputShape shape_deriv(const ElemType t, const Order o, const unsigned int i, const unsigned int j, const Point &p)
unsigned int p_level() const
const unsigned char square_number_column[]
Template class which generates the different FE families and orders.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const unsigned char triangular_number_column[]
const unsigned char square_number_row[]
virtual ElemType type() const =0
A geometric point in (x,y,z) space.
const Point & point(const unsigned int i) const
static OutputShape shape_second_deriv(const ElemType t, const Order o, const unsigned int i, const unsigned int j, const Point &p)