# PetscViewerDestroy
Destroys a `PetscViewer`. 
## Synopsis
```
#include "petscviewer.h" 
PetscErrorCode PetscViewerDestroy(PetscViewer *viewer)
```
Collective on viewer


## Input Parameters

- ***viewer -*** the `PetscViewer` to be destroyed.





## See Also
 `PetscViewer`, `PetscViewerSocketOpen()`, `PetscViewerASCIIOpen()`, `PetscViewerCreate()`, `PetscViewerDrawOpen()`

## Level
beginner

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

## Examples
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/sys/classes/viewer/tutorials/ex1.c.html">src/sys/classes/viewer/tutorials/ex1.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/sys/classes/viewer/tutorials/ex1f90.F90.html">src/sys/classes/viewer/tutorials/ex1f90.F90.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/sys/classes/viewer/tutorials/ex2.c.html">src/sys/classes/viewer/tutorials/ex2.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/sys/tutorials/ex5.c.html">src/sys/tutorials/ex5.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/sys/tutorials/ex5f90.F90.html">src/sys/tutorials/ex5f90.F90.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/vec/vec/utils/tagger/tutorials/ex1.c.html">src/vec/vec/utils/tagger/tutorials/ex1.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/vec/vec/tutorials/ex10.c.html">src/vec/vec/tutorials/ex10.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/vec/vec/tutorials/ex15.c.html">src/vec/vec/tutorials/ex15.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/vec/vec/tutorials/ex19.c.html">src/vec/vec/tutorials/ex19.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/vec/vec/tutorials/ex3.c.html">src/vec/vec/tutorials/ex3.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/vec/vec/tutorials/ex3f.F90.html">src/vec/vec/tutorials/ex3f.F90.html</A><BR>

## Implementations

<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/dm/impls/plex/plexexodusii.c.html#PetscViewerDestroy_ExodusII">PetscViewerDestroy_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#PetscViewerDestroy_ADIOS">PetscViewerDestroy_ADIOS in src/sys/classes/viewer/impls/adios/adios.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/sys/classes/viewer/impls/ams/ams.c.html#PetscViewerDestroy_SAWs">PetscViewerDestroy_SAWs in src/sys/classes/viewer/impls/ams/ams.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/sys/classes/viewer/impls/ascii/filev.c.html#PetscViewerDestroy_ASCII">PetscViewerDestroy_ASCII in src/sys/classes/viewer/impls/ascii/filev.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/sys/classes/viewer/impls/binary/binv.c.html#PetscViewerDestroy_Binary">PetscViewerDestroy_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#PetscViewerDestroy_CGNS">PetscViewerDestroy_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#PetscViewerDestroy_Draw">PetscViewerDestroy_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#PetscViewerDestroy_GLVis">PetscViewerDestroy_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#PetscViewerDestroy_HDF5">PetscViewerDestroy_HDF5 in src/sys/classes/viewer/impls/hdf5/hdf5v.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/sys/classes/viewer/impls/mathematica/mathematica.c.html#PetscViewerDestroy_Mathematica">PetscViewerDestroy_Mathematica in src/sys/classes/viewer/impls/mathematica/mathematica.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/sys/classes/viewer/impls/matlab/vmatlab.c.html#PetscViewerDestroy_Matlab">PetscViewerDestroy_Matlab in src/sys/classes/viewer/impls/matlab/vmatlab.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/sys/classes/viewer/impls/socket/send.c.html#PetscViewerDestroy_Socket">PetscViewerDestroy_Socket in src/sys/classes/viewer/impls/socket/send.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/sys/classes/viewer/impls/string/stringv.c.html#PetscViewerDestroy_String">PetscViewerDestroy_String in src/sys/classes/viewer/impls/string/stringv.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/sys/classes/viewer/impls/vtk/vtkv.c.html#PetscViewerDestroy_VTK">PetscViewerDestroy_VTK in src/sys/classes/viewer/impls/vtk/vtkv.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/sys/classes/viewer/impls/vu/petscvu.c.html#PetscViewerDestroy_VU">PetscViewerDestroy_VU in src/sys/classes/viewer/impls/vu/petscvu.c</A><BR>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/sys/classes/viewer/interface/view.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)  
