Advanced Multi-Physics (AMP)
On-Line Documentation
NativePetscMatrix.h
Go to the documentation of this file.
1
2#ifndef included_AMP_Petsc_Matrix
3#define included_AMP_Petsc_Matrix
4
5// AMP files
6#include "AMP/matrices/petsc/PetscMatrix.h"
7
8namespace AMP::LinearAlgebra {
9
16{
17protected:
18 void multiply( std::shared_ptr<Matrix> other_op, std::shared_ptr<Matrix> &result ) override;
19
20public:
22 NativePetscMatrix( std::shared_ptr<MatrixParametersBase> params );
23
28 explicit NativePetscMatrix( Mat m, bool dele = false );
29
30 explicit NativePetscMatrix( std::shared_ptr<MatrixData> data );
31
35
37 virtual std::string type() const override { return "NativePetscMatrix"; }
38
44 static std::shared_ptr<Matrix> duplicateMat( Mat m );
45
46 void copy( std::shared_ptr<const Matrix> X ) override;
47
51 void copyFromMat( Mat m );
52
53 std::shared_ptr<Matrix> clone() const override;
54
57 std::shared_ptr<Discretization::DOFManager> getRightDOFManager() const override;
58 std::shared_ptr<Discretization::DOFManager> getLeftDOFManager() const override;
59
62
63private:
64};
65
66
67} // namespace AMP::LinearAlgebra
68
69
70#endif
#define X(C)
struct _p_Mat * Mat
An abstract interface for using and manipulating matrices.
Definition Matrix.h:30
std::shared_ptr< Matrix > shared_ptr
Convenience typedef.
Definition Matrix.h:33
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.
Definition Vector.h:60



Advanced Multi-Physics (AMP)
Oak Ridge National Laboratory
Idaho National Laboratory
Los Alamos National Laboratory
This page automatically produced from the
source code by doxygen
Last updated: Tue Mar 10 2026 13:06:40.
Comments on this page