PetscMatrix is a bridge between AMP::LinearAlgebra::Matrix and the PETSc Vec data structure. More...
#include <PetscMatrix.h>
Public Member Functions | |
| std::shared_ptr< Matrix > | getManagedMat () |
| std::shared_ptr< const Matrix > | getManagedMat () const |
| Mat & | getMat () |
| Obtain PETSc Mat for use in PETSc routines. | |
| const Mat & | getMat () const |
| Obtain PETSc Mat for use in PETSc routines. | |
| Mat & | getNativeMat () |
| const Mat & | getNativeMat () const |
| virtual | ~PetscMatrix () |
| Destructor. | |
Static Public Member Functions | |
| static std::shared_ptr< const PetscMatrix > | constView (std::shared_ptr< const Matrix > AmpMatrix) |
| If needed, create a PETSc wrapper for AmpMatrix. Otherwise, return AmpMatrix. | |
| static std::shared_ptr< PetscMatrix > | view (std::shared_ptr< Matrix > AmpMatrix) |
| If needed, create a PETSc wrapper for AmpMatrix. Otherwise, return AmpMatrix. | |
Protected Member Functions | |
| PetscMatrix () | |
| Empty constructor. | |
| PetscMatrix (std::shared_ptr< Matrix > mat) | |
| Default constructor. | |
Protected Attributes | |
| Mat | d_Mat |
| std::shared_ptr< Matrix > | d_matrix |
PetscMatrix is a bridge between AMP::LinearAlgebra::Matrix and the PETSc Vec data structure.
A PetscMatrix has a Mat data structure. Given an AMP::LinearAlgebra::Matrix, this class can create a PETSc view without copying the data. As such, this class serves three purposes:
Definition at line 26 of file PetscMatrix.h.
|
virtual |
Destructor.
|
protected |
Empty constructor.
|
explicitprotected |
Default constructor.
|
static |
If needed, create a PETSc wrapper for AmpMatrix. Otherwise, return AmpMatrix.
The function attempts to return a view with the least amount of work. It will never copy data. If the matrix cannot be wrapped it wll return an error.
| AmpMatrix | a shared pointer to a Matrix |
|
inline |
Definition at line 72 of file PetscMatrix.h.
References d_matrix.
|
inline |
Definition at line 73 of file PetscMatrix.h.
References d_matrix.
|
inline |
Obtain PETSc Mat for use in PETSc routines.
This function is used to get a PETSc matrix. The following idiom should be used since it fails gracefully. In this function, a view may be created before the Mat is extracted
Definition at line 41 of file PetscMatrix.h.
References d_Mat.
|
inline |
Obtain PETSc Mat for use in PETSc routines.
This function is used to get a PETSc matrix. The following idiom should be used since it fails gracefully. In this function, a view may be created before the Mat is extracted
Definition at line 50 of file PetscMatrix.h.
References d_Mat.
|
inline |
Definition at line 70 of file PetscMatrix.h.
References d_Mat.
|
inline |
Definition at line 71 of file PetscMatrix.h.
References d_Mat.
|
static |
If needed, create a PETSc wrapper for AmpMatrix. Otherwise, return AmpMatrix.
The function attempts to return a view with the least amount of work. It will never copy data. If the matrix cannot be wrapped it wll return an error.
| AmpMatrix | a shared pointer to a Matrix |
Referenced by AMP::LinearAlgebra::PETScInterfaceLeftVectorFactory::getVector(), and AMP::LinearAlgebra::PETScInterfaceRightVectorFactory::getVector().
|
protected |
Definition at line 84 of file PetscMatrix.h.
Referenced by getMat(), getMat(), getNativeMat(), and getNativeMat().
|
protected |
Definition at line 85 of file PetscMatrix.h.
Referenced by getManagedMat(), and getManagedMat().
|
Advanced Multi-Physics (AMP) Oak Ridge National Laboratory Idaho National Laboratory Los Alamos National Laboratory |
This page automatically produced from the source code by Last updated: Tue Mar 10 2026 13:06:43. Comments on this page |