Xiangdong <[email protected]> writes:

> Okay. The local vector is equal to the local portion of global vector +
> ghost values. Both of them use the same PETSc ordering.
>
> The reason I got confused before is I use VecView(vglobal,
> PETSC_VIEWER_STDOUT_WORLD) to view the global vector. In the output, it has
> process[0] 1 2 3 4 process[1] 5 6 7 8 .... They are actually not the values
> stored in processor 0 and 1. They are different from the values printed
> through VecGetArray.

VecView transforms to natural ordering for output.  If you want to see
the PETSc ordering, use

 PetscViewerPushFormat(PETSC_VIEWER_STDOUT_WORLD,PETSC_VIEWER_NATIVE);
 VecView(vglobal,PETSC_VIEWER_STDOUT_WORLD);
 PetscViewerPopFormat(PETSC_VIEWER_STDOUT_WORLD);

Attachment: pgpITCr3fhBcs.pgp
Description: PGP signature

Reply via email to