QPSMonitorSet

Sets an ADDITIONAL function to be called at every iteration to monitor the residual/error etc.

Synopsis

PetscErrorCode  QPSMonitorSet(QPS qps,PetscErrorCode (*monitor)(QPS,PetscInt,PetscReal,void*),void *mctx,PetscErrorCode (*monitordestroy)(void**))
Logically Collective on QPS

Input Parameters

qps - iterative context obtained from QPSCreate()
monitor - pointer to function (if this is NULL, it turns off monitoring
mctx - [optional] context for private data for the monitor routine (use NULL if no context is desired)
monitordestroy - [optional] routine that frees monitor context (may be NULL)

Calling Sequence of monitor

    monitor (QPS qps, int it, PetscReal rnorm, void *mctx)

qps - iterative context obtained from QPSCreate()
it - iteration number
rnorm - (estimated) 2-norm of (preconditioned) residual
mctx - optional monitoring context, as set by QPSMonitorSet()

Options Database Keys

-qps_monitor - sets QPSMonitorDefault()
-qps_monitor_true_residual - sets QPSMonitorTrueResidualNorm()
-qps_monitor_max - sets QPSMonitorTrueResidualMaxNorm()
-qps_monitor_lg_residualnorm - sets line graph monitor, uses QPSMonitorLGResidualNormCreate()
-qps_monitor_lg_true_residualnorm - sets line graph monitor, uses KSPMonitorLGResidualNormCreate()
-qps_monitor_singular_value - sets QPSMonitorSingularValue()
-qps_monitor_cancel - cancels all monitors that have been hardwired into a code by calls to QPSMonitorSet(), but does not cancel those set via the options database.

Notes

The default is to do nothing. To print the residual, or preconditioned residual if QPSSetNormType(qps,QPS_NORM_PRECONDITIONED) was called, use QPSMonitorDefault() as the monitoring routine, with a null monitoring context.

Several different monitoring routines may be set by calling QPSMonitorSet() multiple times; all will be called in the order in which they were set.

Keywords

QPS, set, monitor

See Also

QPSMonitorDefault(), QPSMonitorLGResidualNormCreate(), QPSMonitorCancel()

Level:beginner
Location:
src/qps/interface/qps.c
Index of all QPS routines
Table of Contents for all manual pages
Index of all manual pages