# PetscViewerSetFromOptions
Sets various options for a viewer from the options database. 
## Synopsis
```
#include "petscviewer.h" 
PetscErrorCode PetscViewerSetFromOptions(PetscViewer viewer)
```
Collective on viewer


## Input Parameter

- ***viewer -*** the viewer context





## Note
Must be called after PetscViewerCreate() before the PetscViewer is used.


## See Also
 `PetscViewer`, `PetscViewerCreate()`, `PetscViewerSetType()`, `PetscViewerType`

## Level
intermediate

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/sys/classes/viewer/interface/viewreg.c.html#PetscViewerSetFromOptions">src/sys/classes/viewer/interface/viewreg.c</A>

## Examples
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/mat/tutorials/ex10.c.html">src/mat/tutorials/ex10.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/dm/tutorials/ex10.c.html">src/dm/tutorials/ex10.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/dm/tutorials/ex9.c.html">src/dm/tutorials/ex9.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ts/tutorials/ex11.c.html">src/ts/tutorials/ex11.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ts/tutorials/ex48.c.html">src/ts/tutorials/ex48.c.html</A><BR>

## Implementations

<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/dm/impls/plex/plexexodusii.c.html#PetscViewerSetFromOptions_ExodusII">PetscViewerSetFromOptions_ExodusII in src/dm/impls/plex/plexexodusii.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/sys/classes/viewer/impls/adios/adios.c.html#PetscViewerSetFromOptions_ADIOS">PetscViewerSetFromOptions_ADIOS in src/sys/classes/viewer/impls/adios/adios.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/sys/classes/viewer/impls/binary/binv.c.html#PetscViewerSetFromOptions_Binary">PetscViewerSetFromOptions_Binary in src/sys/classes/viewer/impls/binary/binv.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/sys/classes/viewer/impls/cgns/cgnsv.c.html#PetscViewerSetFromOptions_CGNS">PetscViewerSetFromOptions_CGNS in src/sys/classes/viewer/impls/cgns/cgnsv.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/sys/classes/viewer/impls/draw/drawv.c.html#PetscViewerSetFromOptions_Draw">PetscViewerSetFromOptions_Draw in src/sys/classes/viewer/impls/draw/drawv.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/sys/classes/viewer/impls/glvis/glvis.c.html#PetscViewerSetFromOptions_GLVis">PetscViewerSetFromOptions_GLVis in src/sys/classes/viewer/impls/glvis/glvis.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/sys/classes/viewer/impls/hdf5/hdf5v.c.html#PetscViewerSetFromOptions_HDF5">PetscViewerSetFromOptions_HDF5 in src/sys/classes/viewer/impls/hdf5/hdf5v.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/sys/classes/viewer/impls/socket/send.c.html#PetscViewerSetFromOptions_Socket">PetscViewerSetFromOptions_Socket in src/sys/classes/viewer/impls/socket/send.c</A><BR>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/sys/classes/viewer/interface/viewreg.c)


[Index of all Viewer routines](index.md)  
[Table of Contents for all manual pages](/docs/manualpages/index.md)  
[Index of all manual pages](/docs/manualpages/singleindex.md)  
