Skip to main content
`Ctrl`+`K`

# PetscViewerFormat

Way a viewer presents the object

## Synopsis

    typedef enum {
      PETSC_VIEWER_DEFAULT,
      PETSC_VIEWER_ASCII_MATLAB,
      PETSC_VIEWER_ASCII_MATHEMATICA,
      PETSC_VIEWER_ASCII_IMPL,
      PETSC_VIEWER_ASCII_INFO,
      PETSC_VIEWER_ASCII_INFO_DETAIL,
      PETSC_VIEWER_ASCII_COMMON,
      PETSC_VIEWER_ASCII_SYMMODU,
      PETSC_VIEWER_ASCII_INDEX,
      PETSC_VIEWER_ASCII_DENSE,
      PETSC_VIEWER_ASCII_MATRIXMARKET,
      PETSC_VIEWER_ASCII_PCICE,
      PETSC_VIEWER_ASCII_PYTHON,
      PETSC_VIEWER_ASCII_FACTOR_INFO,
      PETSC_VIEWER_ASCII_LATEX,
      PETSC_VIEWER_ASCII_XML,
      PETSC_VIEWER_ASCII_FLAMEGRAPH,
      PETSC_VIEWER_ASCII_GLVIS,
      PETSC_VIEWER_ASCII_CSV,
      PETSC_VIEWER_DRAW_BASIC,
      PETSC_VIEWER_DRAW_LG,
      PETSC_VIEWER_DRAW_LG_XRANGE,
      PETSC_VIEWER_DRAW_CONTOUR,
      PETSC_VIEWER_DRAW_PORTS,
      PETSC_VIEWER_VTK_VTS,
      PETSC_VIEWER_VTK_VTR,
      PETSC_VIEWER_VTK_VTU,
      PETSC_VIEWER_BINARY_MATLAB,
      PETSC_VIEWER_NATIVE,
      PETSC_VIEWER_HDF5_PETSC,
      PETSC_VIEWER_HDF5_VIZ,
      PETSC_VIEWER_HDF5_XDMF,
      PETSC_VIEWER_HDF5_MAT,
      PETSC_VIEWER_NOFORMAT,
      PETSC_VIEWER_LOAD_BALANCE,
      PETSC_VIEWER_FAILED,
      PETSC_VIEWER_ALL
    } PetscViewerFormat;

## Values

- `PETSC_VIEWER_DEFAULT` - default format for the specific object being viewed

- `PETSC_VIEWER_ASCII_MATLAB` - MATLAB format

- `PETSC_VIEWER_ASCII_DENSE` - print matrix as a dense two dimensiona array

- `PETSC_VIEWER_ASCII_IMPL` - implementation-specific format (which is in many cases the same as the default)

- `PETSC_VIEWER_ASCII_INFO` - basic information about object

- `PETSC_VIEWER_ASCII_INFO_DETAIL` - more detailed info about object (but still not vector or matrix entries)

- `PETSC_VIEWER_ASCII_COMMON` - identical output format for all objects of a particular type

- `PETSC_VIEWER_ASCII_INDEX` - (for vectors) prints the vector element number next to each vector entry

- `PETSC_VIEWER_ASCII_SYMMODU` - print parallel vectors without indicating the MPI process ranges that own the entries

- `PETSC_VIEWER_ASCII_VTK` - outputs the object to a VTK file (deprecated since v3.14)

- `PETSC_VIEWER_NATIVE` - store the object to the binary file in its native format (for example, dense matrices are stored as dense), `DMDA` vectors are dumped directly to the file instead of being first put in the natural ordering

- `PETSC_VIEWER_ASCII_LATEX` - output the data in LaTeX

- `PETSC_VIEWER_BINARY_MATLAB` - output additional information that can be used to read the data into MATLAB

- `PETSC_VIEWER_DRAW_BASIC` - views the vector with a simple 1d plot

- `PETSC_VIEWER_DRAW_LG` - views the vector with a line graph

- `PETSC_VIEWER_DRAW_CONTOUR` - views the vector with a contour plot

## Note

A variety of specialized formats also exist

## See Also

Viewers: Looking at PETSc Objects, `PetscViewer`, `PetscViewerType`, `PetscViewerPushFormat()`, `PetscViewerPopFormat()`

## Level

beginner

## Location

include/petscviewer.h

## Examples

src/tao/term/tutorials/ex1.c
src/vec/is/sf/tutorials/ex1f.F90
src/ksp/ksp/tutorials/ex76.c
src/vec/is/sf/tutorials/ex1.c

## Examples

src/dm/tutorials/ex7.c

## Examples

src/ksp/ksp/tutorials/ex54.c
src/ksp/ksp/tutorials/ex56.c
src/ksp/ksp/tutorials/ex34.c
src/ksp/ksp/tutorials/ex55.c
src/ts/tutorials/ex9.c

## Examples

src/dm/tutorials/ex22.c

## Examples

src/tao/term/tutorials/ex1.c

## Examples

src/dm/impls/plex/tutorials/ex19.c

## Examples

src/ksp/ksp/tutorials/ex2f.F90
src/snes/tutorials/ex1f.F90

## Examples

src/dm/impls/plex/tutorials/ex5.c

## Examples

src/ts/tutorials/ex30.c

## Examples

src/ksp/ksp/tutorials/ex27.c

## Examples

src/dm/impls/plex/tutorials/ex19.c
src/ts/tutorials/ex52.c
src/snes/tutorials/ex30.c
src/ts/tutorials/ex12.c
src/ksp/ksp/tutorials/ex2f.F90
src/ts/tutorials/ex7.c

## Examples

src/vec/vec/tutorials/ex3.c

## Examples

src/dm/impls/plex/tutorials/ex5.c
src/dm/impls/plex/tutorials/ex19.c
src/snes/tutorials/ex36.c
src/sys/classes/viewer/tutorials/ex2.c
src/ts/tutorials/ex30.c
src/snes/tutorials/ex56.c
src/snes/tutorials/ex62.c
src/snes/tutorials/ex34.c
src/mat/tutorials/ex10.c
src/snes/tutorials/ex17.c

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