Barry Smith bsmith at
Thu Apr 2 17:01:04 CDT 2009

On Apr 2, 2009, at 2:59 PM, Matthew Knepley wrote:

> On Thu, Apr 2, 2009 at 2:46 PM, Khan, Irfan <irfan.khan at>  
> wrote:
> Does VecSwap() copy ghost entries too. i.e. if I have two similar  
> parallel ghosted vectors, then swaping them using VecSwap(), would  
> it also swap the local ghost entries of the two vectors?
> It doesn't seem to do so, please let me know if I am wrong.
> No, VecSwap() does not swap ghost values as it is intended to be  
> purely local. You can call GhostUpdate()
> afterwards to get this behavior.

    Or you can use VecGetLocalRepresentation() and do the swap on that.

>   Matt
> Thank you
> Irfan
> -- 
> 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

More information about the petsc-users mailing list