[petsc-users] Getting a sequential copy of a parallel vector

Ormiston, Scott J. SJ_Ormiston at UManitoba.CA
Wed Jan 12 16:03:01 CST 2011


We are new to PETSc and are testing the KSP solvers.

We think we can fill a PETSc matrix and right hand side vector and get  
a parallel solution vector, but we are not sure how to get a copy of  
the solution vector that we can use in other calculations and to write  
results to a file.
We are using Fortran 95.

We are looking at a sequence of calls involving

ISCreateGeneral()
VecScatterCreate()
VecScatterBegin()
VecScatterEnd()

along with
ISDestroy()
VecScatterDestroy().

Is this the correct approach?

We can only find ex30f.F as an example. Is there a better fortran  
example somewhere that shows how to do this?
Thanks.

Scott J. Ormiston  Ph.D., Professor
University of Manitoba



More information about the petsc-users mailing list