Skip to main content
`Ctrl`+`K`

# PetscViewerVTKAddField

Add a field to the viewer

## Synopsis

    #include "petscviewer.h"
    PetscErrorCode PetscViewerVTKAddField(PetscViewer viewer, PetscObject dm, PetscErrorCode (*PetscViewerVTKWriteFunction)(PetscObject, PetscViewer), PetscInt fieldnum, PetscViewerVTKFieldType fieldtype, PetscBool checkdm, PetscObject vec)

Collective

## Input Parameters

- viewer - `PETSCVIEWERVTK`

- dm - `DM` on which `Vec` lives

- PetscViewerVTKWriteFunction - function to write this `Vec`

- fieldnum - which field of the `DM` to write (`PETSC_DEFAULT` if the whole vector should be written)

- fieldtype - Either `PETSC_VTK_POINT_FIELD` or `PETSC_VTK_CELL_FIELD`

- checkdm - whether to check for identical dm arguments as fields are added

- vec - `Vec` from which to write

## Note

This routine keeps exclusive ownership of the `Vec`. The caller should not use or destroy the `Vec` after calling it.

## See Also

Viewers: Looking at PETSc Objects, `PETSCVIEWERVTK`, `PetscViewerVTKOpen()`, `DMDAVTKWriteAll()`, `PetscViewerVTKWriteFunction`, `PetscViewerVTKGetDM()`

## Level

developer

## Location

src/sys/classes/viewer/impls/vtk/vtkv.c

## Implementations

PetscViewerVTKAddField_VTK(PetscViewer viewer, PetscObject dm, PetscErrorCode (*PetscViewerVTKWriteFunction)() in src/sys/classes/viewer/impls/vtk/vtkv.c

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