# PetscViewerGetSubcomm

Creates a new PetscViewer (same type as the old) that lives on a subgroup of processors

### Synopsis

    #include "petscviewer.h"
    PetscErrorCode  PetscViewerGetSubcomm(PetscViewer viewer,MPI_Comm subcomm,PetscViewer *outviewer)

Collective on PetscViewer

### Input Parameter

| viewer | - the PetscViewer to be duplicated
| subcomm | - MPI communicator

### Output Parameter

outviewer -new PetscViewer

Notes: Call PetscViewerRestoreSubcomm() to return this PetscViewer, NOT PetscViewerDestroy()

This is used to view a sequential or a parallel object that is part of a larger parallel object. For example redundant PC view could use this to obtain a PetscViewer that is used within a subcommunicator on one duplicated preconditioner.

### See Also

PetscViewerSocketOpen(), PetscViewerASCIIOpen(), PetscViewerDrawOpen(), PetscViewerRestoreSubcomm()

Level:advanced
Location: src/sys/viewer/interface/dupl.c
Index of all Viewer routines
Table of Contents for all manual pages
Index of all manual pages