VecCopy() for ghosted vectors

Jed Brown jed at 59A2.org
Wed Feb 25 05:13:02 CST 2009


On Wed 2009-02-25 11:19, Tim Kroeger wrote:
> When using VecCopy(a,b) where both a and b have been created using  
> VecCreateGhost(), it seems as if ghost components are not copied. Did I 
> do something wrong?

The vector returned by VecCreateGhost will behave exactly like any other
parallel vector for the usual vector operations.  If you want access to
the ghosted values, use VecGhostGetLocalForm which will give you a
serial vector (which knows nothing about the other processes, or even
that it came from a VecGhost).  VecGhostUpdate{Begin,End} is the way to
handle the relationship between these conceptually different objects.
If you only work with one (the local form or the global form) at a time,
the result should be the same as if they didn't share any memory and you
used a VecScatter to move values between the two representations (as
with DALocalToGlobal).

Jed
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20090225/a5ff789e/attachment.pgp>


More information about the petsc-users mailing list