[petsc-users] Writing VTK output for vectors derived from DM Global vector

Jed Brown jedbrown at mcs.anl.gov
Mon Sep 23 17:30:30 CDT 2013


Garnet Vaz <garnet.vaz at gmail.com> writes:

> Hi,
>
> I would like to write out my solution to a VTK file where I use unstructured
> grids in DMPlex.
>
> The solution corresponds to  harmonic frequencies (~ 5-10 distinct) which
> are
> currently saved into a Vec* object. These vectors were created by
> duplicating the
> global vector for the DM object. (I know that they correspond to the right
> cell.)
>
> Is it possible to have one file which would contain the mesh from the DM
> object and all the Vec* objects?
> Would I have to clone the original DM and use
> http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Viewer/PetscViewerVTKAddField.html
> to include all the vectors?

This is a private function.

> In the above function does
> PetscViewerVTKWriteFunction
> just need to be
>
> myWriteFunc(vec,viewer)
> {
> VecView(vec,viewer)
> }
> if I do not need to make any changes to the vector?

This should work, but you may want to use PetscObjectSetName() so that
the names of the different fields are sensible.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20130923/e7d47757/attachment.pgp>


More information about the petsc-users mailing list