[petsc-users] vtk format

Jed Brown jedbrown at mcs.anl.gov
Wed Dec 18 13:25:17 CST 2013


Matthew Knepley <knepley at gmail.com> writes:

>>    ierr = PetscViewerCreate(PETSC_COMM_WORLD, &viewer);CHKERRQ(ierr);
>>    ierr = PetscViewerSetType(viewer, PETSCVIEWERVTK);CHKERRQ(ierr);
>>
>>    ierr = PetscViewerFileSetName(viewer, "poisson.vtk");CHKERRQ(ierr);

Please do not use the legacy ASCII format, except perhaps for test files
so small you will be reading them by hand rather than viewing them with
software.

>>    ierr = PetscViewerSetFormat(viewer,
>> PETSC_VIEWER_ASCII_VTK);CHKERRQ(ierr);
>>    DMDAVTKWriteAll((PetscObject)da, viewer);
>>
>
> This is mixing a few things. I think you want binary VTK, so
>
>    ierr = PetscViewerCreate(PETSC_COMM_WORLD, &viewer);CHKERRQ(ierr);
>    ierr = PetscViewerSetType(viewer, PETSCVIEWERVTK);CHKERRQ(ierr);
>    ierr = PetscViewerFileSetName(viewer, "poisson.vtu");CHKERRQ(ierr);

Matt means "poisson.vts" since you are on a structured grid.
"poisson.vtr" should also work with petsc-dev (for rectangular grids, a
special case of structured).

>    ierr = VecView(v);CHKERRQ(ierr);

  VecView(v,viewer);
-------------- 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/20131218/37cc0a20/attachment.pgp>


More information about the petsc-users mailing list