1 #include <libmesh/boundary_info.h> 2 #include <libmesh/elem.h> 3 #include <libmesh/mesh.h> 4 #include <libmesh/mesh_generation.h> 5 #include <libmesh/mesh_tools.h> 6 #include <libmesh/parallel_implementation.h> 7 #include <libmesh/simplex_refiner.h> 27 CPPUNIT_TEST( testTriRefinement );
28 CPPUNIT_TEST( test3DTriRefinement );
30 CPPUNIT_TEST_SUITE_END();
39 Real expected_total_measure)
46 Real total_measure = 0;
47 for (
const Elem * elem :
mesh.local_element_ptr_range())
49 Real measure = elem->volume();
50 CPPUNIT_ASSERT_LESSEQUAL(desired_measure, measure);
51 total_measure += measure;
55 LIBMESH_ASSERT_FP_EQUAL(total_measure, expected_total_measure,
67 0.0, 2.0, 0.0, 2.0,
TRI3);
69 testRefinement(trimesh, 0.05, 4);
86 (trimesh, -1, 1, -1, 1, -1, 1);
88 testRefinement(trimesh, 0.05, 4*std::sqrt(
Real(3)));
libMesh::Parallel::Communicator * TestCommWorld
static constexpr Real TOLERANCE
This is the base class from which all geometric element types are derived.
Real & desired_volume()
Sets and/or gets the desired element volume.
The libMesh namespace provides an interface to certain functionality in the library.
processor_id_type size() const
A C++ class to refine a simplicial mesh via splitting edges that exceed a given metric.
void testRefinement(UnstructuredMesh &mesh, Real desired_measure, Real expected_total_measure)
The UnstructuredMesh class is derived from the MeshBase class.
bool refine_elements()
Finds elements which exceed the requested metric and refines them via subdivision into new simplices ...
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void test3DTriRefinement()
CPPUNIT_TEST_SUITE_REGISTRATION(SimplexRefinementTest)
The Mesh class is a thin wrapper, around the ReplicatedMesh class by default.