22#include "libmesh/fe.h"
23#include "libmesh/elem.h"
35 const Order libmesh_dbg_var(order),
37 const Point & point_in,
38 const bool libmesh_dbg_var(add_p_level))
41 libmesh_assert_less_equal (i, order + add_p_level * elem->p_level());
43 Point avg = elem->vertex_average();
44 Real max_distance = 0.;
45 for (
const Point & p : elem->node_ref_range())
48 max_distance = std::max(
distance, max_distance);
51 const Real x = point_in(0);
52 const Real xc = avg(0);
53 const Real dx = (x - xc)/max_distance;
75 for (
unsigned int index = 0; index != i; ++index)
89 libmesh_error_msg(
"XYZ polynomials require the element.");
101 const bool add_p_level)
109 const Order libmesh_dbg_var(order),
110 const unsigned int i,
111 const unsigned int libmesh_dbg_var(j),
112 const Point & point_in,
113 const bool libmesh_dbg_var(add_p_level))
116 libmesh_assert_less_equal (i, order + add_p_level * elem->
p_level());
120 libmesh_assert_equal_to (j, 0);
123 Real max_distance = 0.;
127 max_distance = std::max(
distance, max_distance);
130 const Real x = point_in(0);
131 const Real xc = avg(0);
132 const Real dx = (x - xc)/max_distance;
141 return 1./max_distance;
144 return 2.*dx/max_distance;
147 return 3.*dx*dx/max_distance;
150 return 4.*dx*dx*dx/max_distance;
154 for (
unsigned int index = 1; index != i; ++index)
156 return val/max_distance;
169 libmesh_error_msg(
"XYZ polynomials require the element.");
177 const unsigned int i,
178 const unsigned int j,
180 const bool add_p_level)
189#ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES
195 const Order libmesh_dbg_var(order),
196 const unsigned int i,
197 const unsigned int libmesh_dbg_var(j),
198 const Point & point_in,
199 const bool libmesh_dbg_var(add_p_level))
202 libmesh_assert_less_equal (i, order + add_p_level * elem->
p_level());
206 libmesh_assert_equal_to (j, 0);
209 Real max_distance = 0.;
213 max_distance = std::max(
distance, max_distance);
216 const Real x = point_in(0);
217 const Real xc = avg(0);
218 const Real dx = (x - xc)/max_distance;
219 const Real dist2 = pow(max_distance,2.);
235 return 12.*dx*dx/dist2;
239 for (
unsigned int index = 2; index != i; ++index)
240 val *= (index+1) * dx;
253 libmesh_error_msg(
"XYZ polynomials require the element.");
262 const unsigned int i,
263 const unsigned int j,
265 const bool add_p_level)
This is the base class from which all geometric element types are derived.
SimpleRange< NodeRefIter > node_ref_range()
Returns a range with all nodes of an element, usable in range-based for loops.
unsigned int p_level() const
Point vertex_average() const
class FEType hides (possibly multiple) FEFamily and approximation orders, thereby enabling specialize...
OrderWrapper order
The approximation order of the element (at 0 p-refinement level).
static OutputShape shape(const ElemType t, const Order o, const unsigned int i, const Point &p)
static OutputShape shape_second_deriv(const ElemType t, const Order o, const unsigned int i, const unsigned int j, const Point &p)
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.
The libMesh namespace provides an interface to certain functionality in the library.
LIBMESH_DEFAULT_VECTORIZED_FE(template<>Real FE< 0, BERNSTEIN)
ElemType
Defines an enum for geometric element types.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
Real distance(const Point &p)