1#include <libmesh/mesh.h>
2#include <libmesh/distributed_mesh.h>
3#include <libmesh/mesh_generation.h>
4#include <libmesh/boundary_info.h>
5#include <libmesh/elem.h>
6#include <libmesh/remote_elem.h>
7#include <libmesh/face_quad4_shell.h>
8#include <libmesh/equation_systems.h>
9#include <libmesh/zero_function.h>
10#include <libmesh/dirichlet_boundaries.h>
11#include <libmesh/dof_map.h>
12#include <libmesh/parallel.h>
13#include <libmesh/mesh_refinement.h>
39# ifdef LIBMESH_ENABLE_AMR
40# ifdef LIBMESH_ENABLE_EXCEPTIONS
51# ifdef LIBMESH_ENABLE_DIRICHLET
91 CPPUNIT_ASSERT_EQUAL(
static_cast<std::size_t
>(4), bi.
n_boundary_ids());
98 bool has_bcid = bc_ids.count(i);
100 CPPUNIT_ASSERT(has_bcid);
108 CPPUNIT_ASSERT_EQUAL(
static_cast<std::size_t
>(8), bc_triples.size());
112 std::unique_ptr<MeshBase> mesh_clone =
mesh.
clone();
113 CPPUNIT_ASSERT(mesh_clone->get_boundary_info() ==
119 CPPUNIT_ASSERT(mesh_clone->get_boundary_info() !=
124 CPPUNIT_ASSERT_EQUAL(
static_cast<std::size_t
>(3), bi.
n_boundary_ids());
128 CPPUNIT_ASSERT(!bc_ids.count(0));
131 bool has_bcid = bc_ids.count(i);
133 CPPUNIT_ASSERT(has_bcid);
143 CPPUNIT_ASSERT_EQUAL(
static_cast<std::size_t
>(6), bc_triples.size());
146 CPPUNIT_ASSERT(std::find_if(bc_triples.begin(), bc_triples.end(),
147 [](
const auto & t) { return std::get<2>(t) == 0; }) == bc_triples.end());
152 CPPUNIT_ASSERT_EQUAL(
static_cast<std::size_t
>(3), bi.
n_boundary_ids());
162 CPPUNIT_ASSERT_EQUAL(
static_cast<std::size_t
>(0), bi.
n_boundary_ids());
163 CPPUNIT_ASSERT_EQUAL(
static_cast<std::size_t
>(0), bc_triples.size());
188 const std::map<boundary_id_type, std::string> expected_names =
189 {{4,
"bottom"}, {5,
"right"}, {6,
"left"}};
193 CPPUNIT_ASSERT_EQUAL(
static_cast<std::size_t
>(3), bi.
n_boundary_ids());
201 bool has_bcid = bc_ids.count(i);
203 CPPUNIT_ASSERT(!has_bcid);
207 bool has_bcid = bc_ids.count(i);
209 bool bad_name =
false;
214 bad_name = (current_name != libmesh_map_find(expected_names, i));
219 CPPUNIT_ASSERT(has_bcid);
223 CPPUNIT_ASSERT(!bad_name);
233 CPPUNIT_ASSERT_EQUAL(
static_cast<std::size_t
>(8), bc_triples.size());
242 CPPUNIT_ASSERT_EQUAL(
static_cast<std::size_t
>(0), bi.
n_boundary_ids());
243 CPPUNIT_ASSERT_EQUAL(
static_cast<std::size_t
>(0), bc_triples.size());
289 const std::map<boundary_id_type, std::string> expected_basic_names =
290 {{1,
"bottom"}, {2,
"right"}, {3,
"top"}, {4,
"left"}};
292 std::map<boundary_id_type, std::string> expected_side_names =
293 expected_basic_names;
294 expected_side_names.insert({{6,
"back"}, {7,
"front"}});
296 std::map<boundary_id_type, std::string> expected_node_names =
297 expected_basic_names;
298 expected_node_names.insert({{6,
"front"}, {7,
"back"}});
300 const std::map<boundary_id_type, std::string> expected_edge_names =
301 {{3,
"firstedge"}, {4,
"secondedge"}};
305 CPPUNIT_ASSERT_EQUAL(
static_cast<std::size_t
>(6), bi.
n_boundary_ids());
317 bool has_bcid = bc_ids.count(noid) ||
318 side_bc_ids.count(noid) ||
319 edge_bc_ids.count(noid) ||
320 node_bc_ids.count(noid);
322 CPPUNIT_ASSERT(!has_bcid);
327 bool has_bcid = bc_ids.count(
id),
328 has_side_id = side_bc_ids.count(
id),
329 has_edge_id = edge_bc_ids.count(
id),
330 has_node_id = node_bc_ids.count(
id);
332 bool bad_name =
false;
336 bad_name = bad_name || (side_name != libmesh_map_find(expected_side_names,
id));
342 bad_name = bad_name || (edge_name != libmesh_map_find(expected_edge_names,
id));
348 bad_name = bad_name || (node_name != libmesh_map_find(expected_node_names,
id));
353 CPPUNIT_ASSERT(has_bcid);
356 CPPUNIT_ASSERT(has_side_id);
359 if (
id == 3 ||
id == 4)
360 CPPUNIT_ASSERT(has_edge_id);
362 CPPUNIT_ASSERT(!has_edge_id);
365 CPPUNIT_ASSERT(has_node_id);
369 CPPUNIT_ASSERT(!bad_name);
379 const unsigned int n_elem = 5;
380 const std::string mesh_filename =
"cube_mesh.xda";
385 n_elem, n_elem, n_elem,
394 CPPUNIT_ASSERT_EQUAL(
static_cast<std::size_t
>(0), bi.
n_edge_conds());
403 for (
const auto & elem :
mesh.element_ptr_range())
405 unsigned short side_max_x = 0, side_min_y = 0;
406 bool found_side_max_x =
false, found_side_min_y =
false;
408 for (
unsigned short side=0; side<elem->n_sides(); side++)
413 found_side_max_x =
true;
419 found_side_min_y =
true;
426 if (found_side_max_x && found_side_min_y)
427 for (
unsigned short e=0; e<elem->n_edges(); e++)
428 if (elem->is_edge_on_side(e, side_max_x) &&
429 elem->is_edge_on_side(e, side_min_y))
430 bi.
add_edge(elem, e, EDGE_BOUNDARY_ID);
435 CPPUNIT_ASSERT_EQUAL(
static_cast<std::size_t
>(n_elem), bi.
n_edge_conds());
439 std::unique_ptr<MeshBase> mesh_clone =
mesh.
clone();
440 CPPUNIT_ASSERT(mesh_clone->get_boundary_info() ==
455 CPPUNIT_ASSERT_EQUAL(
static_cast<std::size_t
>(n_elem), bi.
n_edge_conds());
479 CPPUNIT_ASSERT_EQUAL(bi2.get_sideset_name(0), std::string(
"zero"));
480 CPPUNIT_ASSERT_EQUAL(bi2.get_sideset_name(1), std::string(
"one"));
481 CPPUNIT_ASSERT_EQUAL(bi2.get_sideset_name(2), std::string(
"two"));
482 CPPUNIT_ASSERT_EQUAL(bi2.get_sideset_name(3), std::string(
"three"));
483 CPPUNIT_ASSERT_EQUAL(bi2.get_nodeset_name(0), std::string(
"ZERO"));
484 CPPUNIT_ASSERT_EQUAL(bi2.get_nodeset_name(1), std::string(
"ONE"));
496#ifdef LIBMESH_ENABLE_DIRICHLET
548 std::unique_ptr<MeshBase> mesh_clone =
mesh.
clone();
549 CPPUNIT_ASSERT(mesh_clone->get_boundary_info() ==
560 std::vector<unsigned int> variables;
561 variables.push_back(0);
562 std::set<boundary_id_type> shellface_ids;
563 shellface_ids.insert(20);
573 elem_bottom =
nullptr;
583 CPPUNIT_ASSERT_EQUAL(
static_cast<std::size_t
>(4),
static_cast<std::size_t
>(system.
n_constrained_dofs()));
590 std::vector<dof_id_type> dof_indices;
592 CPPUNIT_ASSERT_EQUAL(
static_cast<std::size_t
>(4), dof_indices.size());
594 for(
unsigned int i=0; i<dof_indices.size(); i++)
603#if LIBMESH_ENABLE_AMR
604# if LIBMESH_ENABLE_EXCEPTIONS
625 for (
auto & elem :
mesh->active_element_ptr_range())
634 bool threw_desired_exception =
false;
636 for (
auto & elem :
mesh->active_element_ptr_range())
638 const Point c = elem->vertex_average();
639 if (c(0) < 0.5 && c(1) > 0.5)
644 std::regex msg_regex(
"Trying to add boundary ID 3 which already exists on the ancestors");
645 CPPUNIT_ASSERT(std::regex_search(e.what(), msg_regex));
646 threw_desired_exception =
true;
652 CPPUNIT_ASSERT(threw_desired_exception);
654 threw_desired_exception =
false;
656 for (
auto & elem :
mesh->active_element_ptr_range())
658 const Point c = elem->vertex_average();
659 if (c(0) < 0.5 && c(1) > 0.5)
664 std::regex msg_regex(
"Trying to add boundary ID 3 which already exists on the ancestors");
665 CPPUNIT_ASSERT(std::regex_search(e.what(), msg_regex));
666 threw_desired_exception =
true;
673 CPPUNIT_ASSERT(threw_desired_exception);
677 threw_desired_exception =
false;
678 bi.allow_children_on_boundary_side(
true);
680 for (
auto & elem :
mesh->active_element_ptr_range())
682 const Point c = elem->vertex_average();
683 if (c(0) < 0.5 && c(1) > 0.5)
684 bi.remove_side(elem, 3, 3);
688 std::regex msg_regex(
"We cannot delete boundary ID 3 using a child because it is inherited from an ancestor");
689 CPPUNIT_ASSERT(std::regex_search(e.what(), msg_regex));
690 threw_desired_exception =
true;
697 CPPUNIT_ASSERT(threw_desired_exception);
730 std::vector<boundary_id_type> container;
733 CPPUNIT_ASSERT_EQUAL(
static_cast<std::size_t
>(2), container.size());
737 std::vector<std::vector<boundary_id_type>> all_bids_container;
739 CPPUNIT_ASSERT_EQUAL(
static_cast<std::size_t
>(elem->n_sides()), all_bids_container.size());
740 CPPUNIT_ASSERT_EQUAL(
static_cast<std::size_t
>(2), all_bids_container[3].size());
741 CPPUNIT_ASSERT_EQUAL(
static_cast<boundary_id_type>(3), all_bids_container[3][0]);
742 CPPUNIT_ASSERT_EQUAL(
static_cast<boundary_id_type>(5), all_bids_container[3][1]);
744 CPPUNIT_ASSERT_EQUAL(
static_cast<std::size_t
>(1), all_bids_container[0].size());
745 CPPUNIT_ASSERT_EQUAL(
static_cast<boundary_id_type>(0), all_bids_container[0][0]);
746 CPPUNIT_ASSERT_EQUAL(
static_cast<std::size_t
>(1), all_bids_container[1].size());
747 CPPUNIT_ASSERT_EQUAL(
static_cast<boundary_id_type>(1), all_bids_container[1][0]);
748 CPPUNIT_ASSERT_EQUAL(
static_cast<std::size_t
>(1), all_bids_container[1].size());
749 CPPUNIT_ASSERT_EQUAL(
static_cast<boundary_id_type>(2), all_bids_container[2][0]);
772 for (
auto & elem :
mesh->active_element_ptr_range())
774 const Point c = elem->vertex_average();
777 elem->subdomain_id() = 1;
781 elem->subdomain_id() = 2;
790 for (
auto & elem :
mesh->active_element_ptr_range())
792 const Point c = elem->vertex_average();
793 if (c(0) < 1 && c(0) > 0.5)
799 unsigned int count = 0;
800 for (
auto & elem :
mesh->active_element_ptr_range())
806 CPPUNIT_ASSERT_EQUAL(
static_cast<unsigned int>(2), count);
813 for (
auto & elem :
mesh->active_element_ptr_range())
815 const Point c = elem->vertex_average();
826 for (
auto & elem :
mesh->active_element_ptr_range())
828 const Point c = elem->vertex_average();
845 for (
auto & elem :
mesh->active_element_ptr_range())
847 const Point c = elem->vertex_average();
850 if (c(0) > 0.5 && c(0) < 1 && c(1) < 0.5)
860 for (
auto & elem :
mesh->active_element_ptr_range())
862 const Point c = elem->vertex_average();
891 for (
auto & elem :
mesh->active_element_ptr_range())
899 for (
auto & elem :
mesh->active_element_ptr_range())
901 const Point c = elem->vertex_average();
902 if (c(0) < 0.5 && c(1) > 0.5)
909 for (
auto & elem :
mesh->active_element_ptr_range())
911 const Point c = elem->vertex_average();
912 if (c(0) < 0.5 && c(1) > 0.5)
914 std::vector<boundary_id_type> container;
917 CPPUNIT_ASSERT_EQUAL(
static_cast<std::size_t
>(2), container.size());
921 std::vector<std::vector<boundary_id_type>> all_bids_container;
923 CPPUNIT_ASSERT_EQUAL(
static_cast<std::size_t
>(elem->n_sides()), all_bids_container.size());
924 CPPUNIT_ASSERT_EQUAL(
static_cast<std::size_t
>(2), all_bids_container[3].size());
925 CPPUNIT_ASSERT_EQUAL(
static_cast<boundary_id_type>(5), all_bids_container[3][0]);
926 CPPUNIT_ASSERT_EQUAL(
static_cast<boundary_id_type>(3), all_bids_container[3][1]);
927 CPPUNIT_ASSERT_EQUAL(
static_cast<std::size_t
>(1), all_bids_container[2].size());
928 CPPUNIT_ASSERT_EQUAL(
static_cast<boundary_id_type>(2), all_bids_container[2][0]);
930 CPPUNIT_ASSERT_EQUAL(
static_cast<std::size_t
>(0), all_bids_container[0].size());
931 CPPUNIT_ASSERT_EQUAL(
static_cast<std::size_t
>(0), all_bids_container[1].size());
939 CPPUNIT_ASSERT_EQUAL(
static_cast<std::size_t
>(elem->n_sides()), all_bids_container.size());
940 CPPUNIT_ASSERT_EQUAL(
static_cast<std::size_t
>(1), all_bids_container[3].size());
941 CPPUNIT_ASSERT_EQUAL(
static_cast<boundary_id_type>(3), all_bids_container[3][0]);
942 CPPUNIT_ASSERT_EQUAL(
static_cast<std::size_t
>(1), all_bids_container[2].size());
943 CPPUNIT_ASSERT_EQUAL(
static_cast<boundary_id_type>(2), all_bids_container[2][0]);
971 for (
auto & elem :
mesh->active_element_ptr_range())
978 for (
auto & elem :
mesh->active_element_ptr_range())
980 const Point c = elem->vertex_average();
981 if (c(0) < 0.5 && c(1) < 0.5)
993 for (
auto & elem :
mesh->active_element_ptr_range())
995 const Point c = elem->vertex_average();
996 if (c(0) < 0.5 && c(0) > 0.25 && c(1) < 0.25)
1005 for (
auto & elem :
mesh->active_element_ptr_range())
1007 const Point c = elem->vertex_average();
1008 if (c(0) < 0.5 && c(0) > 0.25 && c(1) < 0.25)
1012 CPPUNIT_ASSERT_EQUAL(
static_cast<unsigned int>(1), side_5);
1013 CPPUNIT_ASSERT_EQUAL(
static_cast<unsigned int>(1), side_6);
1020 for (
auto & elem :
mesh->active_element_ptr_range())
1022 const Point c = elem->vertex_average();
1023 if (c(0) < 0.5 && c(0) > 0.25 && c(1) > 0.25 && c(1) < 0.5)
1026 CPPUNIT_ASSERT_EQUAL(
static_cast<unsigned long>(2), sides.size());
1027 CPPUNIT_ASSERT_EQUAL(
static_cast<unsigned int>(1), sides[0]);
1028 CPPUNIT_ASSERT_EQUAL(
static_cast<unsigned int>(2), sides[1]);
1059 for (
const auto & elem :
mesh.element_ptr_range())
1061 for (
auto n : elem->node_index_range())
1063 const Node * node = elem->node_ptr(n);
1064 for (
auto s : {0,2})
1065 if (elem->is_node_on_side(n, s) && !elem->neighbor_ptr(s))
1067 for (
auto s : {1,3})
1098 for (
const auto & elem :
mesh.element_ptr_range())
1100 for (
auto s : {0,2})
1102 if (!elem->neighbor_ptr(s))
1110 for (
auto s : {1,3})
1139 for (
const auto & node :
mesh.node_ptr_range())
1143 for (
const auto & node :
mesh.node_ptr_range())
1160 for (
const auto & elem :
mesh.active_local_element_ptr_range())
1161 for (
auto s : elem->side_index_range())
1165 if (neigh && neigh->
subdomain_id() == elem->subdomain_id())
1178 bool found_interior_side =
false;
1179 for (
const auto & elem :
mesh.active_local_element_ptr_range())
1180 for (
auto s : elem->side_index_range())
1184 if (neigh && neigh->
subdomain_id() == elem->subdomain_id() &&
1186 found_interior_side =
true;
1191 CPPUNIT_ASSERT(found_interior_side);
1223 for (
const auto & node :
mesh.node_ptr_range())
1224 if (std::abs((*node)(0) - 0.) <
TOLERANCE ||
1230 for (
const auto & elem :
mesh.active_local_element_ptr_range())
1231 for (
auto s : elem->side_index_range())
1238 if (!elem->neighbor_ptr(s))
1261 const unsigned int internal_side = 1;
1266 Elem * left_bottom_elem =
nullptr;
1267 for (
auto & elem :
mesh.active_element_ptr_range())
1272 const Point c = elem->vertex_average();
1273 if (c(0) < 0.5 && c(1) < 0.5 && elem->neighbor_ptr(internal_side) !=
nullptr)
1275 left_bottom_elem = elem;
1281 if (left_bottom_elem)
1283 bi.
add_side(left_bottom_elem, internal_side, BID);
1286 CPPUNIT_ASSERT_EQUAL(internal_side, found_side);
CPPUNIT_TEST(testInternalBoundary)
CPPUNIT_TEST(testBoundaryOnChildrenBoundaryIDs)
CPPUNIT_TEST(testShellFaceConstraints)
CPPUNIT_TEST(testEdgeBoundaryConditions)
CPPUNIT_TEST(testBoundaryIDs)
void testSelectiveRenumber()
CPPUNIT_TEST(testBuildSideListFromNodeListDistributedMesh)
CPPUNIT_TEST(testBuildSideListFromNodeListThinMesh)
void testBuildSideListFromNodeListThinMesh()
CPPUNIT_TEST(testBoundaryOnChildrenElementsRefineCoarsen)
void testShellFaceConstraints()
void testBoundaryOnChildrenErrors()
void testBuildSideListFromNodeList()
CPPUNIT_TEST(testBoundaryOnChildrenErrors)
CPPUNIT_TEST(testBoundaryOnChildrenBoundarySides)
CPPUNIT_TEST(testBuildSideListFromNodeList)
CPPUNIT_TEST(testSelectiveRenumber)
CPPUNIT_TEST(testNameCopying)
void testBoundaryOnChildrenElementsRefineCoarsen()
void testEdgeBoundaryConditions()
CPPUNIT_TEST(testBuildNodeListFromSideList)
CPPUNIT_TEST(testRenumber)
void testBuildNodeListFromSideList()
void testBoundaryOnChildrenBoundarySides()
LIBMESH_CPPUNIT_TEST_SUITE(BoundaryInfoTest)
This test ensures various aspects of the BoundaryInfo class work as expected.
void testBoundaryOnChildrenBoundaryIDs()
void testInternalBoundary()
void testBuildSideListFromNodeListDistributedMesh()
void max(const T &r, T &o, Request &req) const
The BoundaryInfo class contains information relevant to boundary conditions including storing faces,...
std::size_t n_boundary_ids() const
void add_shellface(const dof_id_type elem, const unsigned short int shellface, const boundary_id_type id)
Add shell face shellface of element number elem with boundary id id to the boundary information data ...
std::string & sideset_name(boundary_id_type id)
void side_boundary_ids(const Elem *const elem, std::vector< std::vector< boundary_id_type > > &vec_to_fill) const
void renumber_edge_id(boundary_id_type old_id, boundary_id_type new_id)
Changes all edges with boundary id old_id to instead be labeled by boundary id new_id.
void synchronize_global_id_set()
Synchronizes the boundary_ids set on each processor to determine global_boundary_ids.
void allow_children_on_boundary_side(const bool children_on_boundary)
Whether or not to allow directly setting boundary sides on child elements.
void add_edge(const dof_id_type elem, const unsigned short int edge, const boundary_id_type id)
Add edge edge of element number elem with boundary id id to the boundary information data structure.
void build_side_list_from_node_list(const std::set< boundary_id_type > &nodeset_list={}, bool skip_interior_sides=false)
Adds sides to a sideset if every node on that side is in the same nodeset.
unsigned int side_with_boundary_id(const Elem *const elem, const boundary_id_type boundary_id) const
std::vector< BCTuple > build_side_list(BCTupleSortBy sort_by=BCTupleSortBy::ELEM_ID) const
std::size_t n_edge_conds() const
void remove_node_id(boundary_id_type id, bool global=false)
Removes all nodes with boundary id id from the BoundaryInfo object, removes it from the set of node b...
std::vector< unsigned int > sides_with_boundary_id(const Elem *const elem, const boundary_id_type boundary_id) const
std::vector< NodeBCTuple > build_node_list(NodeBCTupleSortBy sort_by=NodeBCTupleSortBy::NODE_ID) const
bool has_boundary_id(const Node *const node, const boundary_id_type id) const
const std::set< boundary_id_type > & get_edge_boundary_ids() const
void boundary_ids(const Node *node, std::vector< boundary_id_type > &vec_to_fill) const
Fills a user-provided std::vector with the boundary ids associated with Node node.
std::string & nodeset_name(boundary_id_type id)
void remove_id(boundary_id_type id, bool global=false)
Removes all entities (nodes, sides, edges, shellfaces) with boundary id id from their respective cont...
std::size_t n_shellface_conds() const
void remove_side_id(boundary_id_type id, bool global=false)
Removes all sides with boundary id id from the BoundaryInfo object, removes it from the set of side b...
const std::string & get_nodeset_name(boundary_id_type id) const
const std::set< boundary_id_type > & get_boundary_ids() const
const std::set< boundary_id_type > & get_node_boundary_ids() const
void build_node_list_from_side_list(const std::set< boundary_id_type > &sideset_list={})
Adds nodes with boundary ids based on the side's boundary ids they are connected to.
const std::string & get_sideset_name(boundary_id_type id) const
std::string & edgeset_name(boundary_id_type id)
const std::set< boundary_id_type > & get_side_boundary_ids() const
void add_node(const Node *node, const boundary_id_type id)
Add Node node with boundary id id to the boundary information data structures.
bool is_children_on_boundary_side() const
void renumber_id(boundary_id_type old_id, boundary_id_type new_id)
Changes all entities (nodes, sides, edges, shellfaces) with boundary id old_id to instead be labeled ...
void add_side(const dof_id_type elem, const unsigned short int side, const boundary_id_type id)
Add side side of element number elem with boundary id id to the boundary information data structure.
void renumber_node_id(boundary_id_type old_id, boundary_id_type new_id)
Changes all nodes with boundary id old_id to instead be labeled by boundary id new_id.
void remove_side(const Elem *elem, const unsigned short int side)
Removes all boundary conditions associated with side side of element elem, if any exist.
void renumber_side_id(boundary_id_type old_id, boundary_id_type new_id)
Changes all sides with boundary id old_id to instead be labeled by boundary id new_id.
This class allows one to associate Dirichlet boundary values with a given set of mesh boundary ids an...
The DistributedMesh class is derived from the MeshBase class, and is intended to provide identical fu...
void dof_indices(const Elem *const elem, std::vector< dof_id_type > &di) const
void add_dirichlet_boundary(const DirichletBoundary &dirichlet_boundary)
Adds a copy of the specified Dirichlet boundary to the system.
bool is_constrained_dof(const dof_id_type dof) const
processor_id_type processor_id() const
This is the base class from which all geometric element types are derived.
virtual Node *& set_node(const unsigned int i)
const Point & point(const unsigned int i) const
static std::unique_ptr< Elem > build(const ElemType type, Elem *p=nullptr)
subdomain_id_type subdomain_id() const
const Elem * neighbor_ptr(unsigned int i) const
This is the EquationSystems class.
virtual void init()
Initialize all the systems.
virtual System & add_system(std::string_view system_type, std::string_view name)
Add the system of type system_type named name to the systems array.
virtual bool is_serial() const
const BoundaryInfo & get_boundary_info() const
The information about boundary ids on the mesh.
virtual const Node * node_ptr(const dof_id_type i) const =0
void allow_renumbering(bool allow)
If false is passed in then this mesh will no longer be renumbered when being prepared for use.
void prepare_for_use(const bool skip_renumber_nodes_and_elements, const bool skip_find_neighbors)
Prepare a newly created (or read) mesh for use.
virtual void write(const std::string &name) const =0
virtual std::unique_ptr< MeshBase > clone() const =0
Virtual "copy constructor".
virtual void read(const std::string &name, void *mesh_data=nullptr, bool skip_renumber_nodes_and_elements=false, bool skip_find_neighbors=false, bool skip_detect_interior_parents=false)=0
Interfaces for reading/writing a mesh to/from a file.
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 dof_id_type max_elem_id() const =0
virtual const Elem * query_elem_ptr(const dof_id_type i) const =0
virtual Elem * add_elem(Elem *e)=0
Add elem e to the end of the element array.
dof_id_type n_active_local_elem() const
Implements (adaptive) mesh refinement algorithms for a MeshBase.
bool coarsen_elements()
Only coarsens the user-requested elements.
bool refine_elements()
Only refines the user-requested elements.
The Mesh class is a thin wrapper, around the ReplicatedMesh class by default.
A Node is like a Point, but with more information.
A class to stub for features that should be in libMesh, but haven't been written yet,...
processor_id_type processor_id() const
const Parallel::Communicator & comm() const
A Point defines a location in LIBMESH_DIM dimensional Real space.
Manages consistently variables, degrees of freedom, and coefficient vectors.
unsigned int add_variable(std::string_view var, const FEType &type, const std::set< subdomain_id_type > *const active_subdomains=nullptr)
Adds the variable var to the list of variables for this system.
dof_id_type n_constrained_dofs() const
const DofMap & get_dof_map() const
ConstFunction that simply returns 0.
Communicator * TestCommWorld
The libMesh namespace provides an interface to certain functionality in the library.
const RemoteElem * remote_elem
static constexpr Real TOLERANCE
CPPUNIT_TEST_SUITE_REGISTRATION(BoundaryInfoTest)