[petsc-users] creating a global vector of one particular field from a global vector created from multiple dof dmda

Matthew Knepley knepley at gmail.com
Thu Aug 8 06:43:20 CDT 2013


On Thu, Aug 8, 2013 at 6:32 AM, Bishesh Khanal <bisheshkh at gmail.com> wrote:

> Hi all,
> Let's say I have two DMDAs with identical size but with different dofs.
> E.g. da1 with dof=4;   da2 with dof=1;
> I have global vectors associated with each one of them, say, gv1 and gv2
> respectively.
> How can I copy/scatter values of one particular field from gv1 to gv2 ?
> Looking at the manual it seems I should be able to use sth like following:
> VecScatterCreate(Vec gv1, IS iGv1, Vec gv2, IS iGv2, VecScatter *ctx)
> VecScatterBegin(VecScatter ctx, Vec gv1,Vec gv2,
> INSERT_VALUES,SCATTER_FORWARD);
> But I do not know how to get the Index sets iGv1 and iGv2 in this case.
>

http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Vec/VecStrideGather.html

   Matt

-- 
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/20130808/86a71a27/attachment.html>


More information about the petsc-users mailing list