DOLFINx
0.1.0
DOLFINx C++ interface
|
9 #include <dolfinx/common/MPI.h>
13 #include <xtl/xspan.hpp>
42 const std::array<std::shared_ptr<const common::IndexMap>, 2>& maps,
43 const std::array<int, 2>& bs);
57 const std::vector<std::vector<const SparsityPattern*>>& patterns,
60 std::pair<std::reference_wrapper<const common::IndexMap>,
int>>,
62 const std::array<std::vector<int>, 2>& bs);
80 std::shared_ptr<const common::IndexMap>
index_map(
int dim)
const;
94 void insert(
const xtl::span<const std::int32_t>& rows,
95 const xtl::span<const std::int32_t>& cols);
124 std::array<std::shared_ptr<const common::IndexMap>, 2> _index_maps;
125 std::array<int, 2> _bs;
128 std::vector<std::int64_t> _col_ghosts;
131 std::vector<std::vector<std::int32_t>> _cache_owned;
132 std::vector<std::vector<std::int32_t>> _cache_unowned;
135 std::shared_ptr<graph::AdjacencyList<std::int32_t>> _diagonal;
136 std::shared_ptr<graph::AdjacencyList<std::int32_t>> _off_diagonal;
void insert_diagonal(const std::vector< std::int32_t > &rows)
Insert non-zero locations on the diagonal.
Definition: SparsityPattern.cpp:201
This class provides a sparsity pattern data structure that can be used to initialize sparse matrices.
Definition: SparsityPattern.h:35
MPI_Comm mpi_comm() const
Return MPI communicator.
Definition: SparsityPattern.cpp:416
This class provides a static adjacency list data structure. It is commonly used to store directed gra...
Definition: AdjacencyList.h:46
void insert(const xtl::span< const std::int32_t > &rows, const xtl::span< const std::int32_t > &cols)
Insert non-zero locations using local (process-wise) indices.
Definition: SparsityPattern.cpp:170
~SparsityPattern()=default
Destructor.
void assemble()
Finalize sparsity pattern and communicate off-process entries.
Definition: SparsityPattern.cpp:227
const graph::AdjacencyList< std::int32_t > & diagonal_pattern() const
Sparsity pattern for the owned (diagonal) block. Uses local indices for the columns.
Definition: SparsityPattern.cpp:401
A duplicate MPI communicator and manage lifetime of the communicator.
Definition: MPI.h:35
SparsityPattern & operator=(SparsityPattern &&pattern)=default
Move assignment.
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:151
std::vector< std::int64_t > column_indices() const
Global indices of non-zero columns on owned rows.
Definition: SparsityPattern.cpp:156
std::int64_t num_nonzeros() const
Return number of local nonzeros.
Definition: SparsityPattern.cpp:392
int block_size(int dim) const
Return index map block size for dimension dim.
Definition: SparsityPattern.cpp:168
SparsityPattern(MPI_Comm comm, const std::array< std::shared_ptr< const common::IndexMap >, 2 > &maps, const std::array< int, 2 > &bs)
Create an empty sparsity pattern with specified dimensions.
Definition: SparsityPattern.cpp:20
const graph::AdjacencyList< std::int32_t > & off_diagonal_pattern() const
Sparsity pattern for the un-owned (off-diagonal) columns. Uses local indices for the columns....
Definition: SparsityPattern.cpp:409