PetscViewer — PETSc 3.25.2 documentation

Skip to main content
`Ctrl`+`K`

# PetscViewer

Abstract PETSc object for displaying in ASCII, saving to a binary file, graphically displaying, etc. PETSc objects and their data

## Synopsis

    typedef struct _p_PetscViewer *PetscViewer;

## Notes

Each PETSc class, for example `Vec`, has a viewer method associated with that class, for example `VecView()`, that can be used to view, display, store to a file information about that object, etc. Each class also has a method that uses the options database to view the object, for example `VecViewFromOptions()`.

See `PetscViewerType` for a list of all `PetscViewer` types.

## See Also

Viewers: Looking at PETSc Objects, `PetscViewerType`, `PETSCVIEWERASCII`, `PetscViewerCreate()`, `PetscViewerSetType()`, `VecView()`, `VecViewFromOptions()`, `PetscObjectView()`

## Level

beginner

## Location

include/petscviewertypes.h

## Examples

src/dm/impls/plex/tutorials/ex5.c
src/dm/impls/plex/tutorials/ex16.c
src/dm/impls/stag/tutorials/ex4.c
src/dm/impls/stag/tutorials/ex6.c
src/dm/impls/forest/tutorials/ex1.c
src/dm/label/tutorials/ex1.c
src/dm/impls/plex/tutorials/ex19.c
src/dm/impls/plex/tutorials/ex1f90.F90
src/dm/field/tutorials/ex1.c
src/dm/impls/plex/tutorials/ex15.c

## Implementations

_p_PetscViewer in include/petsc/private/viewerimpl.h
PetscViewer_ADIOS in include/petsc/private/vieweradiosimpl.h
PetscViewer_CGNS in include/petsc/private/viewercgnsimpl.h
PetscViewer_ExodusII in include/petsc/private/viewerexodusiiimpl.h
PetscViewer_ASCII in src/sys/classes/viewer/impls/ascii/asciiimpl.h
PetscViewer_Binary in src/sys/classes/viewer/impls/binary/binv.c
PetscViewer_Draw in src/sys/classes/viewer/impls/draw/vdraw.h
PetscViewer_Mathematica in src/sys/classes/viewer/impls/mathematica/mathematica.h
PetscViewer_Matlab in src/sys/classes/viewer/impls/matlab/vmatlab.c
PetscViewer_Socket in src/sys/classes/viewer/impls/socket/socket.h
PetscViewer_String in src/sys/classes/viewer/impls/string/stringv.c
PetscViewer_VTK in src/sys/classes/viewer/impls/vtk/vtkvimpl.h
PetscViewer_VU in src/sys/classes/viewer/impls/vu/petscvu.c

Index of all Viewer routines
Table of Contents for all manual pages
Index of all manual pages