[petsc-users] Saving binary output at every tilmestep in ts/ex3.c

Mohammad Imtiaz M.Imtiaz at victorchang.edu.au
Tue Mar 3 22:41:38 CST 2015


Hi
I am trying to save output at every time step in ts/ex3.c.  But all that gets saved is the final output.  I have changed example ts/ex3.c as follows:


Added a new viewer
Line 77: PetscViewer viewer1,viewer2,viewer3;  /* viewers for the solution and error */

Added
Line 161: PetscViewerBinaryOpen(PETSC_COMM_WORLD,"out.bin",FILE_MODE_WRITE,&appctx.viewer3);


Added
Line 271: ierr = PetscViewerDestroy(&appctx.viewer3);CHKERRQ(ierr);


In Monitor function added:
VecView(u,appctx->viewer3);CHKERRQ(ierr);


I will be thankful for any help understanding what I am missing.

Thanks
Imtiaz




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20150304/58e7860e/attachment.html>


More information about the petsc-users mailing list