[petsc-users] VecGetArray and use it for VecCreateSeqWithArray

Matthew Knepley knepley at gmail.com
Wed Apr 24 11:21:39 CDT 2013


On Wed, Apr 24, 2013 at 11:58 AM, Hui Zhang <mike.hui.zhang at hotmail.com>wrote:

> Vec u,v;
>
> VecCreateMPIAIJ(..,&u);
> VecGetArray(u,&a);
>
> VecCreateSeqWithArray(...,a,&v);
>
> Is this safe?  I want the VecSeq v to read and write local array of u.
>

Yes, this is fine.

   Matt


> This is for VecScatterCreate from a global Vec to the local Seq v,
> and then I hope that u get updated as well automatically.
>
> Thanks in advance!
>



-- 
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/20130424/11e9b2b0/attachment.html>


More information about the petsc-users mailing list