Go to the documentation of this file.
3 #include <libmesh/elem.h>
4 #include <libmesh/enum_elem_type.h>
5 #include <libmesh/mesh.h>
6 #include <libmesh/mesh_generation.h>
12 template <ElemType elem_type>
21 const Real minpos = 1.5, maxpos = 5.5;
22 const unsigned int N = 2;
25 const std::unique_ptr<Elem> test_elem =
Elem::build(elem_type);
26 const unsigned int dim = test_elem->dim();
27 const unsigned int use_y =
dim > 1;
28 const unsigned int use_z =
dim > 2;
47 const BoundingBox bbox = elem->loose_bounding_box();
49 const Point centroid = elem->centroid();
55 BoundingBox wide_bbox(elem->point(0), elem->point(0));
57 for (
unsigned int n = 0; n != elem->n_nodes(); ++n)
59 const Point & p = elem->point(n);
67 for (
unsigned int d=0; d != LIBMESH_DIM; ++d)
70 (wide_bbox.max()(d) - wide_bbox.min()(d)) / 3;
71 wide_bbox.min()(d) -= widening;
72 wide_bbox.max()(d) += widening;
82 CPPUNIT_TEST( test_bounding_box )
84 #define INSTANTIATE_ELEMTEST(elemtype) \
85 class ElemTest_##elemtype : public ElemTest<elemtype> { \
87 CPPUNIT_TEST_SUITE( ElemTest_##elemtype ); \
89 CPPUNIT_TEST_SUITE_END(); \
92 CPPUNIT_TEST_SUITE_REGISTRATION( ElemTest_##elemtype )
The Mesh class is a thin wrapper, around the ReplicatedMesh class by default.
virtual SimpleRange< element_iterator > active_local_element_ptr_range() override
INSTANTIATE_ELEMTEST(EDGE2)
Defines a Cartesian bounding box by the two corner extremum.
The libMesh namespace provides an interface to certain functionality in the library.
libMesh::Parallel::Communicator * TestCommWorld
A Point defines a location in LIBMESH_DIM dimensional Real space.
bool contains_point(const Point &) const
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static std::unique_ptr< Elem > build(const ElemType type, Elem *p=nullptr)