31 void hermite_compute_coefs(
const Elem * elem,
Real & d1xd1x,
Real & d2xd2x)
35 const int n_mapping_shape_functions =
40 std::vector<Point> dofpt;
41 dofpt.push_back(
Point(-1));
42 dofpt.push_back(
Point(1));
45 std::vector<Real> dxdxi(2);
46 std::vector<Real> dxidx(2);
48 for (
int p = 0; p != 2; ++p)
51 for (
int i = 0; i != n_mapping_shape_functions; ++i)
54 (mapping_elem_type, mapping_order, i, 0, dofpt[p]);
55 dxdxi[p] += elem->
point(i)(0) * ddxi;
85 return 0.5 * (-1. + 3.*xi);
87 return 0.5 * (1. + 3.*xi);
89 return (8.*xi*xi + 4.*(xi*xi-1.))/24.;
91 return (8.*xi*xi*xi + 12.*xi*(xi*xi-1.))/120.;
96 Real denominator = 720., xipower = 1.;
97 for (
unsigned n=6; n != i; ++n)
100 denominator *= (n+1);
102 return (8.*pow<4>(xi)*xipower +
103 (8.*(i-4)+4.)*xi*xi*xipower*(xi*xi-1.) +
104 (i-4)*(i-5)*xipower*(xi*xi-1.)*(xi*xi-1.))/denominator;
116 return 0.75 * (-1. + xi*xi);
118 return 0.75 * (1. - xi*xi);
120 return 0.25 * (-1. - 2.*xi + 3.*xi*xi);
122 return 0.25 * (-1. + 2.*xi + 3.*xi*xi);
124 return 4.*xi * (xi*xi-1.)/24.;
126 return (4*xi*xi*(xi*xi-1.) + (xi*xi-1.)*(xi*xi-1.))/120.;
130 Real denominator = 720., xipower = 1.;
131 for (
unsigned n=6; n != i; ++n)
134 denominator *= (n+1);
136 return (4*xi*xi*xi*xipower*(xi*xi-1.) +
137 (i-4)*xi*xipower*(xi*xi-1.)*(xi*xi-1.))/denominator;
147 return 0.25 * (2. - 3.*xi + xi*xi*xi);
149 return 0.25 * (2. + 3.*xi - xi*xi*xi);
151 return 0.25 * (1. - xi - xi*xi + xi*xi*xi);
153 return 0.25 * (-1. - xi + xi*xi + xi*xi*xi);
156 return (xi*xi-1.) * (xi*xi-1.)/24.;
158 return xi * (xi*xi-1.) * (xi*xi-1.)/120.;
162 Real denominator = 720., xipower = 1.;
163 for (
unsigned n=6; n != i; ++n)
166 denominator *= (n+1);
168 return (xi*xi*xipower*(xi*xi-1.)*(xi*xi-1.))/denominator;
180 libmesh_error_msg(
"Hermite elements require the real element \nto construct gradient-based degrees of freedom.");
188 const Order libmesh_dbg_var(order),
189 const unsigned int i,
192 libmesh_assert(elem);
199 hermite_compute_coefs(elem, d1xd1x, d2xd2x);
204 const unsigned int totalorder = order + elem->
p_level();
213 libmesh_assert_less (i, totalorder+1);
230 libmesh_error_msg(
"ERROR: Unsupported element type = " << type);
243 libmesh_error_msg(
"Hermite elements require the real element \nto construct gradient-based degrees of freedom.");
251 const Order libmesh_dbg_var(order),
252 const unsigned int i,
256 libmesh_assert(elem);
263 hermite_compute_coefs(elem, d1xd1x, d2xd2x);
268 const unsigned int totalorder = order + elem->
p_level();
277 libmesh_assert_less (i, totalorder+1);
294 libmesh_error_msg(
"ERROR: Unsupported element type = " << type);
302 const Order libmesh_dbg_var(order),
303 const unsigned int i,
307 libmesh_assert(elem);
314 hermite_compute_coefs(elem, d1xd1x, d2xd2x);
319 const unsigned int totalorder = order + elem->
p_level();
328 libmesh_assert_less (i, totalorder+1);
345 libmesh_error_msg(
"ERROR: Unsupported element type = " << type);
static OutputShape shape(const ElemType t, const Order o, const unsigned int i, const Point &p)
The base class for all geometric element types.
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
static Real hermite_raw_shape_second_deriv(const unsigned int basis_num, const Real xi)
static Real hermite_raw_shape(const unsigned int basis_num, const Real xi)
virtual unsigned int n_shape_functions() const override
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static Real hermite_raw_shape_deriv(const unsigned int basis_num, const Real xi)
virtual Order default_order() const =0
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)