[petsc-users] DAGetCorners; xs,ys,zs return 0 for all the processors

Jed Brown jed at 59A2.org
Thu Nov 25 02:37:21 CST 2010


What communicator did you create your DA on? Can you show us what that call
looks like?

Jed

On Nov 25, 2010 9:19 AM, "khalid ashraf" <khalid_eee at yahoo.com> wrote:

Hi,
     I am having trouble with writing to global vector indexes using DA .
I am using the following function to get the starting point of a particular
processor.

DAGetCorners(da,&xs,&ys,&zs,&xm,&ym,&zm);

And then use it to iterate through the global indices.
for (k=zs; k<zs+zm; k++) {
  for (j=ys; j<ys+ym; j++) {
  for (i=xs; i<xs+xm; i++){
if (i<(mx/2))  //left half of the grid
{
vector[k][j][i]=1;
} else
{vector[k][j][i]=0;
}
}
}
}

But when I run this on multiple processors, xs, ys and zs come out to be 0
for all the processors.
I expected them to be the starting point of the global DA index in a
particular processor.
 Could anyone tell me whats the problem ? Am I missing something here.
Thanks in advance.

Best regards.

Khalid
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20101125/f9ae9d0b/attachment.htm>


More information about the petsc-users mailing list