[petsc-users] transfer vector data diagonally on DA
Jed Brown
jedbrown at mcs.anl.gov
Mon Apr 2 00:07:09 CDT 2012
On Sun, Apr 1, 2012 at 22:01, khalid ashraf <khalid_eee at yahoo.com> wrote:
> I want to transfer vector data diagonally in the DA grid like
> for (k=zs; k<zs+zm; k++) {
> for (j=ys; j<ys+ym; j++) {
> for (i=xs; i<xs+xm; i++) {
> if(i!=mx-1 || j!=my-1 || k!=mz-1){
> u_new[k+1][j+1][i+1]=u[k][j][i];}
> }}}
>
> Could you please suggest the best way to do it minimizing interprocessor
> assignments.
>
Both are on the same DMDA?
Communicate U to Ulocal (DMGlobalToLocalBegin/End) using a BOX stencil with
width at least 1, get the global array u_new[][][] from UGlobalNew and the
local arrays u[][][] from Ulocal, then assign u_new[k][j][i] =
u[k-1][j-1][i-1].
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20120401/8a1be8b5/attachment.htm>
More information about the petsc-users
mailing list