54std::vector<std::int32_t>
71std::tuple<std::int64_t, std::vector<std::int32_t>,
72 std::vector<std::vector<std::int64_t>>,
73 std::vector<std::vector<int>>>
75 const std::vector<std::pair<std::reference_wrapper<const IndexMap>,
int>>&
102std::tuple<IndexMap, std::vector<std::int32_t>,
bool>
104 std::span<const std::int32_t> indices,
178 std::span<const std::int64_t>
ghosts, std::span<const int>
owners,
179 int tag =
static_cast<int>(dolfinx::MPI::tag::consensus_nbx));
223 const std::array<std::vector<int>, 2>& src_dest,
224 std::span<const std::int64_t>
ghosts, std::span<const int>
owners);
242 std::array<std::int64_t, 2>
local_range() const noexcept;
254 std::span<const std::int64_t>
ghosts() const noexcept;
258 MPI_Comm
comm() const;
270 std::span<std::int64_t> global) const;
279 std::span<std::int32_t> local) const;
287 std::span<const
int>
owners() const noexcept {
return _owners; }
299 int tag =
static_cast<int>(dolfinx::MPI::tag::consensus_nbx))
const;
309 std::span<const int>
src() const noexcept;
313 std::span<const
int>
dest() const noexcept;
350 std::array<std::vector<
int>, 2>
rank_type(
int split_type) const;
354 std::array<std::int64_t, 2> _local_range;
357 std::int64_t _size_global;
363 std::vector<std::int64_t> _ghosts;
366 std::vector<
int> _owners;
369 std::vector<
int> _src;
372 std::vector<
int> _dest;
Distribution of a global index range [0, N) across MPI ranks.
Definition IndexMap.h:114
std::vector< std::int32_t > weights_dest() const
Count the caller's owned entries ghosted by each destination rank.
Definition IndexMap.cpp:1465
~IndexMap()=default
Destructor.
std::int32_t num_ghosts() const noexcept
Return the number of ghost indices.
Definition IndexMap.cpp:1040
std::span< const int > dest() const noexcept
Return sorted unique ranks that ghost entries owned by the caller.
Definition IndexMap.cpp:1448
std::vector< std::int32_t > weights_src() const
Count the caller's ghosts owned by each source rank.
Definition IndexMap.cpp:1450
std::pair< std::vector< int >, std::vector< std::int32_t > > index_to_dest_ranks(int tag=static_cast< int >(dolfinx::MPI::tag::consensus_nbx)) const
Compute sharing ranks for each local index.
Definition IndexMap.cpp:1137
std::array< std::int64_t, 2 > local_range() const noexcept
Return the global range of owned indices.
Definition IndexMap.cpp:1035
std::span< const int > owners() const noexcept
Return ranks that own ghost entries.
Definition IndexMap.h:287
std::int32_t size_local() const noexcept
Return the number of owned indices.
Definition IndexMap.cpp:1045
std::int64_t size_global() const noexcept
Return the total number of indices across the communicator.
Definition IndexMap.cpp:1050
IndexMap(IndexMap &&map)=default
Move constructor.
IndexMap & operator=(IndexMap &&map)=default
Move assignment.
std::span< const int > src() const noexcept
Return sorted unique ranks that own the caller's ghosts.
Definition IndexMap.cpp:1446
void local_to_global(std::span< const std::int32_t > local, std::span< std::int64_t > global) const
Compute global indices for local indices.
Definition IndexMap.cpp:1057
void global_to_local(std::span< const std::int64_t > global, std::span< std::int32_t > local) const
Compute local indices for global indices.
Definition IndexMap.cpp:1085
IndexMap(MPI_Comm comm, std::int32_t local_size)
Create a non-overlapping index map.
Definition IndexMap.cpp:974
std::span< const std::int64_t > ghosts() const noexcept
Return global indices of ghosts in local ghost-index order.
Definition IndexMap.cpp:1052
std::vector< std::int32_t > shared_indices() const
Return owned indices ghosted by another rank.
Definition IndexMap.cpp:1372
MPI_Comm comm() const
Return the communicator that the map is defined on.
Definition IndexMap.cpp:1134
std::vector< std::int64_t > global_indices() const
Return global indices for all local entries, including ghosts.
Definition IndexMap.cpp:1122
std::array< std::vector< int >, 2 > rank_type(int split_type) const
Return neighbours in the caller's MPI split-type group.
Definition IndexMap.cpp:1489
MPI support functionality.
Definition MPI.h:36
Miscellaneous classes, functions and types.
Definition dolfinx_common.h:8
std::vector< std::int32_t > compute_owned_indices(std::span< const std::int32_t > indices, const IndexMap &map)
Return selected indices owned by the calling rank.
Definition IndexMap.cpp:716
IndexMapOrder
Control ghost-index ordering in sub-index maps.
Definition IndexMap.h:26
@ any
Allow arbitrary ghost-index ordering.
Definition IndexMap.h:28
@ preserve
Preserve the ordering of ghost indices.
Definition IndexMap.h:27
std::tuple< IndexMap, std::vector< std::int32_t >, bool > create_sub_index_map(const IndexMap &imap, std::span< const std::int32_t > indices, IndexMapOrder order=IndexMapOrder::any)
Create an index map from a subset of an existing map.
Definition IndexMap.cpp:931
std::tuple< std::int64_t, std::vector< std::int32_t >, std::vector< std::vector< std::int64_t > >, std::vector< std::vector< int > > > stack_index_maps(const std::vector< std::pair< std::reference_wrapper< const IndexMap >, int > > &maps)
Compute layout data for a concatenated index map.
Definition IndexMap.cpp:765
Top-level namespace.
Definition defines.h:12