10#include <Eigen/SparseCore>
23 [[nodiscard]]
Index rows() const noexcept {
return rows_; }
24 [[nodiscard]]
Index cols() const noexcept {
return cols_; }
25 [[nodiscard]] std::size_t
num_triplets() const noexcept {
return triplets_.size(); }
26 void reserve(std::size_t triplets) { triplets_.reserve(triplets); }
41 std::vector<Eigen::Triplet<Complex, Index>> triplets_;
Definition sparse_assembler.hpp:19
void reserve(std::size_t triplets)
Definition sparse_assembler.hpp:26
Index cols() const noexcept
Definition sparse_assembler.hpp:24
SparseAssembler(Index rows, Index cols)
Index rows() const noexcept
Definition sparse_assembler.hpp:23
void append(const SparseAssembler &other)
Appends the triplets of another assembler of the same size (per-thread buffers).
void add(Index row, Index col, Complex value)
Adds one entry.
void add(std::span< const Index > rows, std::span< const Index > cols, const Matrix &local)
Adds local(i, j) to the global entry (rows[i], cols[j]); sizes must match.
SparseMatrix finalize() const
Compressed matrix with all contributions summed.
std::size_t num_triplets() const noexcept
Definition sparse_assembler.hpp:25
Definition axisymmetric_forms.hpp:30
Vector gather(const Vector &global, std::span< const Index > dofs)
Gathers global at the positions dofs into a dense vector.
void scatter(Vector &global, std::span< const Index > dofs, const Vector &local)
Adds the element vector local to global at the positions dofs.
Eigen::Matrix< Complex, Eigen::Dynamic, Eigen::Dynamic > Matrix
Definition types.hpp:22
Eigen::SparseMatrix< Complex, Eigen::RowMajor, Index > SparseMatrix
Definition types.hpp:24
std::int64_t Index
global indices (DoFs, entities)
Definition types.hpp:17
Eigen::Matrix< Complex, Eigen::Dynamic, 1 > Vector
Definition types.hpp:20
std::complex< double > Complex
Definition types.hpp:16