PETSc version 3.17.4
Fix/Edit manual page

# KSPMonitorRegister

Adds Krylov subspace solver monitor routine.

### Synopsis

    #include "petscksp.h"
    PetscErrorCode KSPMonitorRegister(const char name[], PetscViewerType vtype, PetscViewerFormat format,
                                      PetscErrorCode (*monitor)(KSP, PetscInt, PetscReal, PetscViewerAndFormat *),
                                      PetscErrorCode (*create)(PetscViewer, PetscViewerFormat, void *, PetscViewerAndFormat **),
                                      PetscErrorCode (*destroy)(PetscViewerAndFormat **))

Not Collective

### Input Parameters

| name | - name of a new monitor routine
| vtype | - A PetscViewerType for the output
| format | - A PetscViewerFormat for the output
| monitor | - Monitor routine
| create | - Creation routine, or NULL
| destroy | - Destruction routine, or NULL

### Notes

KSPMonitorRegister() may be called multiple times to add several user-defined monitors.

### Sample usage

      KSPMonitorRegister("my_monitor",PETSCVIEWERASCII,PETSC_VIEWER_ASCII_INFO_DETAIL,MyMonitor,NULL,NULL);

Then, your monitor can be chosen with the procedural interface via

        KSPMonitorSetFromOptions(ksp,"-ksp_monitor_my_monitor","my_monitor",NULL)

or at runtime via the option

        -ksp_monitor_my_monitor

### See Also

KSPMonitorRegisterAll()

### Level

advanced

### Location

src/ksp/ksp/interface/itcreate.c
Index of all KSP routines
Table of Contents for all manual pages
Index of all manual pages