#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
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.