2#ifndef included_AMP_Petsc_Matrix
3#define included_AMP_Petsc_Matrix
6#include "AMP/matrices/petsc/PetscMatrix.h"
18 void multiply( std::shared_ptr<Matrix>
other_op, std::shared_ptr<Matrix> &result )
override;
37 virtual std::string
type()
const override {
return "NativePetscMatrix"; }
46 void copy( std::shared_ptr<const Matrix>
X )
override;
53 std::shared_ptr<Matrix>
clone()
const override;
An abstract interface for using and manipulating matrices.
std::shared_ptr< Matrix > shared_ptr
Convenience typedef.
This is a thin wrapper around PETSc Mat.
Vector::shared_ptr createInputVector() const override
Get a right vector ( For , is a right vector )
void copyFromMat(Mat m)
Copy data from a PETSc Mat.
virtual std::string type() const override
Return the type of the matrix.
Vector::shared_ptr extractDiagonal(Vector::shared_ptr p=Vector::shared_ptr()) const override
Extract the diagonal from a matrix.
std::shared_ptr< Discretization::DOFManager > getLeftDOFManager() const override
Get the DOFManager associated with a left vector. For , is a left vector.
std::shared_ptr< Discretization::DOFManager > getRightDOFManager() const override
Get the DOFManager associated with a right vector. For , is a right vector.
std::shared_ptr< Matrix > clone() const override
Return a matrix with the same non-zero and distributed structure.
NativePetscMatrix(std::shared_ptr< MatrixData > data)
void multiply(std::shared_ptr< Matrix > other_op, std::shared_ptr< Matrix > &result) override
void copy(std::shared_ptr< const Matrix > X) override
Set this matrix with the same non-zero and distributed structure as x and copy the coefficients.
NativePetscMatrix(Mat m, bool dele=false)
Construct a matrix from a PETSc Mat.
virtual ~NativePetscMatrix()
Destructor.
NativePetscMatrix(std::shared_ptr< MatrixParametersBase > params)
static std::shared_ptr< Matrix > duplicateMat(Mat m)
Create a NativePetscMatrix with the same non-zero structure.
Vector::shared_ptr createOutputVector() const override
Get a left vector ( For , is a left vector )
std::shared_ptr< Vector > shared_ptr
Shorthand for shared pointer to Vector.