:orphan:
# PetscViewerRestoreSubViewer
Restores a `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
## See Also
[](sec_viewers), `PetscViewer`, `PetscViewerSocketOpen()`, `PetscViewerASCIIOpen()`, `PetscViewerDrawOpen()`, `PetscViewerGetSubViewer()`
## Level
advanced
## Location
src/sys/classes/viewer/interface/dupl.c
## Examples
src/dm/tutorials/ex6.c
src/vec/vec/tutorials/ex14f.F90
src/vec/vec/tutorials/ex9f.F90
## Implementations
PetscViewerRestoreSubViewer_ASCII in src/sys/classes/viewer/impls/ascii/filev.c
PetscViewerRestoreSubViewer_Binary in src/sys/classes/viewer/impls/binary/binv.c
PetscViewerRestoreSubViewer_Draw in src/sys/classes/viewer/impls/draw/drawv.c
PetscViewerRestoreSubViewer_String in src/sys/classes/viewer/impls/string/stringv.c
---
[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](/manualpages/index.md)
[Index of all manual pages](/manualpages/singleindex.md)