[petsc-users] Outputting cell data in stead of point data while writing .vtr file

Matthew Knepley knepley at gmail.com
Thu Mar 11 07:07:51 CST 2021


What kind of DM is it?

  Thanks,

     Matt

On Thu, Mar 11, 2021 at 3:36 AM Smit Thijs <thijs.smit at hest.ethz.ch> wrote:

> Hi All,
>
>
>
> I am outputting several vectors to a .vtr file successfully for viewing in
> Paraview. At this moment the information is written to point data. How can
> I change this and make sure the data is written to cell data?
>
>
>
> The code I am currently using for outputting:
>
>
>
> PetscViewer viewer;
>
>
>
> ierr = PetscViewerVTKOpen(PETSC_COMM_WORLD, “test.vtr”, FILE_MODE_WRITE,
> &viewer);
>
> CHKERRQ(ierr);
>
>
>
> ierr = DMView(nd, viewer);
>
> CHKERRQ(ierr);
>
>
>
> PetscObjectSetName((PetscObject)xPhys,"xPhys");
>
> ierr = VecView(xPhys, viewer);
>
> CHKERRQ(ierr);
>
>
>
> PetscObjectSetName((PetscObject)S,"SvonMises");
>
> ierr = VecView(S, viewer);
>
> CHKERRQ(ierr);
>
>
>
> ierr = PetscViewerDestroy(&viewer);
>
> CHKERRQ(ierr);
>
>
>
> Best regards,
>
>
>
> Thijs Smit
>
>
>
> PhD Candidate
>
> ETH Zurich
>
> Institute for Biomechanics
>
>
>


-- 
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their
experiments lead.
-- Norbert Wiener

https://www.cse.buffalo.edu/~knepley/ <http://www.cse.buffalo.edu/~knepley/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20210311/5c3e7662/attachment-0001.html>


More information about the petsc-users mailing list