[petsc-users] Visualizing structured cell-centered data VTK

Jed Brown jed at jedbrown.org
Wed Feb 7 05:54:55 CST 2018


"Buesing, Henrik" <hbuesing at eonerc.rwth-aachen.de> writes:

> Dear all,
>
> I have structured cell-centered data and would like to visualize this with Paraview. Up to now I use PetscViewerVTKOpen and VecView to write data in *.vts format. I would like to tell PETSc that the fieldtype is PETSC_VTK_CELL_FIELD. I have found PetscViewerVTKAddField.
>
> Is this the way to go? I was thinking maybe a DMDASetFieldType exists, but did not find any. If yes, what is the PetscViewerVTKWriteFunction I need to provide?

DMDA does not explicitly support distinguishing between cell and point
values.  PetscViewerVTKAddField is a developer level routine and you
would need to implement a function similar to DMDAVTKWriteAll_VTS (not
at all trivial and you need to read the code because it is responsible
for almost everything).


More information about the petsc-users mailing list