[petsc-users] VecCopy on ghosted vectors

Matthew Knepley knepley at gmail.com
Sun Apr 22 11:01:54 CDT 2012


On Sun, Apr 22, 2012 at 11:35 AM, Dominik Szczerba <dominik at itis.ethz.ch>wrote:

> I do
>
> VecGhostUpdateBegin(x1, INSERT_VALUES, SCATTER_FORWARD);
> VecGhostUpdateEnd(x1, INSERT_VALUES, SCATTER_FORWARD);
>
> then
>
> VecCopy(x1,x2)
>
> to find that x2 does not have correct ghost values and I need to
> explicitly call
>
> VecGhostUpdateBegin(x2, INSERT_VALUES, SCATTER_FORWARD);
> VecGhostUpdateEnd(x2, INSERT_VALUES, SCATTER_FORWARD);
>
> Is there a rationale for this behavior? I would suggest to add a note
> to the VecCopy man page about it.
>

VecCopy works for all vector types, and thus does not get extra information
for
a specific type, and a Vec is defined by the global values, not local
copies. Moreover,
although VecGhost is available, the recommended paradigm is to use local
Vecs and
GlobalToLocal().

   Matt


> Thanks
> Dominik
>



-- 
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their
experiments lead.
-- Norbert Wiener
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20120422/045f06bf/attachment.htm>


More information about the petsc-users mailing list