KSPMonitorRegister#

Registers a Krylov subspace solver monitor routine that may be accessed with KSPMonitorSetFromOptions()

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

Note#

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#

KSP: Linear System Solvers, KSP, KSPMonitorSet(), KSPMonitorRegisterAll(), KSPMonitorSetFromOptions()

Level#

advanced

Location#

src/ksp/ksp/interface/itcreate.c


Edit on GitLab

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