21 #include "libmesh/elem.h" 22 #include "libmesh/topology_map.h" 23 #include "libmesh/mesh_base.h" 24 #include "libmesh/node.h" 25 #include "libmesh/parallel_only.h" 26 #include "libmesh/remote_elem.h" 27 #include "libmesh/libmesh_logging.h" 40 if (!
mesh.is_serial())
41 libmesh_parallel_only(
mesh.comm());
43 LOG_SCOPE(
"init()",
"TopologyMap");
54 const std::vector<std::pair<dof_id_type, dof_id_type>> & bracketing_nodes)
60 for (
auto [id1, id2] : bracketing_nodes)
62 libmesh_assert_not_equal_to(id1, id2);
69 if (
const auto it =
_map.find(std::make_pair(lower_id, upper_id));
71 libmesh_assert_equal_to (it->second, mid_node_id);
74 this->
_map.emplace(std::make_pair(lower_id, upper_id),
85 for (
auto pair : bracketing_nodes)
87 const dof_id_type lower_id = std::min(pair.first, pair.second);
88 const dof_id_type upper_id = std::max(pair.first, pair.second);
91 this->
find(lower_id, upper_id);
99 libmesh_assert_equal_to (new_node_id, possible_new_node_id);
101 new_node_id = possible_new_node_id;
118 const dof_id_type lower_id = std::min(bracket_node1, bracket_node2);
119 const dof_id_type upper_id = std::max(bracket_node1, bracket_node2);
121 if (
const auto it =
_map.find(std::make_pair(lower_id, upper_id));
134 #ifdef LIBMESH_ENABLE_AMR 139 for (
const auto & elem :
mesh.element_ptr_range())
143 if (!elem->has_children())
146 for (
unsigned int c = 0, nc = elem->n_children(); c != nc; ++c)
152 for (
unsigned int n = 0, nnic = elem->n_nodes_in_child(c); n != nnic; ++n)
154 const std::vector<std::pair<dof_id_type, dof_id_type>>
virtual const std::vector< std::pair< dof_id_type, dof_id_type > > bracketing_nodes(unsigned int c, unsigned int n) const
A Node is like a Point, but with more information.
dof_id_type find(dof_id_type bracket_node1, dof_id_type bracket_node2) const
void add_node(const Node &mid_node, const std::vector< std::pair< dof_id_type, dof_id_type >> &bracketing_nodes)
Add a node to the map, between each pair of specified bracketing nodes.
This is the base class from which all geometric element types are derived.
void fill(const MeshBase &)
The libMesh namespace provides an interface to certain functionality in the library.
This is the MeshBase class.
const Node & node_ref(const unsigned int i) const
static const dof_id_type invalid_id
An invalid id to distinguish an uninitialized DofObject.
const Elem * child_ptr(unsigned int i) const
const RemoteElem * remote_elem