42 #include <unordered_set> 43 #include <unordered_map> 55 typedef std::vector<dof_id_type> datum;
63 void gather_data (
const std::vector<dof_id_type> & ids,
64 std::vector<datum> & neighbors)
const 66 neighbors.resize(ids.size());
68 for (std::size_t i=0; i != ids.size(); ++i)
76 neighbors[i].resize(n_neigh);
77 for (
unsigned int n = 0; n != n_neigh; ++n)
83 neighbors[i][n] = neigh->
id();
86 neighbors[i][n] = DofObject::invalid_id;
91 void act_on_data (
const std::vector<dof_id_type> & ids,
92 const std::vector<datum> & neighbors)
const 94 for (std::size_t i=0; i != ids.size(); ++i)
98 const datum & new_neigh = neighbors[i];
101 libmesh_assert_equal_to (n_neigh, new_neigh.size());
103 for (
unsigned int n = 0; n != n_neigh; ++n)
109 libmesh_assert_equal_to(old_neigh->
id(), new_neigh_id);
111 else if (new_neigh_id == DofObject::invalid_id)
113 libmesh_assert (!old_neigh);
141 std::set<const Elem *, CompareElemIdsByLevel> & connected_elements)
149 (*gf)(elem_it, elem_end, pid, elements_to_ghost);
153 for (
auto & pr : elements_to_ghost)
155 const Elem * elem = pr.first;
157 connected_elements.insert(elem);
163 for (; elem_it != elem_end; ++elem_it)
164 connected_elements.insert(*elem_it);
171 std::set<const Elem *, CompareElemIdsByLevel> & connected_elements)
176 #ifdef LIBMESH_ENABLE_AMR 180 for (
const auto & elem :
as_range(elem_it, elem_end))
185 connected_elements.insert(&child);
187 #endif // LIBMESH_ENABLE_AMR 196 #ifdef LIBMESH_ENABLE_AMR 213 std::set<const Elem *, CompareElemIdsByLevel>::reverse_iterator
214 elem_rit = connected_elements.rbegin();
216 for (; elem_rit != connected_elements.rend(); ++elem_rit)
218 const Elem * elem = *elem_rit;
219 libmesh_assert(elem);
226 connected_elements.insert (parent);
230 std::vector<const Elem *> subactive_family;
232 for (std::size_t i=0; i != subactive_family.size(); ++i)
234 libmesh_assert(subactive_family[i] !=
remote_elem);
235 connected_elements.insert(subactive_family[i]);
245 for (
const auto & elem : connected_elements)
247 libmesh_assert(elem);
250 libmesh_assert(connected_elements.count(parent));
254 #endif // LIBMESH_ENABLE_AMR 258 void reconnect_nodes (
const std::set<const Elem *, CompareElemIdsByLevel> & connected_elements,
259 std::set<const Node *> & connected_nodes)
263 connected_nodes.clear();
265 for (
const auto & elem : connected_elements)
267 connected_nodes.insert(&n);
275 void MeshCommunication::clear ()
282 #ifndef LIBMESH_HAVE_MPI // avoid spurious gcc warnings 293 bool newly_coarsened_only)
const 322 LOG_SCOPE(
"redistribute()",
"MeshCommunication");
337 std::vector<dof_id_type> send_n_nodes_and_elem_per_proc(2*
mesh.
n_processors(), 0);
339 std::vector<Parallel::Request>
340 node_send_requests, element_send_requests;
344 std::unordered_map<processor_id_type, std::vector<Elem *>> send_to_pid;
347 #ifdef LIBMESH_ENABLE_AMR 348 newly_coarsened_only ?
354 #ifdef LIBMESH_ENABLE_AMR 355 newly_coarsened_only ?
360 for (
auto & elem :
as_range(send_elems_begin, send_elems_end))
372 const auto elements_vec_it = send_to_pid.find(pid);
377 if (elements_vec_it == send_to_pid.end())
380 const auto & p_elements = elements_vec_it->second;
381 libmesh_assert(!p_elements.empty());
383 Elem *
const * elempp = p_elements.data();
384 Elem *
const * elemend = elempp + p_elements.size();
386 #ifndef LIBMESH_ENABLE_AMR 389 libmesh_assert(!newly_coarsened_only);
400 std::set<const Elem *, CompareElemIdsByLevel> elements_to_send;
416 std::set<const Node *> connected_nodes;
420 send_n_nodes_and_elem_per_proc[2*pid+0] =
421 cast_int<dof_id_type>(connected_nodes.size());
424 libmesh_assert (!connected_nodes.empty());
428 connected_nodes.begin(),
429 connected_nodes.end(),
430 node_send_requests.back(),
434 send_n_nodes_and_elem_per_proc[2*pid+1] =
435 cast_int<dof_id_type>(elements_to_send.size());
438 libmesh_assert (!elements_to_send.empty());
442 elements_to_send.begin(),
443 elements_to_send.end(),
444 element_send_requests.back(),
448 std::vector<dof_id_type> recv_n_nodes_and_elem_per_proc(send_n_nodes_and_elem_per_proc);
460 n_send_node_pairs=0, n_send_elem_pairs=0,
461 n_recv_node_pairs=0, n_recv_elem_pairs=0;
465 if (send_n_nodes_and_elem_per_proc[2*pid+0])
467 send_node_pair[pid] =
true;
471 if (send_n_nodes_and_elem_per_proc[2*pid+1])
473 send_elem_pair[pid] =
true;
477 if (recv_n_nodes_and_elem_per_proc[2*pid+0])
479 recv_node_pair[pid] =
true;
483 if (recv_n_nodes_and_elem_per_proc[2*pid+1])
485 recv_elem_pair[pid] =
true;
489 libmesh_assert_equal_to (n_send_node_pairs, node_send_requests.size());
490 libmesh_assert_equal_to (n_send_elem_pairs, element_send_requests.size());
494 for (
unsigned int node_comm_step=0; node_comm_step<n_recv_node_pairs; node_comm_step++)
506 for (
unsigned int elem_comm_step=0; elem_comm_step<n_recv_elem_pairs; elem_comm_step++)
534 #endif // LIBMESH_HAVE_MPI 538 #ifndef LIBMESH_HAVE_MPI // avoid spurious gcc warnings 557 LOG_SCOPE(
"gather_neighboring_elements()",
"MeshCommunication");
604 std::vector<processor_id_type> adjacent_processors;
607 adjacent_processors.push_back (pid);
611 cast_int<processor_id_type>(adjacent_processors.size());
617 std::vector<dof_id_type> my_interface_node_list;
618 std::vector<const Elem *> my_interface_elements;
620 std::set<dof_id_type> my_interface_node_set;
623 std::unique_ptr<const Elem>
side;
628 libmesh_assert(elem);
632 my_interface_elements.push_back(elem);
639 for (
unsigned int n=0; n<
side->n_vertices(); n++)
640 my_interface_node_set.insert (
side->node_id(n));
645 my_interface_node_list.reserve (my_interface_node_set.size());
646 my_interface_node_list.insert (my_interface_node_list.end(),
647 my_interface_node_set.begin(),
648 my_interface_node_set.end());
658 std::vector<std::vector<dof_id_type>>
659 my_interface_node_xfer_buffers (n_adjacent_processors, my_interface_node_list);
660 std::map<processor_id_type, unsigned char> n_comm_steps;
662 std::vector<Parallel::Request> send_requests (3*n_adjacent_processors);
663 unsigned int current_request = 0;
665 for (
unsigned int comm_step=0; comm_step<n_adjacent_processors; comm_step++)
667 n_comm_steps[adjacent_processors[comm_step]]=1;
669 my_interface_node_xfer_buffers[comm_step],
670 send_requests[current_request++],
671 element_neighbors_tag);
682 adjacent_processors.clear();
684 std::vector<dof_id_type> common_interface_node_list;
699 for (
unsigned int comm_step=0; comm_step<3*n_adjacent_processors; comm_step++)
705 element_neighbors_tag));
707 source_pid_idx = cast_int<processor_id_type>(
status.source()),
708 dest_pid_idx = source_pid_idx;
712 if (n_comm_steps[source_pid_idx] == 1)
714 n_comm_steps[source_pid_idx]++;
717 common_interface_node_list,
718 element_neighbors_tag);
720 their_interface_node_list_size = common_interface_node_list.
size();
729 common_interface_node_list.erase
730 (std::set_intersection (my_interface_node_list.begin(),
731 my_interface_node_list.end(),
732 common_interface_node_list.begin(),
733 common_interface_node_list.end(),
734 common_interface_node_list.begin()),
735 common_interface_node_list.end());
739 <<
"my_interface_node_list.size()=" << my_interface_node_list.size()
740 <<
", [" << source_pid_idx <<
"] " 741 <<
"their_interface_node_list.size()=" << their_interface_node_list_size
742 <<
", common_interface_node_list.size()=" << common_interface_node_list.size()
755 std::set<const Elem *, CompareElemIdsByLevel> elements_to_send;
756 std::set<const Node *> connected_nodes;
759 if (common_interface_node_list.empty())
769 connected_nodes.begin(),
770 connected_nodes.end(),
771 send_requests[current_request++],
772 element_neighbors_tag);
776 elements_to_send.begin(),
777 elements_to_send.end(),
778 send_requests[current_request++],
779 element_neighbors_tag);
784 adjacent_processors.push_back(source_pid_idx);
786 std::vector<const Elem *> family_tree;
788 for (std::size_t e=0, n_shared_nodes=0; e<my_interface_elements.size(); e++, n_shared_nodes=0)
790 const Elem * elem = my_interface_elements[e];
792 for (
unsigned int n=0; n<elem->
n_vertices(); n++)
793 if (std::binary_search (common_interface_node_list.begin(),
794 common_interface_node_list.end(),
802 if (n_shared_nodes > 0)
break;
811 if (!elements_to_send.count(elem))
813 #ifdef LIBMESH_ENABLE_AMR 817 family_tree.push_back(elem);
819 for (std::size_t leaf=0; leaf<family_tree.size(); leaf++)
821 elem = family_tree[leaf];
822 elements_to_send.insert (elem);
825 connected_nodes.insert (&n);
836 libmesh_assert (connected_nodes.empty() || !elements_to_send.empty());
837 libmesh_assert (!connected_nodes.empty() || elements_to_send.empty());
842 connected_nodes.begin(),
843 connected_nodes.end(),
844 send_requests[current_request++],
845 element_neighbors_tag);
850 elements_to_send.begin(),
851 elements_to_send.end(),
852 send_requests[current_request++],
853 element_neighbors_tag);
858 else if (n_comm_steps[source_pid_idx] == 2)
860 n_comm_steps[source_pid_idx]++;
866 element_neighbors_tag);
870 else if (n_comm_steps[source_pid_idx] == 3)
872 n_comm_steps[source_pid_idx]++;
878 element_neighbors_tag);
885 << n_comm_steps[source_pid_idx]
905 SyncNeighbors nsync(
mesh);
910 #endif // LIBMESH_HAVE_MPI 913 #ifndef LIBMESH_HAVE_MPI // avoid spurious gcc warnings 915 void MeshCommunication::send_coarse_ghosts(
MeshBase &)
const 921 void MeshCommunication::send_coarse_ghosts(
MeshBase &
mesh)
const 931 #ifndef LIBMESH_ENABLE_AMR 932 libmesh_error_msg(
"Calling MeshCommunication::send_coarse_ghosts() requires AMR to be enabled. " 933 "Please configure libmesh with --enable-amr.");
942 typedef std::unordered_map<processor_id_type, std::vector<Elem *>> ghost_map;
943 ghost_map coarsening_elements_to_ghost;
951 libmesh_assert(elem->
parent());
958 if (their_proc_id != proc_id)
959 coarsening_elements_to_ghost[their_proc_id].push_back(elem);
970 std::vector<Parallel::Request> send_requests;
974 std::vector<unsigned char> send_to_proc(n_proc, 0);
984 std::set<const Elem *, CompareElemIdsByLevel> elements_to_send;
985 std::set<const Node *> nodes_to_send;
987 const ghost_map::const_iterator it =
988 coarsening_elements_to_ghost.find(p);
989 if (it != coarsening_elements_to_ghost.end())
991 const std::vector<Elem *> & elems = it->second;
992 libmesh_assert(elems.size());
996 Elem *
const * elempp =
const_cast<Elem *
const *
>(elems.data());
997 Elem *
const * elemend = elempp+elems.size();
1008 (*gf)(elem_it, elem_end, p, elements_to_ghost);
1012 for (
auto & pr : elements_to_ghost)
1014 const Elem * elem = pr.first;
1015 libmesh_assert(elem);
1019 elements_to_send.insert(elem);
1021 nodes_to_send.insert(&n);
1030 nodes_to_send.begin(),
1031 nodes_to_send.end(),
1032 send_requests.back(),
1037 send_to_proc[p] = 1;
1040 elements_to_send.begin(),
1041 elements_to_send.end(),
1042 send_requests.back(),
1048 std::vector<unsigned char> recv_from_proc(send_to_proc);
1052 (std::count(recv_from_proc.begin(), recv_from_proc.end(), 1));
1077 #endif // LIBMESH_ENABLE_AMR 1080 #endif // LIBMESH_HAVE_MPI 1082 #ifndef LIBMESH_HAVE_MPI // avoid spurious gcc warnings 1091 void MeshCommunication::broadcast (
MeshBase &
mesh)
const 1099 libmesh_parallel_only(
mesh.
comm());
1101 LOG_SCOPE(
"broadcast()",
"MeshCommunication");
1123 for (
unsigned int l=0; l !=
n_levels; ++l)
1146 MeshTools::libmesh_assert_valid_procids<Elem>(
mesh);
1147 MeshTools::libmesh_assert_valid_procids<Node>(
mesh);
1150 #endif // LIBMESH_HAVE_MPI 1154 #ifndef LIBMESH_HAVE_MPI // avoid spurious gcc warnings 1170 libmesh_parallel_only(
mesh.
comm());
1172 LOG_SCOPE(
"(all)gather()",
"MeshCommunication");
1174 (root_id == DofObject::invalid_processor_id) ?
1191 for (
unsigned int l=0; l !=
n_levels; ++l)
1192 (root_id == DofObject::invalid_processor_id) ?
1210 if (root_id == DofObject::invalid_processor_id)
1228 #endif // LIBMESH_HAVE_MPI 1241 SyncIds(
MeshBase & _mesh, renumber_obj _renumberer) :
1251 void gather_data (
const std::vector<dof_id_type> & ids,
1252 std::vector<datum> & ids_out)
const 1257 void act_on_data (
const std::vector<dof_id_type> & old_ids,
1258 const std::vector<datum> & new_ids)
const 1260 for (std::size_t i=0; i != old_ids.size(); ++i)
1261 if (old_ids[i] != new_ids[i])
1279 typedef std::unordered_set<const Node *> uset_type;
1285 typedef std::unordered_map<dof_id_type, dof_id_type> umap_type;
1293 void gather_data (
const std::vector<dof_id_type> & ids,
1294 std::vector<datum> & ids_out)
const 1297 ids_out.resize(ids.size(), DofObject::invalid_id);
1299 for (std::size_t i = 0; i != ids.size(); ++i)
1309 bool act_on_data (
const std::vector<dof_id_type> & old_ids,
1310 const std::vector<datum> & new_ids)
1312 bool data_changed =
false;
1313 for (std::size_t i=0; i != old_ids.size(); ++i)
1330 libmesh_assert_equal_to
1338 if (new_id == DofObject::invalid_id)
1343 data_changed =
true;
1349 if (old_id != new_id)
1357 data_changed =
true;
1361 return data_changed;
1366 #ifdef LIBMESH_ENABLE_AMR 1369 typedef unsigned char datum;
1377 void gather_data (
const std::vector<dof_id_type> & ids,
1378 std::vector<datum> & ids_out)
const 1380 ids_out.reserve(ids.size());
1382 for (std::size_t i=0; i != ids.size(); ++i)
1386 ids_out.push_back(cast_int<unsigned char>(elem.
p_level()));
1390 void act_on_data (
const std::vector<dof_id_type> & old_ids,
1391 const std::vector<datum> & new_p_levels)
const 1393 for (std::size_t i=0; i != old_ids.size(); ++i)
1401 #endif // LIBMESH_ENABLE_AMR 1404 #ifdef LIBMESH_ENABLE_UNIQUE_ID 1405 template <
typename DofObjSub
class>
1406 struct SyncUniqueIds
1411 SyncUniqueIds(
MeshBase &_mesh, query_obj _querier) :
1420 void gather_data (
const std::vector<dof_id_type>& ids,
1421 std::vector<datum>& ids_out)
const 1423 ids_out.reserve(ids.size());
1425 for (std::size_t i=0; i != ids.size(); ++i)
1427 DofObjSubclass *d = (
mesh.*
query)(ids[i]);
1430 ids_out.push_back(d->unique_id());
1434 void act_on_data (
const std::vector<dof_id_type>& ids,
1435 const std::vector<datum>& unique_ids)
const 1437 for (std::size_t i=0; i != ids.size(); ++i)
1439 DofObjSubclass *d = (
mesh.*
query)(ids[i]);
1442 d->set_unique_id() = unique_ids[i];
1446 #endif // LIBMESH_ENABLE_UNIQUE_ID 1452 void MeshCommunication::make_node_ids_parallel_consistent (
MeshBase &
mesh)
1455 libmesh_parallel_only(
mesh.
comm());
1465 LOG_SCOPE (
"make_node_ids_parallel_consistent()",
"MeshCommunication");
1467 SyncNodeIds syncids(
mesh);
1481 void MeshCommunication::make_node_unique_ids_parallel_consistent (
MeshBase &
mesh)
1487 libmesh_parallel_only(
mesh.
comm());
1489 #ifdef LIBMESH_ENABLE_UNIQUE_ID 1490 LOG_SCOPE (
"make_node_unique_ids_parallel_consistent()",
"MeshCommunication");
1492 SyncUniqueIds<Node> syncuniqueids(
mesh, &MeshBase::query_node_ptr);
1508 libmesh_parallel_only(
mesh.
comm());
1510 LOG_SCOPE (
"make_elems_parallel_consistent()",
"MeshCommunication");
1512 SyncIds syncids(
mesh, &MeshBase::renumber_elem);
1517 #ifdef LIBMESH_ENABLE_UNIQUE_ID 1518 SyncUniqueIds<Elem> syncuniqueids(
mesh, &MeshBase::query_elem_ptr);
1528 #ifdef LIBMESH_ENABLE_AMR 1532 libmesh_parallel_only(
mesh.
comm());
1534 LOG_SCOPE (
"make_p_levels_parallel_consistent()",
"MeshCommunication");
1536 SyncPLevels syncplevels(
mesh);
1541 #endif // LIBMESH_ENABLE_AMR 1557 void gather_data (
const std::vector<dof_id_type> & ids,
1558 std::vector<datum> &
data)
1561 data.resize(ids.size());
1563 for (std::size_t i=0; i != ids.size(); ++i)
1566 if (ids[i] != DofObject::invalid_id)
1574 data[i] = DofObject::invalid_processor_id;
1579 bool act_on_data (
const std::vector<dof_id_type> & ids,
1580 const std::vector<datum> proc_ids)
1582 bool data_changed =
false;
1585 for (std::size_t i=0; i != ids.size(); ++i)
1598 data_changed =
true;
1603 return data_changed;
1608 struct ElemNodesMaybeNew
1610 ElemNodesMaybeNew() {}
1612 bool operator() (
const Elem * elem)
const 1616 #ifdef LIBMESH_ENABLE_AMR 1637 if (node->
processor_id() == DofObject::invalid_processor_id)
1641 bool operator() (
const Elem * elem,
unsigned int local_node_num)
const 1656 void MeshCommunication::make_node_proc_ids_parallel_consistent(
MeshBase &
mesh)
1658 LOG_SCOPE (
"make_node_proc_ids_parallel_consistent()",
"MeshCommunication");
1661 libmesh_parallel_only(
mesh.
comm());
1676 SyncProcIds sync(
mesh);
1685 void MeshCommunication::make_new_node_proc_ids_parallel_consistent(
MeshBase &
mesh)
1687 LOG_SCOPE (
"make_new_node_proc_ids_parallel_consistent()",
"MeshCommunication");
1690 libmesh_parallel_only(
mesh.
comm());
1719 auto node_unpartitioned =
1720 [](
const Elem * elem,
unsigned int local_node_num)
1722 DofObject::invalid_processor_id; };
1724 SyncProcIds sync(
mesh);
1729 node_unpartitioned, sync);
1737 NodeWasNew node_was_new(
mesh);
1742 if (node_was_new.was_new.count(&node))
1751 ElemNodesMaybeNew(), node_was_new, sync);
1766 libmesh_parallel_only(
mesh.
comm());
1790 this->make_node_proc_ids_parallel_consistent(
mesh);
1793 this->make_node_ids_parallel_consistent(
mesh);
1796 this->make_node_unique_ids_parallel_consistent(
mesh);
1805 void MeshCommunication::make_new_nodes_parallel_consistent (
MeshBase &
mesh)
1808 libmesh_parallel_only(
mesh.
comm());
1828 this->make_new_node_proc_ids_parallel_consistent(
mesh);
1831 this->make_node_ids_parallel_consistent(
mesh);
1834 this->make_node_unique_ids_parallel_consistent(
mesh);
1845 const std::set<Elem *> & extra_ghost_elem_ids)
const 1850 LOG_SCOPE(
"delete_remote_elements()",
"MeshCommunication");
1863 std::set<const Elem *, CompareElemIdsByLevel> elements_to_keep;
1866 for (
const auto & elem : extra_ghost_elem_ids)
1868 std::vector<const Elem *> active_family;
1869 #ifdef LIBMESH_ENABLE_AMR 1874 active_family.push_back(elem);
1876 for (std::size_t i=0; i != active_family.size(); ++i)
1877 elements_to_keep.insert(active_family[i]);
1888 (
mesh, DofObject::invalid_processor_id,
1908 std::set<const Node *> connected_nodes;
1916 for (
int l =
n_levels - 1; l >= 0; --l)
1920 libmesh_assert (elem);
1922 const bool keep_me = elements_to_keep.count(elem);
1936 libmesh_assert(node);
1937 if (!connected_nodes.count(node))
1953 gf->delete_remote_elements();
void set_p_level(const unsigned int p)
RefinementState refinement_flag() const
void send(const unsigned int dest_processor_id, const T &buf, const MessageTag &tag=no_tag) const
void wait(std::vector< Request > &r)
const Elem * parent() const
A geometric point in (x,y,z) space associated with a DOF.
virtual void renumber_node(dof_id_type old_id, dof_id_type new_id)=0
virtual element_iterator not_local_elements_end()=0
virtual element_iterator level_elements_begin(unsigned int level)=0
const unsigned int any_source
IntRange< unsigned short > side_index_range() const
void send_packed_range(const unsigned int dest_processor_id, const Context *context, Iter range_begin, const Iter range_end, const MessageTag &tag=no_tag) const
const Elem * top_parent() const
virtual element_iterator unpartitioned_elements_begin()=0
std::unordered_set< const Node * > was_new
The base class for all geometric element types.
uint8_t processor_id_type
void receive_packed_range(const unsigned int dest_processor_id, Context *context, OutputIter out, const T *output_type, const MessageTag &tag=any_tag) const
virtual element_iterator flagged_elements_end(unsigned char rflag)=0
void alltoall(std::vector< T, A > &r) const
const Parallel::Communicator & comm() const
unsigned int p_level() const
MessageTag get_unique_tag(int tagvalue) const
void active_family_tree(std::vector< const Elem *> &active_family, const bool reset=true) const
virtual element_iterator flagged_pid_elements_end(unsigned char rflag, processor_id_type pid)=0
void make_links_to_me_remote()
const BoundaryInfo & get_boundary_info() const
void total_family_tree(std::vector< const Elem *> &active_family, const bool reset=true) const
SimpleRange< ChildRefIter > child_ref_range()
virtual std::unique_ptr< Elem > build_side_ptr(const unsigned int i, bool proxy=true)=0
virtual node_iterator nodes_begin()=0
virtual element_iterator elements_begin()=0
virtual SimpleRange< element_iterator > active_local_element_ptr_range()=0
virtual element_iterator level_elements_end(unsigned int level)=0
std::map< boundary_id_type, std::string > & set_sideset_name_map()
processor_id_type n_processors() const
virtual bool is_serial() const
void libmesh_ignore(const Args &...)
virtual void find_neighbors(const bool reset_remote_elements=false, const bool reset_current_list=true)=0
virtual void delete_elem(Elem *e)=0
void reconnect_nodes(const std::set< const Elem *, CompareElemIdsByLevel > &connected_elements, std::set< const Node *> &connected_nodes)
virtual SimpleRange< element_iterator > element_ptr_range()=0
const Node & node_ref(const unsigned int i) const
virtual element_iterator active_pid_elements_begin(processor_id_type proc_id)=0
void sync_node_data_by_element_id(MeshBase &mesh, const MeshBase::const_element_iterator &range_begin, const MeshBase::const_element_iterator &range_end, const ElemCheckFunctor &elem_check, const NodeCheckFunctor &node_check, SyncFunctor &sync)
virtual element_iterator flagged_elements_begin(unsigned char rflag)=0
void connect_families(std::set< const Elem *, CompareElemIdsByLevel > &connected_elements)
virtual element_iterator elements_end()=0
virtual const Node * query_node_ptr(const dof_id_type i) const =0
virtual SimpleRange< node_iterator > node_ptr_range()=0
virtual dof_id_type max_elem_id() const =0
void clear_point_locator()
SimpleRange< I > as_range(const std::pair< I, I > &p)
void family_tree(std::vector< const Elem *> &family, const bool reset=true) const
std::unordered_map< const Elem *, const CouplingMatrix * > map_type
virtual void delete_node(Node *n)=0
OStreamProxy err(std::cerr)
std::map< subdomain_id_type, std::string > & set_subdomain_name_map()
void sync_dofobject_data_by_id(const Communicator &comm, const Iterator &range_begin, const Iterator &range_end, SyncFunctor &sync)
void set_neighbor(const unsigned int i, Elem *n)
Mesh data structure which is distributed across all processors.
status probe(const unsigned int src_processor_id, const MessageTag &tag=any_tag) const
void regenerate_id_sets()
umap_type definitive_renumbering
unsigned int size(const data_type &type) const
virtual element_iterator active_elements_begin()=0
virtual element_iterator flagged_pid_elements_begin(unsigned char rflag, processor_id_type pid)=0
An output iterator for use with packed_range functions.
void allgather_packed_range(Context *context, Iter range_begin, const Iter range_end, OutputIter out) const
SimpleRange< NodeRefIter > node_ref_range()
virtual element_iterator pid_elements_begin(processor_id_type proc_id)=0
virtual element_iterator active_elements_end()=0
void query_ghosting_functors(const MeshBase &mesh, processor_id_type pid, MeshBase::const_element_iterator elem_it, MeshBase::const_element_iterator elem_end, std::set< const Elem *, CompareElemIdsByLevel > &connected_elements)
const Elem * neighbor_ptr(unsigned int i) const
std::set< GhostingFunctor * >::const_iterator ghosting_functors_begin() const
virtual unsigned int n_vertices() const =0
virtual node_iterator nodes_end()=0
virtual element_iterator active_pid_elements_end(processor_id_type proc_id)=0
virtual const Elem * query_elem_ptr(const dof_id_type i) const =0
const Node * node_ptr(const unsigned int i) const
std::map< boundary_id_type, std::string > & set_nodeset_name_map()
bool sync_node_data_by_element_id_once(MeshBase &mesh, const MeshBase::const_element_iterator &range_begin, const MeshBase::const_element_iterator &range_end, const ElemCheckFunctor &elem_check, const NodeCheckFunctor &node_check, SyncFunctor &sync)
unsigned int n_neighbors() const
virtual const Elem & elem_ref(const dof_id_type i) const
Status receive(const unsigned int dest_processor_id, T &buf, const MessageTag &tag=any_tag) const
virtual element_iterator unpartitioned_elements_end()=0
virtual const Node & node_ref(const dof_id_type i) const
SimpleRange< NeighborPtrIter > neighbor_ptr_range()
void connect_children(const MeshBase &mesh, MeshBase::const_element_iterator elem_it, MeshBase::const_element_iterator elem_end, std::set< const Elem *, CompareElemIdsByLevel > &connected_elements)
virtual element_iterator not_local_elements_begin()=0
virtual dof_id_type max_node_id() const =0
virtual dof_id_type n_elem() const =0
virtual const Node * node_ptr(const dof_id_type i) const =0
processor_id_type processor_id() const
OStreamProxy out(std::cout)
void gather_packed_range(const unsigned int root_id, Context *context, Iter range_begin, const Iter range_end, OutputIter out) const
processor_id_type processor_id() const
long double min(long double a, double b)
dof_id_type node_id(const unsigned int i) const
bool has_children() const
void broadcast(T &data, const unsigned int root_id=0) const
virtual dof_id_type n_nodes() const =0
void sync_element_data_by_parent_id(MeshBase &mesh, const Iterator &range_begin, const Iterator &range_end, SyncFunctor &sync)
void broadcast_packed_range(const Context *context1, Iter range_begin, const Iter range_end, OutputContext *context2, OutputIter out, const unsigned int root_id=0) const
std::set< GhostingFunctor * >::const_iterator ghosting_functors_end() const
const RemoteElem * remote_elem
virtual element_iterator pid_elements_end(processor_id_type proc_id)=0
bool verify(const T &r) const