Matthew Knepley <[email protected]> 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);

Attachment: pgpR2bIFtYLjY.pgp
Description: PGP signature

Reply via email to