2 #include "libmesh/libmesh.h" 3 #include "libmesh/edge_edge2.h" 4 #include "libmesh/fe.h" 5 #include "libmesh/quadrature_gauss.h" 6 #include "libmesh/mesh_generation.h" 7 #include "libmesh/mesh.h" 23 CPPUNIT_TEST( testEdge2Lagrange );
24 CPPUNIT_TEST_SUITE_END();
29 std::unique_ptr<FEBase>
_fe;
44 CPPUNIT_ASSERT_EQUAL(dual_coeff.
m(), unsigned(2));
45 CPPUNIT_ASSERT_EQUAL(dual_coeff.
n(), unsigned(2));
50 LIBMESH_ASSERT_FP_EQUAL(2, dual_coeff(0,0), my_tol);
51 LIBMESH_ASSERT_FP_EQUAL(-1, dual_coeff(0,1), my_tol);
52 LIBMESH_ASSERT_FP_EQUAL(-1, dual_coeff(1,0), my_tol);
53 LIBMESH_ASSERT_FP_EQUAL(2, dual_coeff(1,1), my_tol);
55 const auto & dual_phi = _fe->get_dual_phi();
57 CPPUNIT_ASSERT_EQUAL(std::size_t(2), dual_phi.size());
59 const auto & qpoints = _qrule->get_points();
61 CPPUNIT_ASSERT_EQUAL(qpoints.size(), dual_phi[0].size());
64 LIBMESH_ASSERT_FP_EQUAL(1./2. * (1. - 3.*qpoints[qp](0)), dual_phi[0][qp],
67 CPPUNIT_ASSERT_EQUAL(qpoints.size(), dual_phi[1].size());
70 LIBMESH_ASSERT_FP_EQUAL(1./2. * (1. + 3.*qpoints[qp](0)), dual_phi[1][qp],
81 _mesh = std::make_unique<Mesh>(*TestCommWorld);
85 auto rng = _mesh->active_local_element_ptr_range();
86 _elem = rng.begin() == rng.end() ? nullptr : *(rng.begin());
89 _fe->attach_quadrature_rule(_qrule.get());
class FEType hides (possibly multiple) FEFamily and approximation orders, thereby enabling specialize...
static constexpr Real TOLERANCE
This is the base class from which all geometric element types are derived.
Order default_quadrature_order() const
The libMesh namespace provides an interface to certain functionality in the library.
std::unique_ptr< QGauss > _qrule
This class is for unit testing dual coefficient and shape function values.
static std::unique_ptr< FEGenericBase > build(const unsigned int dim, const FEType &type)
Builds a specific finite element type.
std::unique_ptr< Mesh > _mesh
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
std::unique_ptr< FEBase > _fe
CPPUNIT_TEST_SUITE_REGISTRATION(DualShapeTest)
auto index_range(const T &sizable)
Helper function that returns an IntRange<std::size_t> representing all the indices of the passed-in v...