Go to the documentation of this file.
22 #include "libmesh/fe.h"
23 #include "libmesh/elem.h"
37 libmesh_error_msg(
"XYZ polynomials require the element \n because the centroid is needed.");
45 const Order libmesh_dbg_var(order),
47 const Point & point_in,
48 const bool libmesh_dbg_var(add_p_level))
51 libmesh_assert_less_equal (i, order + add_p_level * elem->
p_level());
54 Real max_distance = 0.;
58 max_distance = std::max(
distance, max_distance);
61 const Real x = point_in(0);
62 const Real xc = centroid(0);
63 const Real dx = (x - xc)/max_distance;
85 for (
unsigned int index = 0; index != i; ++index)
100 libmesh_error_msg(
"XYZ polynomials require the element \nbecause the centroid is needed.");
108 const Order libmesh_dbg_var(order),
109 const unsigned int i,
110 const unsigned int libmesh_dbg_var(j),
111 const Point & point_in,
112 const bool libmesh_dbg_var(add_p_level))
115 libmesh_assert_less_equal (i, order + add_p_level * elem->
p_level());
119 libmesh_assert_equal_to (j, 0);
122 Real max_distance = 0.;
126 max_distance = std::max(
distance, max_distance);
129 const Real x = point_in(0);
130 const Real xc = centroid(0);
131 const Real dx = (x - xc)/max_distance;
140 return 1./max_distance;
143 return 2.*dx/max_distance;
146 return 3.*dx*dx/max_distance;
149 return 4.*dx*dx*dx/max_distance;
153 for (
unsigned int index = 1; index != i; ++index)
155 return val/max_distance;
160 #ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES
169 libmesh_error_msg(
"XYZ polynomials require the element \nbecause the centroid is needed.");
177 const Order libmesh_dbg_var(order),
178 const unsigned int i,
179 const unsigned int libmesh_dbg_var(j),
180 const Point & point_in,
181 const bool libmesh_dbg_var(add_p_level))
184 libmesh_assert_less_equal (i, order + add_p_level * elem->
p_level());
188 libmesh_assert_equal_to (j, 0);
191 Real max_distance = 0.;
195 max_distance = std::max(
distance, max_distance);
198 const Real x = point_in(0);
199 const Real xc = centroid(0);
200 const Real dx = (x - xc)/max_distance;
201 const Real dist2 =
pow(max_distance,2.);
217 return 12.*dx*dx/dist2;
221 for (
unsigned int index = 2; index != i; ++index)
222 val *= (index+1) * dx;
static OutputShape shape_second_deriv(const ElemType t, const Order o, const unsigned int i, const unsigned int j, const Point &p)
The libMesh namespace provides an interface to certain functionality in the library.
unsigned int p_level() const
virtual Point centroid() const
MetaPhysicL::DualNumber< T, D > abs(const MetaPhysicL::DualNumber< T, D > &in)
static OutputShape shape(const ElemType t, const Order o, const unsigned int i, const Point &p)
SimpleRange< NodeRefIter > node_ref_range()
Returns a range with all nodes of an element, usable in range-based for loops.
static OutputShape shape_deriv(const ElemType t, const Order o, const unsigned int i, const unsigned int j, const Point &p)
A Point defines a location in LIBMESH_DIM dimensional Real space.
double pow(double a, int b)
Real distance(const Point &p)
This is the base class from which all geometric element types are derived.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
ElemType
Defines an enum for geometric element types.