1 #include <libmesh/libmesh.h> 2 #include <libmesh/elem.h> 3 #include <libmesh/mesh.h> 4 #include <libmesh/mesh_generation.h> 21 CPPUNIT_TEST( testUnpartitioned );
22 CPPUNIT_TEST( testMultiple );
24 CPPUNIT_TEST_SUITE_END();
35 std::unique_ptr<UnstructuredMesh>
mesh = std::make_unique<Mesh>(*TestCommWorld);
44 std::set<subdomain_id_type> ids;
48 CPPUNIT_ASSERT_EQUAL(ids.size(), (std::size_t)1);
56 std::unique_ptr<UnstructuredMesh>
mesh = std::make_unique<Mesh>(*TestCommWorld);
60 std::set<subdomain_id_type> actual_ids;
61 for (
auto & elem :
mesh->active_element_ptr_range())
68 std::set<subdomain_id_type> ids;
71 CPPUNIT_ASSERT_EQUAL(ids.size(), actual_ids.size());
73 CPPUNIT_ASSERT(actual_ids.count(
id));
virtual Node *& set_node(const unsigned int i)
CPPUNIT_TEST_SUITE_REGISTRATION(MeshSubdomainIDTest)
TestClass subdomain_id_type
Based on the 4-byte comment warning above, this probably doesn't work with exodusII at all...
This is the base class from which all geometric element types are derived.
The libMesh namespace provides an interface to certain functionality in the library.
virtual Node * add_point(const Point &p, const dof_id_type id=DofObject::invalid_id, const processor_id_type proc_id=DofObject::invalid_processor_id)=0
Add a new Node at Point p to the end of the vertex array, with processor_id procid.
static const subdomain_id_type invalid_subdomain_id
A static integral constant representing an invalid subdomain id.
virtual Elem * add_elem(Elem *e)=0
Add elem e to the end of the element array.
static std::unique_ptr< Elem > build(const ElemType type, Elem *p=nullptr)
void subdomain_ids(std::set< subdomain_id_type > &ids, const bool global=true) const
Constructs a list of all subdomain identifiers in the local mesh if global == false, and in the global mesh if global == true (default).
subdomain_id_type n_subdomains() const
virtual const Node * node_ptr(const dof_id_type i) const =0
A Point defines a location in LIBMESH_DIM dimensional Real space.