2#include "libmesh/elem.h"
4#include "libmesh/fe_map.h"
5#include "libmesh/mesh.h"
6#include "libmesh/mesh_generation.h"
7#include "libmesh/node.h"
8#include "libmesh/quadrature_gauss.h"
9#include "libmesh/tensor_value.h"
33#if LIBMESH_ENABLE_SECOND_DERIVATIVES
41#if LIBMESH_ENABLE_SECOND_DERIVATIVES
89 (
mesh, 1, 1, 0., 1., 0., 1., elem_type);
95 (
mesh, 1, 1, 1, 0., 1., 0., 1., 0., 1., elem_type);
98 libmesh_error_msg(
"Unsupported element type " << elem_type);
101 auto elem_range =
mesh.active_local_element_ptr_range();
102 if (elem_range.begin() == elem_range.end())
104 const Elem * elem = *(elem_range.begin());
123 node(d) +=
Real(0.3) * (target(d) - node(d));
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();
134 fe->attach_quadrature_rule(&qrule);
140 const std::vector<std::vector<RealTensor>> dphi_base = dphi;
141 const std::vector<Point> qpoints = xyz;
144 const Real tol = 5e-4;
148 const Point x0 = qpoints[qp];
157 std::vector<Point> pts_plus
159 fe->reinit(elem, &pts_plus);
160 const std::vector<std::vector<RealGradient>> phi_plus = phi;
162 std::vector<Point> pts_minus
164 fe->reinit(elem, &pts_minus);
165 const std::vector<std::vector<RealGradient>> phi_minus = phi;
171 (phi_plus[i][0](k) - phi_minus[i][0](k)) / (2*h);
173 LIBMESH_ASSERT_FP_EQUAL(fd, dphi_base[i][qp](k, l), tol);
Verifies HDivFETransformation::map_dphi (the physical-space gradients of H(div)-conforming Raviart-Th...
CPPUNIT_TEST(testHex27Affine)
CPPUNIT_TEST(testTri6NonAffine)
LIBMESH_CPPUNIT_TEST_SUITE(HDivGradTest)
void testTet14NonAffine()
CPPUNIT_TEST(testTet14NonAffine)
void testGradByFiniteDifference(const ElemType elem_type, const bool distort)
CPPUNIT_TEST(testTet14Affine)
CPPUNIT_TEST(testHex27NonAffine)
void testQuad8NonAffine()
CPPUNIT_TEST(testQuad8Affine)
void testHex27NonAffine()
CPPUNIT_TEST(testQuad8NonAffine)
CPPUNIT_TEST(testTri6Affine)
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...
Order default_quadrature_order() const
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.
Communicator * TestCommWorld
CPPUNIT_TEST_SUITE_REGISTRATION(HDivGradTest)
The libMesh namespace provides an interface to certain functionality in the library.
auto index_range(const T &sizable)
Helper function that returns an IntRange<std::size_t> representing all the indices of the passed-in v...
ElemType
Defines an enum for geometric element types.
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...