#include "petscviewer.h" PetscErrorCode PetscViewerGetSubViewer(PetscViewer viewer,MPI_Comm comm,PetscViewer *outviewer)Collective on PetscViewer
|viewer||- the PetscViewer to be reproduced|
|outviewer||- new PetscViewer|
Call PetscViewerRestoreSubViewer() to destroy this PetscViewer, NOT PetscViewerDestroy()
This is most commonly used to view a sequential object that is part of a parallel object. For example block Jacobi PC view could use this to obtain a PetscViewer that is used with the sequential KSP on one block of the preconditioner.
Between the calls to PetscViewerGetSubViewer() and PetscViewerRestoreSubViewer() the original viewer should not be used
PETSCVIEWERDRAW and PETSCVIEWERBINARY only support returning a singleton viewer on rank 0, all other ranks will return a NULL viewer
It would be nice if the call to PetscViewerFlush() was not required and was handled by PetscViewerRestoreSubViewer()