33 Point get_min_point(
const Elem * elem,
40 std::min(elem->point(c),elem->point(d)));
43 void cube_indices(
const Elem * elem,
44 const unsigned int totalorder,
64 const unsigned int e = totalorder - 1u;
66 libmesh_assert_less (i, (totalorder+1u)*(totalorder+1u)*(totalorder+1u));
68 Real xi_saved = xi, eta_saved = eta, zeta_saved = zeta;
125 if (elem->point(0) > elem->point(1))
129 else if (i < 8 + 2*e)
134 if (elem->point(1) > elem->point(2))
138 else if (i < 8 + 3*e)
143 if (elem->point(3) > elem->point(2))
147 else if (i < 8 + 4*e)
152 if (elem->point(0) > elem->point(3))
156 else if (i < 8 + 5*e)
161 if (elem->point(0) > elem->point(4))
165 else if (i < 8 + 6*e)
170 if (elem->point(1) > elem->point(5))
174 else if (i < 8 + 7*e)
179 if (elem->point(2) > elem->point(6))
183 else if (i < 8 + 8*e)
188 if (elem->point(3) > elem->point(7))
192 else if (i < 8 + 9*e)
197 if (elem->point(4) > elem->point(5))
201 else if (i < 8 + 10*e)
206 if (elem->point(5) > elem->point(6))
210 else if (i < 8 + 11*e)
215 if (elem->point(7) > elem->point(6))
219 else if (i < 8 + 12*e)
224 if (elem->point(4) > elem->point(7))
228 else if (i < 8 + 12*e + e*e)
230 unsigned int basisnum = i - 8 - 12*e;
234 const Point min_point = get_min_point(elem, 1, 2, 0, 3);
236 if (elem->point(0) == min_point)
237 if (elem->point(1) ==
std::min(elem->point(1), elem->point(3)))
250 else if (elem->point(3) == min_point)
251 if (elem->point(0) ==
std::min(elem->point(0), elem->point(2)))
264 else if (elem->point(2) == min_point)
265 if (elem->point(3) ==
std::min(elem->point(3), elem->point(1)))
278 else if (elem->point(1) == min_point)
280 if (elem->point(2) ==
std::min(elem->point(2), elem->point(0)))
295 else if (i < 8 + 12*e + 2*e*e)
297 unsigned int basisnum = i - 8 - 12*e - e*e;
301 const Point min_point = get_min_point(elem, 0, 1, 5, 4);
303 if (elem->point(0) == min_point)
304 if (elem->point(1) ==
std::min(elem->point(1), elem->point(4)))
317 else if (elem->point(1) == min_point)
318 if (elem->point(5) ==
std::min(elem->point(5), elem->point(0)))
331 else if (elem->point(5) == min_point)
332 if (elem->point(4) ==
std::min(elem->point(4), elem->point(1)))
345 else if (elem->point(4) == min_point)
347 if (elem->point(0) ==
std::min(elem->point(0), elem->point(5)))
362 else if (i < 8 + 12*e + 3*e*e)
364 unsigned int basisnum = i - 8 - 12*e - 2*e*e;
368 const Point min_point = get_min_point(elem, 1, 2, 6, 5);
370 if (elem->point(1) == min_point)
371 if (elem->point(2) ==
std::min(elem->point(2), elem->point(5)))
384 else if (elem->point(2) == min_point)
385 if (elem->point(6) ==
std::min(elem->point(6), elem->point(1)))
398 else if (elem->point(6) == min_point)
399 if (elem->point(5) ==
std::min(elem->point(5), elem->point(2)))
412 else if (elem->point(5) == min_point)
414 if (elem->point(1) ==
std::min(elem->point(1), elem->point(6)))
429 else if (i < 8 + 12*e + 4*e*e)
431 unsigned int basisnum = i - 8 - 12*e - 3*e*e;
435 const Point min_point = get_min_point(elem, 2, 3, 7, 6);
437 if (elem->point(3) == min_point)
438 if (elem->point(2) ==
std::min(elem->point(2), elem->point(7)))
451 else if (elem->point(7) == min_point)
452 if (elem->point(3) ==
std::min(elem->point(3), elem->point(6)))
465 else if (elem->point(6) == min_point)
466 if (elem->point(7) ==
std::min(elem->point(7), elem->point(2)))
479 else if (elem->point(2) == min_point)
481 if (elem->point(6) ==
std::min(elem->point(3), elem->point(6)))
496 else if (i < 8 + 12*e + 5*e*e)
498 unsigned int basisnum = i - 8 - 12*e - 4*e*e;
502 const Point min_point = get_min_point(elem, 3, 0, 4, 7);
504 if (elem->point(0) == min_point)
505 if (elem->point(3) ==
std::min(elem->point(3), elem->point(4)))
518 else if (elem->point(4) == min_point)
519 if (elem->point(0) ==
std::min(elem->point(0), elem->point(7)))
532 else if (elem->point(7) == min_point)
533 if (elem->point(4) ==
std::min(elem->point(4), elem->point(3)))
546 else if (elem->point(3) == min_point)
548 if (elem->point(7) ==
std::min(elem->point(7), elem->point(0)))
563 else if (i < 8 + 12*e + 6*e*e)
565 unsigned int basisnum = i - 8 - 12*e - 5*e*e;
569 const Point min_point = get_min_point(elem, 4, 5, 6, 7);
571 if (elem->point(4) == min_point)
572 if (elem->point(5) ==
std::min(elem->point(5), elem->point(7)))
585 else if (elem->point(5) == min_point)
586 if (elem->point(6) ==
std::min(elem->point(6), elem->point(4)))
599 else if (elem->point(6) == min_point)
600 if (elem->point(7) ==
std::min(elem->point(7), elem->point(5)))
613 else if (elem->point(7) == min_point)
615 if (elem->point(4) ==
std::min(elem->point(4), elem->point(6)))
633 unsigned int basisnum = i - 8 - 12*e - 6*e*e;
650 libmesh_error_msg(
"Hierarchic polynomials require the element type \nbecause edge and face orientation is needed.");
659 const unsigned int i,
664 libmesh_assert(elem);
673 libmesh_assert_less (totalorder, 2);
674 libmesh_fallthrough();
677 libmesh_assert_less (i, (totalorder+1u)*(totalorder+1u)*(totalorder+1u));
684 unsigned int i0, i1, i2;
686 cube_indices(elem, totalorder, i, xi, eta, zeta, i0, i1, i2);
694 libmesh_error_msg(
"Invalid element type = " << type);
710 libmesh_error_msg(
"Hierarchic polynomials require the element type \nbecause edge and face orientation is needed.");
719 const unsigned int i,
720 const unsigned int j,
724 libmesh_assert(elem);
726 libmesh_assert_less (j, 3);
729 const Real eps = 1.e-6;
737 pp =
Point(p(0)+eps, p(1), p(2));
738 pm =
Point(p(0)-eps, p(1), p(2));
745 pp =
Point(p(0), p(1)+eps, p(2));
746 pm =
Point(p(0), p(1)-eps, p(2));
753 pp =
Point(p(0), p(1), p(2)+eps);
754 pm =
Point(p(0), p(1), p(2)-eps);
759 libmesh_error_msg(
"Invalid derivative index j = " << j);
776 libmesh_error_msg(
"Hierarchic polynomials require the element type \nbecause edge and face orientation is needed.");
785 const unsigned int i,
786 const unsigned int j,
789 libmesh_assert(elem);
791 const Real eps = 1.e-6;
800 pp =
Point(p(0)+eps, p(1), p(2));
801 pm =
Point(p(0)-eps, p(1), p(2));
809 pp =
Point(p(0), p(1)+eps, p(2));
810 pm =
Point(p(0), p(1)-eps, p(2));
818 pp =
Point(p(0), p(1)+eps, p(2));
819 pm =
Point(p(0), p(1)-eps, p(2));
827 pp =
Point(p(0), p(1), p(2)+eps);
828 pm =
Point(p(0), p(1), p(2)-eps);
836 pp =
Point(p(0), p(1), p(2)+eps);
837 pm =
Point(p(0), p(1), p(2)-eps);
845 pp =
Point(p(0), p(1), p(2)+eps);
846 pm =
Point(p(0), p(1), p(2)-eps);
851 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 cube_number_column[]
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 cube_number_row[]
const unsigned char square_number_column[]
const unsigned char cube_number_page[]
Template class which generates the different FE families and orders.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const unsigned char square_number_row[]
virtual ElemType type() const =0
long double min(long double a, double b)
A geometric point in (x,y,z) space.
static OutputShape shape_second_deriv(const ElemType t, const Order o, const unsigned int i, const unsigned int j, const Point &p)