20 #ifndef LIBMESH_LASPACK_MATRIX_H 21 #define LIBMESH_LASPACK_MATRIX_H 23 #include "libmesh/libmesh_config.h" 25 #ifdef LIBMESH_HAVE_LASPACK 28 #include "libmesh/sparse_matrix.h" 41 template <
typename T>
class DenseMatrix;
106 virtual void clear ()
override;
108 virtual void zero ()
override;
110 virtual std::unique_ptr<SparseMatrix<T>>
zero_clone ()
const override;
112 virtual std::unique_ptr<SparseMatrix<T>>
clone ()
const override;
114 virtual void close ()
override;
130 const T
value)
override;
134 const T
value)
override;
137 const std::vector<numeric_index_type> & rows,
138 const std::vector<numeric_index_type> & cols)
override;
141 const std::vector<numeric_index_type> & dof_indices)
override;
168 std::vector<numeric_index_type> & indices,
169 std::vector<T> & values)
const override;
188 std::vector<numeric_index_type>
_csr;
194 std::vector<std::vector<numeric_index_type>::const_iterator>
_row_start;
210 #endif // #ifdef LIBMESH_HAVE_LASPACK 211 #endif // #ifdef LIBMESH_LASPACK_MATRIX_H 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.
virtual std::unique_ptr< SparseMatrix< T > > zero_clone() const override
virtual void get_diagonal(NumericVector< T > &dest) const override
Copies the diagonal part of the matrix into dest.
virtual numeric_index_type col_start() const override
virtual Real linfty_norm() const override
std::vector< numeric_index_type > _csr
The compressed row indices.
virtual bool need_full_sparsity_pattern() const override
The LaspackMatrix needs the full sparsity pattern.
Provides a uniform interface to vector storage schemes for different linear algebra libraries...
const Parallel::Communicator & comm() const
QMatrix _QMat
The Laspack sparse matrix pointer.
The libMesh namespace provides an interface to certain functionality in the library.
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 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 > > clone() const override
This class provides an interface to Laspack iterative solvers that is compatible with the libMesh Lin...
numeric_index_type pos(const numeric_index_type i, const numeric_index_type j) const
virtual void get_transpose(SparseMatrix< T > &dest) const override
Copies the transpose of the matrix into dest, which may be *this.
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 Real l1_norm() const override
virtual T operator()(const numeric_index_type i, const numeric_index_type j) const override
virtual numeric_index_type row_start() const override
virtual void zero() override
Set all entries to 0.
virtual bool closed() const override
virtual void clear() override
Restores the SparseMatrix<T> to a pristine state.
This class provides a nice interface to the Laspack C-based data structures for serial vectors...
std::vector< std::vector< numeric_index_type >::const_iterator > _row_start
The start of each row in the compressed row index data structure.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual numeric_index_type m() const override
virtual numeric_index_type n() const override
bool _closed
Flag indicating if the matrix has been closed yet.
virtual void update_sparsity_pattern(const SparsityPattern::Graph &) override
Updates the matrix sparsity pattern.
virtual numeric_index_type row_stop() const override
The LaspackMatrix class wraps a QMatrix object from the Laspack library.
Defines a dense matrix for use in Finite Element-type computations.
LaspackMatrix & operator=(const LaspackMatrix &)=delete
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 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.
virtual numeric_index_type col_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.
LaspackMatrix(const Parallel::Communicator &comm)
Constructor; initializes the matrix to be empty, without any structure, i.e.
ParallelType
Defines an enum for parallel data structure types.