# PetscViewerFlush
Flushes a `PetscViewer` (i.e. tries to dump all the data that has been printed through a `PetscViewer`). 
## Synopsis
```
#include "petscviewer.h" 
PetscErrorCode PetscViewerFlush(PetscViewer viewer)
```
Collective


## Input Parameter

- ***viewer -*** the `PetscViewer` to be flushed





## See Also
 [](sec_viewers), `PetscViewer`, `PetscViewerSocketOpen()`, `PetscViewerASCIIOpen()`, `PetscViewerDrawOpen()`, `PetscViewerCreate()`, `PetscViewerDestroy()`,
`PetscViewerSetType()`

## Level
intermediate

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

## Examples
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/vec/is/sf/tutorials/ex1.c.html">src/vec/is/sf/tutorials/ex1.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/dm/tutorials/swarm_ex1.c.html">src/dm/tutorials/swarm_ex1.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/snes/tutorials/ex17.c.html">src/snes/tutorials/ex17.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/snes/tutorials/ex62.c.html">src/snes/tutorials/ex62.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ts/tutorials/ex53.c.html">src/ts/tutorials/ex53.c.html</A><BR>

## Implementations

<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/sys/classes/viewer/impls/ascii/filev.c.html#PetscViewerFlush_ASCII">PetscViewerFlush_ASCII in src/sys/classes/viewer/impls/ascii/filev.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/sys/classes/viewer/impls/draw/drawv.c.html#PetscViewerFlush_Draw">PetscViewerFlush_Draw in src/sys/classes/viewer/impls/draw/drawv.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/sys/classes/viewer/impls/hdf5/hdf5v.c.html#PetscViewerFlush_HDF5">PetscViewerFlush_HDF5 in src/sys/classes/viewer/impls/hdf5/hdf5v.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/sys/classes/viewer/impls/vtk/vtkv.c.html#PetscViewerFlush_VTK">PetscViewerFlush_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#PetscViewerFlush_VU">PetscViewerFlush_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/flush.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)  
