77 {
78 LOG_UNIT_TEST;
79
82
83 switch (elem_type)
84 {
89 (
mesh, 1, 1, 0., 1., 0., 1., elem_type);
90 break;
95 (
mesh, 1, 1, 1, 0., 1., 0., 1., 0., 1., elem_type);
96 break;
97 default:
98 libmesh_error_msg("Unsupported element type " << elem_type);
99 }
100
101 auto elem_range =
mesh.active_local_element_ptr_range();
102 if (elem_range.begin() == elem_range.end())
103 return;
104 const Elem * elem = *(elem_range.begin());
105
106 if (distort)
107 {
108
109
110
111
112
113
114
115
116
117
118
119
123 node(d) +=
Real(0.3) * (target(d) - node(d));
124 }
125
128
129 const std::vector<std::vector<RealTensor>> & dphi = fe->get_dphi();
130 const std::vector<std::vector<RealGradient>> & phi = fe->get_phi();
131 const std::vector<Point> & xyz = fe->get_xyz();
132
133 QGauss qrule(
dim, fe_type.default_quadrature_order());
134 fe->attach_quadrature_rule(&qrule);
135
136 fe->reinit(elem);
137
138
139
140 const std::vector<std::vector<RealTensor>> dphi_base = dphi;
141 const std::vector<Point> qpoints = xyz;
142
144 const Real tol = 5e-4;
145
147 {
148 const Point x0 = qpoints[qp];
149
151 {
153 x_plus(l) += h;
155 x_minus(l) -= h;
156
157 std::vector<Point> pts_plus
159 fe->reinit(elem, &pts_plus);
160 const std::vector<std::vector<RealGradient>> phi_plus = phi;
161
162 std::vector<Point> pts_minus
164 fe->reinit(elem, &pts_minus);
165 const std::vector<std::vector<RealGradient>> phi_minus = phi;
166
169 {
171 (phi_plus[i][0](k) - phi_minus[i][0](k)) / (2*h);
172
173 LIBMESH_ASSERT_FP_EQUAL(fd, dphi_base[i][qp](k, l), tol);
174 }
175 }
176 }
177 }
This is the base class from which all geometric element types are derived.
dof_id_type node_id(const unsigned int i) const
Point vertex_average() const
static std::unique_ptr< FEGenericBase > build(const unsigned int dim, const FEType &type)
Builds a specific finite element type.
static Point inverse_map(const unsigned int dim, const Elem *elem, const Point &p, const Real tolerance=TOLERANCE, const bool secure=true, const bool extra_checks=true)
class FEType hides (possibly multiple) FEFamily and approximation orders, thereby enabling specialize...
virtual const Node & node_ref(const dof_id_type i) const
The Mesh class is a thin wrapper, around the ReplicatedMesh class by default.
A Node is like a Point, but with more information.
A Point defines a location in LIBMESH_DIM dimensional Real space.
This class implements specific orders of Gauss quadrature.
auto index_range(const T &sizable)
Helper function that returns an IntRange<std::size_t> representing all the indices of the passed-in v...
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
IntRange< T > make_range(T beg, T end)
The 2-parameter make_range() helper function returns an IntRange<T> when both input parameters are of...