PETSc version 3.15.5
Fix/Edit manual page

# PetscViewerGLVisSetFields

Sets the required information to visualize different fields from a vector.

### Synopsis

    #include "petscviewer.h"
    #include "petscsys.h"
    PetscErrorCode PetscViewerGLVisSetFields(PetscViewer viewer, PetscInt nf, const char* fec_type[], PetscInt dim[], PetscErrorCode(*g2l)(PetscObject,PetscInt,PetscObject[],void*), PetscObject Vfield[], void* ctx, PetscErrorCode(*destroyctx)(void*))

Logically Collective on PetscViewer

### Input Parameters

| viewer | - the PetscViewer
| nf | - number of fields to be visualized
| fec_type | - the type of finite element to be used to visualize the data (see FiniteElementCollection::Name() in MFEM)
| dim | - array of space dimension for field vectors (used to initialize the scene)
| g2lfields | - User routine to compute the local field vectors to be visualized; PetscObject is used in place of Vec on the prototype
| Vfield | - array of work vectors, one for each field
| ctx | - User context to store the relevant data to apply g2lfields
| destroyctx | - Destroy function for userctx

### Notes

g2lfields is called on the vector V to be visualized in order to extract the relevant dofs to be put in Vfield[], as

      g2lfields((PetscObject)V,nfields,(PetscObject*)Vfield[],ctx).

For vector spaces, the block size of Vfield[i] represents the vector dimension. It misses the Fortran bindings. The names of the Vfield vectors will be displayed in the window title.

### See Also

PetscViewerGLVisOpen(), PetscViewerCreate(), PetscViewerSetType(), PetscObjectSetName()

### Level

intermediate

### Location

src/sys/classes/viewer/impls/glvis/glvis.c

### Examples

src/ksp/ksp/tutorials/ex43.c.html

### Implementations

PetscViewerGLVisSetFields_GLVis(PetscViewer viewer, PetscInt nfields, const char* fec_type[], PetscInt dim[], PetscErrorCode(*g2l)(PetscObject,PetscInt,PetscObject[],void*), PetscObject Vfield[], void* ctx, PetscErrorCode(*destroyctx) in src/sys/classes/viewer/impls/glvis/glvis.c
Index of all Viewer routines
Table of Contents for all manual pages
Index of all manual pages