Go to the documentation of this file.
20 #ifndef LIBMESH_EIGEN_SPARSE_MATRIX_H
21 #define LIBMESH_EIGEN_SPARSE_MATRIX_H
23 #include "libmesh/libmesh_config.h"
25 #ifdef LIBMESH_HAVE_EIGEN
28 #include "libmesh/sparse_matrix.h"
29 #include "libmesh/eigen_core_support.h"
41 template <
typename T>
class DenseMatrix;
94 virtual void init ()
override;
96 virtual void clear ()
override;
98 virtual void zero ()
override;
112 const T
value)
override;
116 const T
value)
override;
119 const std::vector<numeric_index_type> & rows,
120 const std::vector<numeric_index_type> & cols)
override;
123 const std::vector<numeric_index_type> & dof_indices)
override;
163 #endif // #ifdef LIBMESH_HAVE_EIGEN
164 #endif // #ifdef LIBMESH_EIGEN_SPARSE_MATRIX_H
Eigen::Triplet< T, eigen_idx_type > TripletType
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.
The EigenSparseMatrix class wraps a sparse matrix object from the Eigen library.
The libMesh namespace provides an interface to certain functionality in the library.
virtual bool closed() const override
virtual void set(const numeric_index_type i, const numeric_index_type j, const T value) override
Set the element (i,j) to value.
const Parallel::Communicator & comm() const
Defines a dense matrix for use in Finite Element-type computations.
virtual void zero() override
Set all entries to 0.
virtual ~EigenSparseMatrix()=default
virtual void close() override
Calls the SparseMatrix's internal assembly routines, ensuring that the values are consistent across p...
Provides a uniform interface to vector storage schemes for different linear algebra libraries.
Eigen::SparseMatrix< Number, Eigen::RowMajor, eigen_idx_type > EigenSM
This class provides a nice interface to the Eigen C++-based data structures for serial vectors.
bool _closed
Flag indicating if the matrix has been closed yet.
EigenSparseMatrix(const Parallel::Communicator &comm)
Constructor; initializes the matrix to be empty, without any structure, i.e.
virtual void get_diagonal(NumericVector< T > &dest) const override
Copies the diagonal part of the matrix into dest.
EigenSM DataType
Convenient typedefs.
dof_id_type numeric_index_type
virtual void init() override
Initialize this matrix using the sparsity structure computed by dof_map.
EigenSparseMatrix & operator=(const EigenSparseMatrix &)=default
virtual Real linfty_norm() const override
DataType _mat
Actual Eigen::SparseMatrix<> we are wrapping.
virtual void get_transpose(SparseMatrix< T > &dest) const override
Copies the transpose of the matrix into dest, which may be *this.
virtual numeric_index_type n() const override
This class provides an interface to Eigen iterative solvers that is compatible with the libMesh Linea...
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 T operator()(const numeric_index_type i, const numeric_index_type j) const override
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void print(std::ostream &os=libMesh::out, const bool sparse=false) const
Print the contents of the matrix to the screen in a uniform style, regardless of matrix/solver packag...
virtual numeric_index_type row_stop() 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.
virtual Real l1_norm() const override
virtual numeric_index_type m() const override
virtual void clear() override
Restores the SparseMatrix<T> to a pristine state.
virtual numeric_index_type row_start() const override