#include "petscvec.h" PetscErrorCode VecGhostGetLocalForm(Vec g,Vec *l)Logically Collective Many br
To update the ghost values from the locations on the other processes one must call Many brVecGhostUpdateBegin() and VecGhostUpdateEnd() before accessing the ghost values. Thus normal Many brusage is Many br
VecGhostUpdateBegin(x,INSERT_VALUES,SCATTER_FORWARD);
VecGhostUpdateEnd(x,INSERT_VALUES,SCATTER_FORWARD);
VecGhostGetLocalForm(x,&xlocal);
VecGetArray(xlocal,&xvalues);
// access the non-ghost values in locations xvalues[0:n-1] and ghost values in locations xvalues[n:n+nghost];
VecRestoreArray(xlocal,&xvalues);
VecGhostRestoreLocalForm(x,&xlocal);
One should call VecGhostRestoreLocalForm() or VecDestroy() once one is Many brfinished using the object. Many br
Many br
Level:advanced
Location:src/vec/vec/impls/mpi/commonmpvec.c
Index of all Vec routines
Table of Contents for all manual pages
Index of all manual pages