109 const auto [owning_ranks_of_ghosts, targets_with_indexset] =
116 std::map<unsigned int, std::vector<types::global_dof_index>> recv_map;
118 for (
const auto &owner : owning_ranks_of_ghosts)
119 recv_map[owner] = std::vector<types::global_dof_index>();
123 recv_map[owning_ranks_of_ghosts[i]].push_back(i);
126 for (
const auto &target_with_indexset : recv_map)
128 recv_ranks.push_back(target_with_indexset.first);
130 for (
const auto cell_index : target_with_indexset.second)
139 for (
const auto &target_with_indexset : targets_with_indexset)
141 send_ranks.push_back(target_with_indexset.first);
143 for (
const auto cell_index : target_with_indexset.second)
155 const std::vector<types::global_dof_index> &indices_has,
156 const std::vector<types::global_dof_index> &indices_want,
161 std::vector<types::global_dof_index> indices_has_clean;
162 indices_has_clean.reserve(indices_has.size());
164 for (
const auto i : indices_has)
166 indices_has_clean.push_back(i);
168 std::vector<types::global_dof_index> indices_want_clean;
169 indices_want_clean.reserve(indices_want.size());
171 for (
const auto i : indices_want)
173 indices_want_clean.push_back(i);
177 indices_has_clean.empty() ?
179 (*std::max_element(indices_has_clean.begin(),
180 indices_has_clean.end()) +
184 indices_want_clean.empty() ?
186 (*std::max_element(indices_want_clean.begin(),
187 indices_want_clean.end()) +
196 index_set_has.
add_indices(indices_has_clean.begin(),
197 indices_has_clean.end());
200 index_set_want.
add_indices(indices_want_clean.begin(),
201 indices_want_clean.end());
209 std::vector<types::global_dof_index> temp_map_send(
217 i = temp_map_send[i];
221 std::vector<std::vector<types::global_dof_index>> temp_map_recv(
229 const bool use_fast_path =
230 std::all_of(temp_map_recv.begin(),
232 [&](
const auto &x) { return x.size() == 1; });
237 i = temp_map_recv[i][0];
243 for (
const auto &indices : temp_map_recv)
245 for (
const auto &index : indices)
std::pair< std::vector< unsigned int >, std::map< unsigned int, IndexSet > > compute_index_owner_and_requesters(const IndexSet &owned_indices, const IndexSet &indices_to_look_up, const MPI_Comm &comm)
::VectorizedArray< Number, width > max(const ::VectorizedArray< Number, width > &, const ::VectorizedArray< Number, width > &)