Please always use "reply-all" so that your messages go to the list.

Khai Pham <[email protected]> writes:

> Hello Jed,
>
> May I join this topic with one question about vtk? I followed the 
> discussion on 
> http://lists.mcs.anl.gov/pipermail/petsc-users/2013-February/016506.html 
> to set the non-uniform grid coordinates. Then try to print out the vtk 
> file using:
>    ierr = PetscViewerCreate(PETSC_COMM_WORLD, &viewer);CHKERRQ(ierr);
>    ierr = PetscViewerSetType(viewer, PETSCVIEWERASCII);CHKERRQ(ierr);
>    ierr = PetscViewerFileSetName(viewer, file_name);CHKERRQ(ierr);
>    ierr = PetscViewerSetFormat(viewer,PETSC_VIEWER_ASCII_VTK);CHKERRQ(ierr);
>
>    ierr = DMView(dm, viewer);CHKERRQ(ierr);
>    ierr = VecView(v, viewer);CHKERRQ(ierr);

I don't know where you got this sequence, but it has been discouraged
since we added proper VTK support.  Use this:

  PetscViewerVTKOpen(comm,file_name,FILE_MODE_WRITE,&viewer);
  VecView(v,viewer);
  PetscViewerDestroy(&viewer);


The file name should end in .vtr for "rectangular" or .vts for
"structured" (when using DMDA), or with .vtu for "unstructured" (with
DMPlex).

Attachment: pgphUgMfKjdfs.pgp
Description: PGP signature

Reply via email to