Advanced Multi-Physics (AMP)
On-Line Documentation
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
AMP::PetscMonitor Class Reference

Provide a monitor that petsc can use instead of the default. More...

#include <PetscMonitor.h>

Public Member Functions

 PetscMonitor (AMP::AMP_MPI comm)
 Default constructor.
 
 ~PetscMonitor ()
 Empty deconstructor.
 

Static Public Member Functions

static PetscErrorCode monitorKSP (KSP, PetscInt, PetscReal, void *)
 Routine to pass to petsc for monitoring KSP.
 
static PetscErrorCode monitorSNES (SNES, PetscInt, PetscReal, void *)
 Routine to pass to petsc for monitoring SNES.
 
static std::string removeMonitor (std::string options)
 Routine to pass to petsc for monitoring KSP delete.
 

Private Member Functions

 PetscMonitor ()
 
void printKSPStatus (KSP ksp, PetscInt iteration, PetscReal L2norm)
 
void printSNESStatus (SNES snes, PetscInt iteration, PetscReal L2norm)
 

Private Attributes

AMP::AMP_MPI d_comm
 

Detailed Description

Provide a monitor that petsc can use instead of the default.

This class provides routines for convergenece monitoring. The default convergence monitoring by petsc does not properly cleanup until PetscFinialize and creates problems when used on sub-communicators.

Definition at line 25 of file PetscMonitor.h.

Constructor & Destructor Documentation

◆ PetscMonitor() [1/2]

AMP::PetscMonitor::PetscMonitor ( AMP::AMP_MPI  comm)
explicit

Default constructor.

This is the default constructor that should be used

Parameters
commCommunicator to use for the monitor

◆ ~PetscMonitor()

AMP::PetscMonitor::~PetscMonitor ( )

Empty deconstructor.

◆ PetscMonitor() [2/2]

AMP::PetscMonitor::PetscMonitor ( )
private

Member Function Documentation

◆ monitorKSP()

static PetscErrorCode AMP::PetscMonitor::monitorKSP ( KSP  ,
PetscInt  ,
PetscReal  ,
void *   
)
static

Routine to pass to petsc for monitoring KSP.

◆ monitorSNES()

static PetscErrorCode AMP::PetscMonitor::monitorSNES ( SNES  ,
PetscInt  ,
PetscReal  ,
void *   
)
static

Routine to pass to petsc for monitoring SNES.

◆ printKSPStatus()

void AMP::PetscMonitor::printKSPStatus ( KSP  ksp,
PetscInt  iteration,
PetscReal  L2norm 
)
private

◆ printSNESStatus()

void AMP::PetscMonitor::printSNESStatus ( SNES  snes,
PetscInt  iteration,
PetscReal  L2norm 
)
private

◆ removeMonitor()

static std::string AMP::PetscMonitor::removeMonitor ( std::string  options)
static

Routine to pass to petsc for monitoring KSP delete.

Routine to pass to petsc for monitoring SNES delete

Member Data Documentation

◆ d_comm

AMP::AMP_MPI AMP::PetscMonitor::d_comm
private

Definition at line 56 of file PetscMonitor.h.


The documentation for this class was generated from the following file:



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