9#include <dolfinx/common/MPI.h>
34 std::array<std::shared_ptr<const common::IndexMap>, 2> maps,
35 std::array<int, 2> bs);
49 const std::vector<std::vector<const SparsityPattern*>>& patterns,
52 std::pair<std::reference_wrapper<const common::IndexMap>,
int>>,
54 const std::array<std::vector<int>, 2>& bs);
71 void insert(std::int32_t row, std::int32_t col);
82 void insert(std::span<const std::int32_t> rows,
83 std::span<const std::int32_t> cols);
98 std::shared_ptr<const common::IndexMap>
index_map(
int dim)
const;
126 std::int32_t
nnz_diag(std::int32_t row)
const;
139 std::pair<std::span<const std::int32_t>, std::span<const std::int64_t>>
148 MPI_Comm
comm()
const;
155 std::array<std::shared_ptr<const common::IndexMap>, 2> _index_maps;
158 std::array<int, 2> _bs;
161 std::vector<std::int64_t> _col_ghosts;
164 std::vector<std::int32_t> _col_ghost_owners;
167 std::vector<std::vector<std::int32_t>> _row_cache;
172 std::vector<std::int32_t> _edges;
173 std::vector<std::int64_t> _offsets;
176 std::vector<std::int32_t> _off_diagonal_offsets;
A duplicate MPI communicator and manage lifetime of the communicator.
Definition MPI.h:42
SparsityPattern(SparsityPattern &&pattern)=default
Move constructor.
std::shared_ptr< const common::IndexMap > index_map(int dim) const
Index map for given dimension dimension. Returns the index map for rows and columns that will be set ...
Definition SparsityPattern.cpp:212
std::int32_t nnz_off_diag(std::int32_t row) const
Number of non-zeros in unowned columns (off-diagonal block) on a given row.
Definition SparsityPattern.cpp:421
void finalize()
Finalize sparsity pattern and communicate off-process entries.
Definition SparsityPattern.cpp:244
int block_size(int dim) const
Return index map block size for dimension dim.
Definition SparsityPattern.cpp:242
std::int32_t nnz_diag(std::int32_t row) const
Number of non-zeros in owned columns (diagonal block) on a given row.
Definition SparsityPattern.cpp:414
void insert(std::int32_t row, std::int32_t col)
Insert non-zero locations using local (process-wise) indices.
Definition SparsityPattern.cpp:142
void insert_diagonal(std::span< const std::int32_t > rows)
Insert non-zero locations on the diagonal.
Definition SparsityPattern.cpp:187
std::int64_t num_nonzeros() const
Number of nonzeros on this rank after assembly, including ghost rows.
Definition SparsityPattern.cpp:407
std::span< const std::int32_t > off_diagonal_offsets() const
Row-wise start of off-diagonals (unowned columns) for each row.
Definition SparsityPattern.cpp:436
std::vector< std::int64_t > column_indices() const
Global indices of non-zero columns on owned rows.
Definition SparsityPattern.cpp:217
common::IndexMap column_index_map() const
Builds the index map for columns after assembly of the sparsity pattern.
Definition SparsityPattern.cpp:231
SparsityPattern(MPI_Comm comm, std::array< std::shared_ptr< const common::IndexMap >, 2 > maps, std::array< int, 2 > bs)
Create an empty sparsity pattern with specified dimensions.
Definition SparsityPattern.cpp:19
MPI_Comm comm() const
Return MPI communicator.
Definition SparsityPattern.cpp:443
SparsityPattern & operator=(SparsityPattern &&pattern)=default
Move assignment.
~SparsityPattern()=default
Destructor.
std::pair< std::span< const std::int32_t >, std::span< const std::int64_t > > graph() const
Sparsity pattern graph after assembly. Uses local indices for the columns.
Definition SparsityPattern.cpp:429
Miscellaneous classes, functions and types.
Definition dolfinx_common.h:8
Linear algebra interface.
Definition sparsitybuild.h:15