[petsc-users] Writing PETSc matrices

Jed Brown jed at 59A2.org
Wed Oct 27 08:16:58 CDT 2010


On Wed, Oct 27, 2010 at 10:26, Benjamin Sanderse <B.Sanderse at cwi.nl> wrote:

> PetscInt iterations;
> ierr = KSPGetIterationNumber(ksp,&iterations);CHKERRQ(ierr);
> fd   = PETSC_VIEWER_SOCKET_WORLD;
> ierr = PetscIntView(1,iterations,fd);CHKERRQ(ierr);
>

This is a type error (your compiler should have issued a warning), you want

  PetscIntView(1,&iterations,fd);

because the prototype is PetscIntView(PetscInt,const
PetscInt[],PetscViewer);

Also see Barry's comment about reading it correctly.

Jed
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20101027/1df59850/attachment.htm>


More information about the petsc-users mailing list