You should only use PetscViewerFileSetMode to APPEND when you first create
the viewer. You would only set it to APPEND if you destroy and recreate the
viewer for each time-step.
The append tells the viewer that when it opens the file it should move its
pointer to the end of the file
Hello team,
I recently updated by PETSc version and this error emerged:
"Cannot change mode to APPEND after setup"
I used to use PetscViewerFileSetMode to set the mode as WRITE when I first
initiate the file, and for following time steps I set it to APPEND to open
the existing file and append