[petsc-users] Append vector to existing file

Yuyun Yang yyang85 at stanford.edu
Fri Mar 8 16:52:55 CST 2019


Hello team,

This is a very simple question, but I just want to be sure I understand how the viewer works. I have a file with some vectors already written into it. Now I'm calling PetscViewerASCIIOpen, setting the format and then the file mode into append:
  PetscViewer viewer;
  ierr = PetscViewerASCIIOpen(PETSC_COMM_WORLD, filename.c_str(), &viewer);
  ierr = PetscViewerPushFormat(viewer, PETSC_VIEWER_ASCII_MATLAB); CHKERRQ(ierr);
ierr = PetscViewerFileSetMode(viewer, FILE_MODE_APPEND); CHKERRQ(ierr);

After which I call VecView to append some new vectors to the existing file. But this operation is clearing out my existing file and writing it with new information. Does the append mode happen to not work with this type of viewer, or am I missing something here?

Thanks a lot,
Yuyun
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20190308/0af33484/attachment-0001.html>


More information about the petsc-users mailing list