[petsc-users] Accessing Vector's ghost values

Jed Brown jedbrown at mcs.anl.gov
Thu Feb 23 20:35:30 CST 2012


On Thu, Feb 23, 2012 at 15:16, Bojan Niceno <bojan.niceno at psi.ch> wrote:

> - Array unk, which should hold values inside the partition and in ghost
> cells.  It is big enough to hold both
> - Vec x, created by command VecCreateGhost, with proper padding for ghost
> cells
> - Successful call to linear solver in parallel.
>
> But I need to copy ghost values from x to my array unk.
>

I'm not sure what you're asking. You create the ghost array and use
VecGhostGetLocalForm()/VecGhostRestoreLocalForm() to access and release
access to the local vector (which includes the ghost points). You can into
or out of the local form if you want, but usually people set up their
indexing to use the ordering in the local form (owned values followed by
ghosted values).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20120223/0de6ae30/attachment.htm>


More information about the petsc-users mailing list