1 #include <libmesh/libmesh.h> 3 #include <libmesh/elem.h> 4 #include <libmesh/mesh.h> 5 #include <libmesh/mesh_generation.h> 24 CPPUNIT_TEST( testFindNeighbors );
25 CPPUNIT_TEST( testStitch );
27 CPPUNIT_TEST_SUITE_END();
37 for (
const auto & elem :
mesh.local_element_ptr_range())
38 for (
const auto & neigh : elem->neighbor_ptr_range())
60 auto range_start =
mesh.elements_begin();
61 const auto range_end =
mesh.elements_end();
62 while (range_start != range_end && (*range_start)->id() < 5)
65 const int old_n_neighbors = n_neighbor_links(
mesh);
69 const int new_n_neighbors = n_neighbor_links(
mesh);
70 CPPUNIT_ASSERT_EQUAL(old_n_neighbors, new_n_neighbors);
73 const int newer_n_neighbors = n_neighbor_links(
mesh);
74 CPPUNIT_ASSERT_EQUAL(old_n_neighbors, newer_n_neighbors);
90 CPPUNIT_ASSERT_EQUAL(mesh0.n_nodes(),
dof_id_type(16));
100 mesh0.stitch_meshes(mesh1, 3, 1,
TOLERANCE,
true,
104 CPPUNIT_ASSERT_EQUAL(mesh0.n_nodes(),
dof_id_type(61));
106 const int stitched_n_neighbors = n_neighbor_links(mesh0);
107 CPPUNIT_ASSERT_EQUAL(stitched_n_neighbors, 54);
109 mesh0.all_second_order_range(mesh0.element_ptr_range(),
111 const int new_n_neighbors = n_neighbor_links(mesh0);
112 CPPUNIT_ASSERT_EQUAL(new_n_neighbors, 54);
virtual void all_second_order_range(const SimpleRange< element_iterator > &range, const bool full_ordered=true)=0
Converts a set of this Mesh's elements defined by range from FIRST order to SECOND order...
libMesh::Parallel::Communicator * TestCommWorld
static constexpr Real TOLERANCE
virtual dof_id_type n_nodes() const override final
const Parallel::Communicator & comm() const
The libMesh namespace provides an interface to certain functionality in the library.
This is the MeshBase class.
virtual void find_neighbors(const bool reset_remote_elements=false, const bool reset_current_list=true)=0
Locate element face (edge in 2D) neighbors.
static int n_neighbor_links(const MeshBase &mesh)
The Mesh class is a thin wrapper, around the ReplicatedMesh class by default.
CPPUNIT_TEST_SUITE_REGISTRATION(MixedOrderTest)