# PetscViewerRestoreSubViewer
Restores a new `PetscViewer` obtained with `PetscViewerGetSubViewer()`. 
## Synopsis
```
#include "petscviewer.h" 
PetscErrorCode PetscViewerRestoreSubViewer(PetscViewer viewer, MPI_Comm comm, PetscViewer *outviewer)
```
Collective


## Input Parameters

- ***viewer -*** the `PetscViewer` that was reproduced
- ***outviewer -*** the subviewer to be returned `PetscViewer`





## See Also
 [](sec_viewers), `PetscViewerSocketOpen()`, `PetscViewerASCIIOpen()`, `PetscViewerDrawOpen()`, `PetscViewerGetSubViewer()`

## Level
advanced

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

## Examples
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/vec/vec/tutorials/ex14f.F90.html">src/vec/vec/tutorials/ex14f.F90.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/vec/vec/tutorials/ex9f.F90.html">src/vec/vec/tutorials/ex9f.F90.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/dm/tutorials/ex6.c.html">src/dm/tutorials/ex6.c.html</A><BR>

## Implementations

<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/sys/classes/viewer/impls/ascii/filev.c.html#PetscViewerRestoreSubViewer_ASCII">PetscViewerRestoreSubViewer_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#PetscViewerRestoreSubViewer_Binary">PetscViewerRestoreSubViewer_Binary in src/sys/classes/viewer/impls/binary/binv.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/sys/classes/viewer/impls/draw/drawv.c.html#PetscViewerRestoreSubViewer_Draw">PetscViewerRestoreSubViewer_Draw in src/sys/classes/viewer/impls/draw/drawv.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/sys/classes/viewer/impls/string/stringv.c.html#PetscViewerRestoreSubViewer_String">PetscViewerRestoreSubViewer_String in src/sys/classes/viewer/impls/string/stringv.c</A><BR>


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