[petsc-users] VecGetArray and use it for VecCreateSeqWithArray
Hui Zhang
mike.hui.zhang at hotmail.com
Wed Apr 24 11:02:23 CDT 2013
On Apr 24, 2013, at 5:58 PM, Hui Zhang 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.
> This is for VecScatterCreate from a global Vec to the local Seq v,
Note that the global Vec to scatter is COMM_WORLD, but the communicator of u is smaller.
> and then I hope that u get updated as well automatically.
>
> Thanks in advance!
>
More information about the petsc-users
mailing list