Thanks Barry for your help. <div>M<br><br><div class="gmail_quote">On Tue, Dec 14, 2010 at 6:12 AM, Barry Smith <span dir="ltr"><<a href="mailto:bsmith@mcs.anl.gov">bsmith@mcs.anl.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im"><br>
On Dec 14, 2010, at 4:15 AM, Mohamad M. Nasr-Azadani wrote:<br>
<br>
> Hi guys,<br>
><br>
> Is it possible to update the ghost values from a global to a local vector for distributed arrays when global and local vectors are not from the same DA, but the global vectors are the same?<br>
<br>
</div>Yes<br>
<div class="im"><br>
> This is the the code that I have, (the only difference between the two DA's is the width. So, I am assuming that any global vector created based on those are going to be the same)<br>
<br>
</div>Yes<br>
<div><div></div><div class="h5"><br>
<br>
><br>
> G_data is created based on DA_3D, whereas L_data2 is created based on DA_3D2.<br>
><br>
><br>
> Vec G_data, L_data;<br>
> Vec G_data2, L_data2;<br>
><br>
><br>
> ierr = DACreate3d(PCW, DA_NONPERIODIC, DA_STENCIL_STAR, NX, NY, NZ, PETSC_DECIDE, PETSC_DECIDE, PETSC_DECIDE, 1, width, PETSC_NULL, PETSC_NULL, PETSC_NULL, &DA_3D);<br>
> ierr = DACreate3d(PCW, DA_NONPERIODIC, DA_STENCIL_STAR, NX, NY, NZ, PETSC_DECIDE, PETSC_DECIDE, PETSC_DECIDE, 1, width+2, PETSC_NULL, PETSC_NULL, PETSC_NULL, &DA_3D2);<br>
><br>
> ierr = DACreateGlobalVector(DA_3D, &G_data); CHKERRQ(ierr);<br>
> ierr = DACreateLocalVector(DA_3D, &L_data); CHKERRQ(ierr);<br>
><br>
> ierr = DACreateGlobalVector(DA_3D2, &G_data2); CHKERRQ(ierr);<br>
> ierr = DACreateLocalVector(DA_3D2, &L_data2); CHKERRQ(ierr);<br>
><br>
> /* =====> Is this possible? */<br>
> ierr = DAGlobalToLocalBegin(DA_3D2, G_data, INSERT_VALUES, L_data2);CHKERRQ(ierr);<br>
> ierr = DAGlobalToLocalEnd(DA_3D2, G_data, INSERT_VALUES, L_data2);CHKERRQ(ierr);<br>
><br>
><br>
> Thanks,<br>
> Mohamad<br>
><br>
<br>
</div></div></blockquote></div><br></div>