DMAdaptorMonitorRegister — PETSc 3.23.0 documentation

Skip to main content
`Ctrl`+`K`

# DMAdaptorMonitorRegister

Registers a mesh adaptation monitor routine that may be accessed with `DMAdaptorMonitorSetFromOptions()`

## Synopsis

    #include "petscdmadaptor.h"
    PetscErrorCode DMAdaptorMonitorRegister(const char name[], PetscViewerType vtype, PetscViewerFormat format, PetscErrorCode (*monitor)(DMAdaptor, PetscInt, DM, DM, PetscInt, PetscReal[], Vec, 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

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

## Example Usage

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

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

      DMAdaptorMonitorSetFromOptions(ksp, "-adaptor_monitor_my_monitor", "my_monitor", NULL)

or at runtime via the option `-adaptor_monitor_my_monitor`

## See Also

SNES: Nonlinear Solvers, `DMAdaptor`, `DMAdaptorMonitorSet()`, `DMAdaptorMonitorRegisterAll()`, `DMAdaptorMonitorSetFromOptions()`

## Level

advanced

## Location

src/snes/utils/dm/dmadapt.c

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