I'm working with someone else's code that uses PETSc 3.0.0-p9.
They have a vector at the end of the computation that is distributed among a number of different processors, and I want to output that vector to a file.
Unfortunately, the way they do it doesn't appear to work. Is there an easy way to write (the real part) of a vector to a file in PETSc?
The current way it is done is to write the PETScVector to a C++ STL vector (on all processors), and then write the vector out to a file (on one processor).
This approach doesn't work, because only the values on that processor are written to file.
Is there a "standard PETSc" way of outputting a vector to a file?