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"
86 virtual void zero()
override;
87 virtual std::unique_ptr<SparseMatrix<T>>
zero_clone()
const override;
88 virtual std::unique_ptr<SparseMatrix<T>>
clone()
const override;
92 const std::vector<numeric_index_type> & rows,
93 const std::vector<numeric_index_type> & cols)
override;
95 const std::vector<numeric_index_type> & dof_indices)
override;
104 std::vector<numeric_index_type> & indices,
105 std::vector<T> & values)
const override;
128 this->_is_initialized =
true;
129 this->_destroy_mat_on_exit =
false;
138 this->assign(m,
false);
177std::unique_ptr<SparseMatrix<T>>
184std::unique_ptr<SparseMatrix<T>>
187 libmesh_not_implemented();
207 const std::vector<numeric_index_type> &,
208 const std::vector<numeric_index_type> &)
272 std::vector<numeric_index_type> &,
273 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 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 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.
void assign(Mat m, bool set_context)
Adopt an existing, externally-owned Mat, without destroying it when this object goes out of scope.
PetscMFFDMatrix & operator=(Mat m)
Calls assign with set_context equal to false as generally speaking an MFFD matrix will have been crea...
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,...
void set_context()
Set the context (ourself) for _mat.
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