Grischa Jacobs <grischa.jac...@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?

Attachment: signature.asc
Description: PGP signature

Reply via email to