[petsc-users] Multiple output using one viewer

Barry Smith bsmith at mcs.anl.gov
Thu Jan 5 18:17:58 CST 2012


On Jan 5, 2012, at 9:40 AM, Jed Brown wrote:

> On Thu, Jan 5, 2012 at 09:36, Alexander Grayver <agrayver at gfz-potsdam.de> wrote:
> Maybe this should be noted in the documentation?
> 
> Yes, I think the old file should be closed (if it exists), but I'll wait for comment.

   I never thought about the case where someone called PetscViewerFileSetName() twice. I'm surprised that it works at all.

    Yes, it should (IMHO) be changed to close the old file if used twice.

   Barry

BTW: It is also possible to put many vectors and matrices in the same file and read them in using several different ways using PetscBinaryRead(). I (personally) think any approach that involves creating hundreds of files is nuts.





More information about the petsc-users mailing list