18#ifndef LIBMESH_PETSC_MFFD_MATRIX_H
19#define LIBMESH_PETSC_MFFD_MATRIX_H
21#include "libmesh/libmesh_config.h"
23#ifdef LIBMESH_HAVE_PETSC
25#include "libmesh/petsc_matrix_base.h"
69 virtual void zero()
override;
70 virtual std::unique_ptr<SparseMatrix<T>>
zero_clone()
const override;
71 virtual std::unique_ptr<SparseMatrix<T>>
clone()
const override;
75 const std::vector<numeric_index_type> & rows,
76 const std::vector<numeric_index_type> & cols)
override;
78 const std::vector<numeric_index_type> & dof_indices)
override;
87 std::vector<numeric_index_type> & indices,
88 std::vector<T> & values)
const override;
146std::unique_ptr<SparseMatrix<T>>
153std::unique_ptr<SparseMatrix<T>>
156 libmesh_not_implemented();
176 const std::vector<numeric_index_type> &,
177 const std::vector<numeric_index_type> &)
241 std::vector<numeric_index_type> &,
242 std::vector<T> &)
const
Defines a dense matrix for use in Finite Element-type computations.
Provides a uniform interface to vector storage schemes for different linear algebra libraries.
This class allows to use a PETSc shell matrix as a PetscMatrix.
virtual void zero() override
Set all entries to 0.
virtual Real linfty_norm() const override
virtual SparseMatrix< T > & operator=(const SparseMatrix< T > &) override
This looks like a copy assignment operator, but note that, unlike normal copy assignment operators,...
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.
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 void get_diagonal(NumericVector< T > &dest) const override
Copies the diagonal part of the matrix into dest.
virtual std::unique_ptr< SparseMatrix< T > > zero_clone() 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.
virtual T operator()(const numeric_index_type i, const numeric_index_type j) const override
virtual void add(const T a, const SparseMatrix< T > &X) override
Compute for scalar a, matrix X.
virtual std::unique_ptr< SparseMatrix< T > > clone() const override
virtual void init(const numeric_index_type, const numeric_index_type, const numeric_index_type, const numeric_index_type, const numeric_index_type=30, const numeric_index_type=10, const numeric_index_type=1) override
Initialize SparseMatrix with the specified sizes.
virtual void get_transpose(SparseMatrix< T > &dest) const override
Copies the transpose of the matrix into dest, which may be *this.
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.
PetscMFFDMatrix & operator=(Mat m)
virtual void init(ParallelType=PARALLEL) override
Initialize this matrix using the sparsity structure computed by dof_map.
virtual void add_matrix(const DenseMatrix< T > &dm, const std::vector< numeric_index_type > &dof_indices) override
Same as add_matrix, but assumes the row and column maps are the same.
PetscMFFDMatrix(const Parallel::Communicator &comm_in)
PetscMFFDMatrix(Mat m, const Parallel::Communicator &comm_in)
Constructor.
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.
This class provides a nice interface to the PETSc C-based data structures for parallel,...
virtual numeric_index_type m() const override
The libMesh namespace provides an interface to certain functionality in the library.
ParallelType
Defines an enum for parallel data structure types.
dof_id_type numeric_index_type
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real