[petsc-users] VTK Output / no file

Jed Brown jed at jedbrown.org
Thu Mar 5 15:34:35 CST 2015


Grischa Jacobs <grischa.jacobs at email.de> writes:

> Hi,
>  
> I found the problem. PetscViewerVTKOpen will only work for DMVectors not for
> natural Vectors.
>  
> This doesn't work:
> ierr = DMDACreate3d(PETSC_COMM_WORLD, DM_BOUNDARY_NONE, DM_BOUNDARY_NONE,
> DM_BOUNDARY_NONE, DMDA_STENCIL_BOX, 10, 10, 10, PETSC_DECIDE, PETSC_DECIDE,
> PETSC_DECIDE, 1, 1,NULL,NULL,NULL,&test);CHKERRQ(ierr);
>
> Vec a;
> DMDACreateNaturalVector(test,&a);CHKERRQ(ierr);
> ierr = PetscViewerVTKOpen
> (PETSC_COMM_WORLD,"yourfile_natural.vts",FILE_MODE_WRITE, &viewer1);CHKERRQ(
> ierr);
> ierr = VecView(a, viewer1);CHKERRQ(ierr);
> ierr = PetscViewerDestroy(&viewer1);CHKERRQ(ierr);
>
>  
>
> This does work:
> ierr = DMDACreate3d(PETSC_COMM_WORLD, DM_BOUNDARY_NONE, DM_BOUNDARY_NONE,
> DM_BOUNDARY_NONE, DMDA_STENCIL_BOX, 10, 10, 10, PETSC_DECIDE, PETSC_DECIDE,
> PETSC_DECIDE, 1, 1,NULL,NULL,NULL,&test);CHKERRQ(ierr);
> Vec a;
> DMCreateGlobalVector(test,&a);
> ierr = PetscViewerVTKOpen(PETSC_COMM_WORLD,"yourfile_dm.vts",FILE_MODE_WRITE, &
> viewer1);CHKERRQ(ierr);
> ierr = VecView(a, viewer1);CHKERRQ(ierr);
> ierr = PetscViewerDestroy(&viewer1);CHKERRQ(ierr);
>
> Can anyone confirm this?

Sounds accurate since it was never written for natural vectors.  I guess
we should make it error in that case?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 818 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20150305/fd81b76f/attachment.pgp>


More information about the petsc-users mailing list