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 pair : bracketing_nodes)
69 map_type::iterator it =
70 _map.find(std::make_pair(lower_id, upper_id));
73 libmesh_assert_equal_to (it->second, mid_node_id);
76 this->
_map.insert(std::make_pair(std::make_pair(lower_id, upper_id),
87 for (
auto pair : bracketing_nodes)
89 const dof_id_type lower_id = std::min(pair.first, pair.second);
90 const dof_id_type upper_id = std::max(pair.first, pair.second);
93 this->
find(lower_id, upper_id);
101 libmesh_assert_equal_to (new_node_id, possible_new_node_id);
103 new_node_id = possible_new_node_id;
120 const dof_id_type lower_id = std::min(bracket_node1, bracket_node2);
121 const dof_id_type upper_id = std::max(bracket_node1, bracket_node2);
123 map_type::const_iterator it =
124 _map.find(std::make_pair(lower_id, upper_id));
126 if (it ==
_map.end())
136 #ifdef LIBMESH_ENABLE_AMR
141 for (
const auto & elem :
mesh.element_ptr_range())
145 if (!elem->has_children())
148 for (
unsigned int c = 0, nc = elem->n_children(); c != nc; ++c)
154 for (
unsigned int n = 0, nnic = elem->n_nodes_in_child(c); n != nnic; ++n)
156 const std::vector<std::pair<dof_id_type, dof_id_type>>