Skip to main content
`Ctrl`+`K`

# PetscViewerRegister

Adds a viewer to those available for use with `PetscViewerSetType()`

## Synopsis

    #include "petscviewer.h"
    PetscErrorCode PetscViewerRegister(const char *sname, PetscErrorCode (*function)(PetscViewer))

Not Collective, No Fortran Support

## Input Parameters

- sname - name of a new user-defined viewer

- function - routine to create method context

## Note

`PetscViewerRegister()` may be called multiple times to add several user-defined viewers.

## Example Usage

       PetscViewerRegister("my_viewer_type", MyViewerCreate);

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

      PetscViewerSetType(viewer, "my_viewer_type")

or at runtime via the option

      -viewer_type my_viewer_type

## See Also

Viewers: Looking at PETSc Objects, `PetscViewerRegisterAll()`

## Level

developer

## Location

src/sys/classes/viewer/interface/viewreg.c

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