Advanced Multi-Physics (AMP)
On-Line Documentation
PetscMonitor.h
Go to the documentation of this file.
1#ifndef included_AMP_PetscMonitor
2#define included_AMP_PetscMonitor
3
4#include "AMP/utils/AMP_MPI.h"
5
6
7// Forward declare a few types for PETSc
8typedef int PetscErrorCode;
9typedef struct _p_SNES *SNES;
10typedef struct _p_KSP *KSP;
11
12#include "petscsystypes.h"
13
14namespace AMP {
15
16
26{
27public:
33 explicit PetscMonitor( AMP::AMP_MPI comm );
34
37
39 static PetscErrorCode monitorKSP( KSP, PetscInt, PetscReal, void * );
40
42 static PetscErrorCode monitorSNES( SNES, PetscInt, PetscReal, void * );
43
45 // static PetscErrorCode (*)(void**) getKSPMonitorDelete();
46
48 // static PetscErrorCode (*)(void**) getSNESMonitorDelete();
49
50 // Function to remove the monitor options from the options
51 static std::string removeMonitor( std::string options );
52
53private:
55
57
58 void printKSPStatus( KSP ksp, PetscInt iteration, PetscReal L2norm );
59 void printSNESStatus( SNES snes, PetscInt iteration, PetscReal L2norm );
60};
61} // namespace AMP
62
63#endif
struct _p_SNES * SNES
struct _p_KSP * KSP
int PetscErrorCode
struct _p_SNES * SNES
Definition PetscMonitor.h:9
struct _p_KSP * KSP
int PetscErrorCode
Definition PetscMonitor.h:8
Provides C++ wrapper around MPI routines.
Definition AMP_MPI.h:63
Provide a monitor that petsc can use instead of the default.
void printSNESStatus(SNES snes, PetscInt iteration, PetscReal L2norm)
static std::string removeMonitor(std::string options)
Routine to pass to petsc for monitoring KSP delete.
~PetscMonitor()
Empty deconstructor.
static PetscErrorCode monitorSNES(SNES, PetscInt, PetscReal, void *)
Routine to pass to petsc for monitoring SNES.
AMP::AMP_MPI d_comm
void printKSPStatus(KSP ksp, PetscInt iteration, PetscReal L2norm)
static PetscErrorCode monitorKSP(KSP, PetscInt, PetscReal, void *)
Routine to pass to petsc for monitoring KSP.
PetscMonitor(AMP::AMP_MPI comm)
Default constructor.



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