18 #ifndef LIBMESH_DIAGONAL_MATRIX_H 19 #define LIBMESH_DIAGONAL_MATRIX_H 21 #include "libmesh/id_types.h" 22 #include "libmesh/sparse_matrix.h" 77 libmesh_not_implemented();
120 virtual void clear()
override;
122 virtual void zero()
override;
124 virtual std::unique_ptr<SparseMatrix<T>>
zero_clone ()
const override;
126 virtual std::unique_ptr<SparseMatrix<T>>
clone ()
const override;
128 virtual void close()
override;
148 const std::vector<numeric_index_type> & rows,
149 const std::vector<numeric_index_type> & cols)
override;
153 const std::vector<numeric_index_type> & dof_indices)
override;
163 virtual bool closed()
const override;
172 std::vector<numeric_index_type> & indices,
173 std::vector<T> & values)
const override;
175 virtual void zero_rows(std::vector<numeric_index_type> & rows, T val = 0)
override;
187 #endif // LIBMESH_DIAGONAL_MATRIX_H virtual SparseMatrix< T > & operator=(const SparseMatrix< T > &) override
This looks like a copy assignment operator, but note that, unlike normal copy assignment operators...
virtual numeric_index_type col_stop() const override
virtual void get_transpose(SparseMatrix< T > &dest) const override
Copies the transpose of the matrix into dest, which may be *this.
virtual SolverPackage solver_package() override
virtual void get_row(numeric_index_type i, std::vector< numeric_index_type > &indices, std::vector< T > &values) const override
Get a row from the matrix.
const NumericVector< T > & diagonal() const
virtual numeric_index_type col_start() const override
Provides a uniform interface to vector storage schemes for different linear algebra libraries...
const Parallel::Communicator & comm() const
virtual Real l1_norm() const override
virtual void add_matrix(const DenseMatrix< T > &dm, const std::vector< numeric_index_type > &rows, const std::vector< numeric_index_type > &cols) override
Add the full matrix dm to the SparseMatrix.
The libMesh namespace provides an interface to certain functionality in the library.
virtual void restore_original_nonzero_pattern() override
Reset the memory storage of the matrix.
virtual void zero() override
Set all entries to 0.
virtual bool closed() const override
virtual numeric_index_type n() const override
virtual numeric_index_type m() const override
virtual void close() override
Calls the SparseMatrix's internal assembly routines, ensuring that the values are consistent across p...
dof_id_type numeric_index_type
virtual numeric_index_type row_stop() const override
virtual ~DiagonalMatrix()=default
This class does not manually manage any memory, so the destructor can be safely defaulted.
virtual void clear() override
Restores the SparseMatrix<T> to a pristine state.
DiagonalMatrix(const Parallel::Communicator &comm)
Constructor; initializes the matrix to be empty, without any structure, i.e.
virtual T operator()(const numeric_index_type i, const numeric_index_type j) const override
Diagonal matrix class whose underlying storage is a vector.
virtual void print_personal(std::ostream &os=libMesh::out) const override
Print the contents of the matrix to the screen in a package-personalized style, if available...
virtual void zero_rows(std::vector< numeric_index_type > &rows, T val=0) override
Sets all row entries to 0 then puts diag_value in the diagonal entry.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual void get_diagonal(NumericVector< T > &dest) const override
Copies the diagonal part of the matrix into dest.
virtual Real linfty_norm() const override
DiagonalMatrix & operator=(DiagonalMatrix &&)=default
virtual std::unique_ptr< SparseMatrix< T > > clone() const override
virtual numeric_index_type row_start() const override
std::unique_ptr< NumericVector< T > > _diagonal
Underlying diagonal matrix storage.
virtual void init(const numeric_index_type m, const numeric_index_type n, const numeric_index_type m_l, const numeric_index_type n_l, const numeric_index_type nnz=30, const numeric_index_type noz=10, const numeric_index_type blocksize=1) override
Initialize SparseMatrix with the specified sizes.
SolverPackage
Defines an enum for various linear solver packages.
Defines a dense matrix for use in Finite Element-type computations.
virtual void add(const numeric_index_type i, const numeric_index_type j, const T value) override
Add value to the element (i,j).
virtual std::unique_ptr< SparseMatrix< T > > zero_clone() const override
ParallelType
Defines an enum for parallel data structure types.