KSPMonitor — PETSc 3.25.0 documentation

Skip to main content
`Ctrl`+`K`

# KSPMonitor

runs the user provided monitor routines, if they exist

## Synopsis

    #include "petscksp.h"
    #include "petscmat.h"
    PetscErrorCode KSPMonitor(KSP ksp, PetscInt it, PetscReal rnorm)

Collective

## Input Parameters

- ksp - iterative solver obtained from `KSPCreate()`

- it - iteration number

- rnorm - relative norm of the residual

## Notes

This routine is called by the `KSP` implementations. It does not typically need to be called by the user.

For Krylov methods that do not keep a running value of the current solution (such as `KSPGMRES`) this cannot be called after the `KSPConvergedReason` has been set but before the final solution has been computed.

## See Also

KSP: Linear System Solvers, `KSPMonitorSet()`

## Level

developer

## Location

src/ksp/ksp/interface/itfunc.c

## Implementations

KSPMonitor_FETIDP() in src/ksp/ksp/impls/fetidp/fetidp.c

Index of all KSP routines
Table of Contents for all manual pages
Index of all manual pages