[petsc-users] binary vtk viewer DMDA

Jed Brown jedbrown at mcs.anl.gov
Wed Jan 9 09:51:24 CST 2013


None of that crazy "developer" nonsense is need for users. Just do this:

    PetscViewer viewer;
    /* file name extension sets format by default, see also
PetscViewerSetFormat(viewer,PETSC_VIEWER_VTK_VTS) */
    ierr =
PetscViewerVTKOpen(comm,"yourfile.vts",FILE_MODE_WRITE,&viewer);CHKERRQ(ierr);
    ierr = VecView(X,viewer);CHKERRQ(ierr);
    ierr = PetscViewerDestroy(&viewer);CHKERRQ(ierr);

When using TS, you can do -ts_monitor_draw_solution_vtk 'filename-%03D.vts'
to save each time step to a numbered binary file (ready to animate in
paraview or visit).


On Wed, Jan 9, 2013 at 9:37 AM, Blaise A Bourdin <bourdin at lsu.edu> wrote:

> Hi,
>
> I am looking at the documentation and the examples looking for a simple
> illustration of how to use the new vtk binary viewers for structured data
> defined by a DMDA, but can't find any straightforward example. Is there a
> simple example that I am missing?
>
> When I try
> PetscViewerVTKAddField(VTKviewer,(PetscObject)
> dmda1,DMDAVTKWriteAll,PETSC_VTK_POINT_FIELD,(PetscObject) p);CHKERRQ(ierr);
> I get a compilation time error:
> TestVTK.c:53: error: ‘DMDAVTKWriteAll’ was not declared in this scope
> indeed, DMDAVTKWriteAll is defined in a private header. Is this the way it
> is supposed to be?
>
> Is the xml file describing the content of the binary files generated
> automatically or do I need to take care of it by myself?
>
> I am using petsc-3.3, latest changeset.
>
> Regards,
> Blaise
> --
> Department of Mathematics and Center for Computation & Technology
> Louisiana State University, Baton Rouge, LA 70803, USA
> Tel. +1 (225) 578 1612, Fax  +1 (225) 578 4276
> http://www.math.lsu.edu/~bourdin
>
>
>
>
>
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20130109/08d01be3/attachment.html>


More information about the petsc-users mailing list