[petsc-users] local row calculation in 3D

ilyas ilyas ilyascfd at gmail.com
Mon Apr 18 08:34:16 CDT 2011


Hi,

In ex14f.F in KSP, "row" variable is calculated either

349: do 30 j=ys,ys+ym-1
350: ...
351: do 40 i=xs,xs+xm-1
352:          row = i - gxs + (j - gys)*gxm + 1

or

442: do 50 j=ys,ys+ym-1
443: ...
444: row = (j - gys)*gxm + xs - gxs
445: do 60 i=xs,xs+xm-1
446:          row = row + 1

How can I calculate "row" in 3D ?

I tried this;

do k=zs,zs+zm-1
   do j=ys,ys+ym-1
      do i=xs,xs+xm-1

           row = i - gxs + (j - gys)*gxm + (k - gzs)*gxm*gym + 1

It does not work for certain number of processors.


Thanks,

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


More information about the petsc-users mailing list