1#include <libmesh/libmesh.h>
2#include <libmesh/elem.h>
3#include <libmesh/mesh.h>
4#include <libmesh/mesh_generation.h>
44 std::set<subdomain_id_type> ids;
48 CPPUNIT_ASSERT_EQUAL(ids.size(), (std::size_t)1);
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));
CPPUNIT_TEST(testMultiple)
CPPUNIT_TEST(testUnpartitioned)
LIBMESH_CPPUNIT_TEST_SUITE(MeshSubdomainIDTest)
The goal of this test is to verify proper operation of the MeshBase::subdomain_ids() method.
This is the base class from which all geometric element types are derived.
virtual Node *& set_node(const unsigned int i)
static std::unique_ptr< Elem > build(const ElemType type, Elem *p=nullptr)
static constexpr subdomain_id_type invalid_subdomain_id
A static integral constant representing an invalid subdomain id.
virtual const Node * node_ptr(const dof_id_type i) const =0
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,...
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.
virtual Elem * add_elem(Elem *e)=0
Add elem e to the end of the element array.
subdomain_id_type n_subdomains() const
A Point defines a location in LIBMESH_DIM dimensional Real space.
Communicator * TestCommWorld
CPPUNIT_TEST_SUITE_REGISTRATION(MeshSubdomainIDTest)
The libMesh namespace provides an interface to certain functionality in the library.
TestClass subdomain_id_type
Based on the 4-byte comment warning above, this probably doesn't work with exodusII at all....