[petsc-users] Binary VTK viewer
Jed Brown
jedbrown at mcs.anl.gov
Thu Mar 8 13:21:32 CST 2012
On Thu, Mar 8, 2012 at 13:10, Max Rudolph <maxwellr at gmail.com> wrote:
> I get an implicit declaration warning when compiling with a call to
> DMDAVTKWriteAll:
>
> io.c:209: warning: implicit declaration of function 'DMDAVTKWriteAll'
>
> Should the prototype be in petscdmda.h ? I do not see it there. Code still
> compiles successfully.
>
That is a developer-level function that you should not be calling, it's
declared in private/daimpl.h. I didn't hack together some funky new API
when I added the VTK viewer. You use it like any other viewer, by calling
VecView(). Here's some sample code.
ierr =
PetscOptionsGetString(((PetscObject)snes)->prefix,"-snes_view_solution_vtk",filename,PETSC_MAX_PATH_LEN,&flg);CHKERRQ(ierr);
if (flg) {
PetscViewer viewer;
ierr =
PetscViewerCreate(((PetscObject)snes)->comm,&viewer);CHKERRQ(ierr);
ierr = PetscViewerSetType(viewer,PETSCVIEWERVTK);CHKERRQ(ierr);
ierr = PetscViewerFileSetName(viewer,filename);CHKERRQ(ierr);
ierr = VecView(snes->vec_sol,viewer);CHKERRQ(ierr);
ierr = PetscViewerDestroy(&viewer);CHKERRQ(ierr);
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20120308/c5573b9f/attachment.htm>
More information about the petsc-users
mailing list