Advanced Multi-Physics (AMP)
On-Line Documentation
PetscMatrixShellOperator.h
Go to the documentation of this file.
1#ifndef included_AMP_PetscMatrixShellOperator
2#define included_AMP_PetscMatrixShellOperator
3
4#include "AMP/operators/LinearOperator.h"
5#include "AMP/utils/AMP_MPI.h"
6
7
8#ifdef MPICH_SKIP_MPICXX
9 #define _FIX_FOR_PETSC_MPI_CXX
10 #undef MPICH_SKIP_MPICXX
11#endif
12
13#ifdef OMPI_SKIP_MPICXX
14 #define _FIX_FOR_PETSC_OMPI_CXX
15 #undef OMPI_SKIP_MPICXX
16#endif
17
18#include "petscmat.h"
19
20#ifdef _FIX_FOR_PETSC_MPI_CXX
21 #ifndef MPICH_SKIP_MPICXX
22 #define MPICH_SKIP_MPICXX
23 #endif
24#endif
25
26#ifdef _FIX_FOR_PETSC_OMPI_CXX
27 #ifndef OMPI_SKIP_MPICXX
28 #define OMPI_SKIP_MPICXX
29 #endif
30#endif
31
32
33namespace AMP::Operator {
34
35
37{
38public:
39 explicit PetscMatrixShellOperator( std::shared_ptr<const OperatorParameters> params );
40
42
44
46
48
49 void setComm( const AMP_MPI &comm );
50
51 void setOperator( std::shared_ptr<Operator> op );
52
55
56 void reset( std::shared_ptr<const OperatorParameters> params ) override;
57
58 std::shared_ptr<AMP::LinearAlgebra::Variable> getOutputVariable() const override;
59
60 std::shared_ptr<AMP::LinearAlgebra::Variable> getInputVariable() const override;
61
62private:
63 std::shared_ptr<Operator> d_operator;
68};
69} // namespace AMP::Operator
70
71#endif
struct _p_Mat * Mat
int PetscErrorCode
Provides C++ wrapper around MPI routines.
Definition AMP_MPI.h:63
std::shared_ptr< Vector > shared_ptr
Shorthand for shared pointer to Vector.
Definition Vector.h:60
std::shared_ptr< const Vector > const_shared_ptr
Definition Vector.h:65
std::shared_ptr< AMP::Operator::Operator > shared_ptr
Definition Operator.h:29
void reset(std::shared_ptr< const OperatorParameters > params) override
static PetscErrorCode mult(Mat, Vec, Vec)
PetscMatrixShellOperator(std::shared_ptr< const OperatorParameters > params)
void setComm(const AMP_MPI &comm)
std::shared_ptr< AMP::LinearAlgebra::Variable > getOutputVariable() const override
Return the output variable.
std::shared_ptr< AMP::LinearAlgebra::Variable > getInputVariable() const override
Return the input variable.
void setOperator(std::shared_ptr< Operator > op)
void apply(AMP::LinearAlgebra::Vector::const_shared_ptr u, AMP::LinearAlgebra::Vector::shared_ptr f) override
PETSc vector.



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:41.
Comments on this page