<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><br class="webkit-block-placeholder"></div> Mehdi,<div><br class="webkit-block-placeholder"></div><div> This functionality is now in PETSc-dev called DAGetNeighbors(), I think you should be able</div><div>to use that and remove your code to compute the neighbors.</div><div><br class="webkit-block-placeholder"></div><div> Barry</div><div><br class="webkit-block-placeholder"></div><div><br class="webkit-block-placeholder"></div><div><br><div><div>On Feb 7, 2008, at 4:36 PM, Mehdi Bostandoost wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>Hi</div> <div>I am working on Navier stokes equation and lagrangian particles using Petsc.I am done with the main code.I had the same problem that you described, so for this code,I already wrote couple of subroutine that take care of this issue for DA objects. but it will be really a good addition to petsc,if they can add that. </div> <div> </div> <div>here is the subroutine(I dont have this subroutine in my code like this.I just copy and paste different part of it from different part of my code to make an example).</div> <div> </div><font size="2"> </font><div><b><font color="#0000ff" size="2">subroutine</font></b><font color="#0000ff" size="2"></font><font size="2"> findneighbours </font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">implicit none</font></b></div><b><font color="#0000ff" size="2"></font></b><font color="#0000ff" size="2"></font><font size="2"> <div></div></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">integer</font></b><font color="#0000ff" size="2"></font><font size="2"> :: domainsize</font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">integer</font></b><font color="#0000ff" size="2"></font><font size="2"> :: rank</font></div><font size="2"> <div></div></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">integer</font></b><font color="#0000ff" size="2"></font><font size="2"> :: xs,xe,xm</font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">integer</font></b><font color="#0000ff" size="2"></font><font size="2"> :: gxs,gxe,gxm</font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">integer</font></b><font color="#0000ff" size="2"></font><font size="2"> :: ys,ye,ym</font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">integer</font></b><font color="#0000ff" size="2"></font><font size="2"> :: gys,gye,gym</font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">integer</font></b><font color="#0000ff" size="2"></font><font size="2"> :: zs,ze,zm</font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">integer</font></b><font color="#0000ff" size="2"></font><font size="2"> :: gzs,gze,gzm</font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">integer</font></b><font color="#0000ff" size="2"></font><font size="2"> :: xsl,ysl,zsl </font><font color="#008000" size="2">! local index beginning</font></div><font color="#008000" size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">integer</font></b><font color="#0000ff" size="2"></font><font size="2"> :: xel,yel,zel </font><font color="#008000" size="2">! local index ending</font></div><font color="#008000" size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">integer</font></b><font color="#0000ff" size="2"></font><font size="2">,</font><b><font color="#0000ff" size="2">allocatable</font></b><font color="#0000ff" size="2"></font><font size="2">:: xsdomains(:)</font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">integer</font></b><font color="#0000ff" size="2"></font><font size="2">,</font><b><font color="#0000ff" size="2">allocatable</font></b><font color="#0000ff" size="2"></font><font size="2">:: xedomains(:)</font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">integer</font></b><font color="#0000ff" size="2"></font><font size="2">,</font><b><font color="#0000ff" size="2">allocatable</font></b><font color="#0000ff" size="2"></font><font size="2">:: ysdomains(:)</font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">integer</font></b><font color="#0000ff" size="2"></font><font size="2">,</font><b><font color="#0000ff" size="2">allocatable</font></b><font color="#0000ff" size="2"></font><font size="2">:: yedomains(:)</font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">integer</font></b><font color="#0000ff" size="2"></font><font size="2">,</font><b><font color="#0000ff" size="2">allocatable</font></b><font color="#0000ff" size="2"></font><font size="2">:: zsdomains(:)</font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">integer</font></b><font color="#0000ff" size="2"></font><font size="2">,</font><b><font color="#0000ff" size="2">allocatable</font></b><font color="#0000ff" size="2"></font><font size="2">:: zedomains(:)</font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">integer</font></b><font color="#0000ff" size="2"></font><font size="2">::xleftdomainrank</font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">integer</font></b><font color="#0000ff" size="2"></font><font size="2">::yleftdomainrank</font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">integer</font></b><font color="#0000ff" size="2"></font><font size="2">::zleftdomainrank</font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">integer</font></b><font color="#0000ff" size="2"></font><font size="2">::xrightdomainrank</font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">integer</font></b><font color="#0000ff" size="2"></font><font size="2">::yrightdomainrank</font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">integer</font></b><font color="#0000ff" size="2"></font><font size="2">::zrightdomainrank</font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">integer</font></b><font color="#0000ff" size="2"></font><font size="2">::nprocx</font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">integer</font></b><font color="#0000ff" size="2"></font><font size="2">::nprocy</font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">integer</font></b><font color="#0000ff" size="2"></font><font size="2">::nprocz </font></div><font size="2"> <div></div></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">integer</font></b><font color="#0000ff" size="2"></font><font size="2">::nx=25</font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">integer</font></b><font color="#0000ff" size="2"></font><font size="2">::ny=35</font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">integer</font></b><font color="#0000ff" size="2"></font><font size="2">::nz=45 </font></div><font size="2"> <div></div></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">integer</font></b><font color="#0000ff" size="2"></font><font size="2">::dof1=3</font></div><font size="2"> <div></div></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">integer</font></b><font color="#0000ff" size="2"></font><font size="2">::s=4</font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">integer</font></b><font color="#0000ff" size="2"></font><font size="2"> :: ierr</font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">integer</font></b><font color="#0000ff" size="2"></font><font size="2"> :: i</font></div><font size="2"> <div></div></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">call</font></b><font color="#0000ff" size="2"></font><font size="2"> PetscInitialize(PETSC_NULL_CHARACTER,ierr)</font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2">CHKERRQ(ierr) </font></div><font size="2"> </font><div><font color="#008000" size="2">!------------------------------------- </font></div><font color="#008000" size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">call</font></b><font color="#0000ff" size="2"></font><font size="2"> MPI_Comm_size(PETSC_COMM_WORLD,domainsize,ierr)</font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2">CHKERRQ(ierr)</font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">call</font></b><font color="#0000ff" size="2"></font><font size="2"> MPI_Comm_rank(PETSC_COMM_WORLD,rank,ierr)</font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2">CHKERRQ(ierr) </font></div><font size="2"> <div></div> </font><div><font color="#008000" size="2">!------------------------------------- </font></div><font color="#008000" size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">ALLOCATE</font></b><font color="#0000ff" size="2"></font><font size="2">(xsdomains(domainsize),STAT=status)</font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">if</font></b><font color="#0000ff" size="2"></font><font size="2">(status/=0)</font><b><font color="#0000ff" size="2">then</font></b></div><b><font color="#0000ff" size="2"></font></b><font color="#0000ff" size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">write</font></b><font color="#0000ff" size="2"></font><font size="2">(logfile,*) 'memory allocation problem xsdomain'</font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">call</font></b><font color="#0000ff" size="2"></font><font size="2"> programabort</font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">endif</font></b></div><b><font color="#0000ff" size="2"></font></b><font color="#0000ff" size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2">xsdomains(:)=-10</font></div><font size="2"> </font><div><font color="#008000" size="2">!-------------------------------------</font></div><font color="#008000" size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">ALLOCATE</font></b><font color="#0000ff" size="2"></font><font size="2">(xedomains(domainsize),STAT=status)</font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">if</font></b><font color="#0000ff" size="2"></font><font size="2">(status/=0)</font><b><font color="#0000ff" size="2">then</font></b></div><b><font color="#0000ff" size="2"></font></b><font color="#0000ff" size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">write</font></b><font color="#0000ff" size="2"></font><font size="2">(logfile,*) 'memory allocation problem xedomain'</font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">call</font></b><font color="#0000ff" size="2"></font><font size="2"> programabort</font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">endif</font></b></div><b><font color="#0000ff" size="2"></font></b><font color="#0000ff" size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2">xedomains(:)=-10</font></div><font size="2"> </font><div><font color="#008000" size="2">!-------------------------------------</font></div><font color="#008000" size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">ALLOCATE</font></b><font color="#0000ff" size="2"></font><font size="2">(ysdomains(domainsize),STAT=status)</font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">if</font></b><font color="#0000ff" size="2"></font><font size="2">(status/=0)</font><b><font color="#0000ff" size="2">then</font></b></div><b><font color="#0000ff" size="2"></font></b><font color="#0000ff" size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">write</font></b><font color="#0000ff" size="2"></font><font size="2">(logfile,*) 'memory allocation problem ysdomain'</font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">call</font></b><font color="#0000ff" size="2"></font><font size="2"> programabort</font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">endif</font></b></div><b><font color="#0000ff" size="2"></font></b><font color="#0000ff" size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2">ysdomains(:)=-10</font></div><font size="2"> </font><div><font color="#008000" size="2">!-------------------------------------</font></div><font color="#008000" size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">ALLOCATE</font></b><font color="#0000ff" size="2"></font><font size="2">(yedomains(domainsize),STAT=status)</font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">if</font></b><font color="#0000ff" size="2"></font><font size="2">(status/=0)</font><b><font color="#0000ff" size="2">then</font></b></div><b><font color="#0000ff" size="2"></font></b><font color="#0000ff" size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">write</font></b><font color="#0000ff" size="2"></font><font size="2">(logfile,*) 'memory allocation problem yedomain'</font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">call</font></b><font color="#0000ff" size="2"></font><font size="2"> programabort</font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">endif</font></b></div><b><font color="#0000ff" size="2"></font></b><font color="#0000ff" size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2">yedomains(:)=-10</font></div><font size="2"> </font><div><font color="#008000" size="2">!-------------------------------------</font></div><font color="#008000" size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">ALLOCATE</font></b><font color="#0000ff" size="2"></font><font size="2">(zsdomains(domainsize),STAT=status)</font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">if</font></b><font color="#0000ff" size="2"></font><font size="2">(status/=0)</font><b><font color="#0000ff" size="2">then</font></b></div><b><font color="#0000ff" size="2"></font></b><font color="#0000ff" size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">write</font></b><font color="#0000ff" size="2"></font><font size="2">(logfile,*) 'memory allocation problem zsdomain'</font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">call</font></b><font color="#0000ff" size="2"></font><font size="2"> programabort</font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">endif</font></b></div><b><font color="#0000ff" size="2"></font></b><font color="#0000ff" size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2">zsdomains(:)=-10</font></div><font size="2"> </font><div><font color="#008000" size="2">!-------------------------------------</font></div><font color="#008000" size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">ALLOCATE</font></b><font color="#0000ff" size="2"></font><font size="2">(zedomains(domainsize),STAT=status)</font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">if</font></b><font color="#0000ff" size="2"></font><font size="2">(status/=0)</font><b><font color="#0000ff" size="2">then</font></b></div><b><font color="#0000ff" size="2"></font></b><font color="#0000ff" size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">write</font></b><font color="#0000ff" size="2"></font><font size="2">(logfile,*) 'memory allocation problem zedomain'</font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">call</font></b><font color="#0000ff" size="2"></font><font size="2"> programabort</font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">endif</font></b></div><b><font color="#0000ff" size="2"></font></b><font color="#0000ff" size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2">zedomains(:)=-10</font></div><font size="2"> </font><div><font color="#008000" size="2">!------------------------------------- </font></div><font color="#008000" size="2"></font><font size="2"> <div></div></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">call</font></b><font color="#0000ff" size="2"></font><font size="2"> DACreate3d(PETSC_COMM_WORLD,DA_NONPERIODIC,DA_STENCIL_BOX,</font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font color="#ffffff" size="2">&</font><font size="2"> nx,ny,nz,PETSC_DECIDE,PETSC_DECIDE,PETSC_DECIDE,</font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font color="#ffffff" size="2">&</font><font size="2"> dof1,s, </font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font color="#ffffff" size="2">&</font><font size="2"> PETSC_NULL_INTEGER,PETSC_NULL_INTEGER, </font><font color="#008000" size="2"></font></div><font color="#008000" size="2"></font><font color="#ff0000" size="2"> </font><div><font color="#ffffff" size="2">&</font><font size="2"> PETSC_NULL_INTEGER,daa,ierr) </font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2">CHKERRQ(ierr) </font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">call</font></b><font color="#0000ff" size="2"></font><font size="2"> DAGetCorners(daa,xs,ys,zs,xm,ym,zm,ierr)</font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2">CHKERRQ(ierr) </font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">call</font></b><font color="#0000ff" size="2"></font><font size="2"> DAGetGhostCorners(daa,gxs,gys,gzs,gxm,gym,gzm,ierr)</font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2">CHKERRQ(ierr) </font></div><font size="2"> </font><div><font color="#008000" size="2">!------------------------------------- </font></div><font color="#008000" size="2"></font><font size="2"> <div></div> </font><div><font color="#008000" size="2">!**************************************** </font></div><font color="#008000" size="2"></font><font size="2"> </font><div><font color="#008000" size="2">! finding the neighbors</font></div><font color="#008000" size="2"></font><font size="2"> </font><div><font color="#008000" size="2">!**************************************** </font></div><font color="#008000" size="2"></font><font size="2"> <div></div></font><font color="#ff0000" size="2"> </font><div><font size="2">xsdomains(rank+1)=xs</font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">call</font></b><font color="#0000ff" size="2"></font><font size="2"> MPI_ALLGATHER(xs,1,MPI_INTEGER, </font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font color="#ffffff" size="2">&</font><font size="2"> xsdomains ,1,MPI_INTEGER, </font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font color="#ffffff" size="2">&</font><font size="2"> PETSC_COMM_WORLD,ierr)</font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2">CHKERRQ(ierr) </font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">call</font></b><font color="#0000ff" size="2"></font><font size="2"> MPI_ALLGATHER(xe,1,MPI_INTEGER, </font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font color="#ffffff" size="2">&</font><font size="2"> xedomains ,1,MPI_INTEGER, </font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font color="#ffffff" size="2">&</font><font size="2"> PETSC_COMM_WORLD,ierr)</font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2">CHKERRQ(ierr) </font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">call</font></b><font color="#0000ff" size="2"></font><font size="2"> MPI_ALLGATHER(ys,1,MPI_INTEGER, </font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font color="#ffffff" size="2">&</font><font size="2"> ysdomains ,1,MPI_INTEGER, </font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font color="#ffffff" size="2">&</font><font size="2"> PETSC_COMM_WORLD,ierr)</font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2">CHKERRQ(ierr) </font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">call</font></b><font color="#0000ff" size="2"></font><font size="2"> MPI_ALLGATHER(ye,1,MPI_INTEGER, </font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font color="#ffffff" size="2">&</font><font size="2"> yedomains ,1,MPI_INTEGER, </font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font color="#ffffff" size="2">&</font><font size="2"> PETSC_COMM_WORLD,ierr)</font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2">CHKERRQ(ierr) </font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">call</font></b><font color="#0000ff" size="2"></font><font size="2"> MPI_ALLGATHER(zs,1,MPI_INTEGER, </font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font color="#ffffff" size="2">&</font><font size="2"> zsdomains ,1,MPI_INTEGER, </font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font color="#ffffff" size="2">&</font><font size="2"> PETSC_COMM_WORLD,ierr)</font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2">CHKERRQ(ierr) </font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">call</font></b><font color="#0000ff" size="2"></font><font size="2"> MPI_ALLGATHER(ze,1,MPI_INTEGER, </font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font color="#ffffff" size="2">&</font><font size="2"> zedomains ,1,MPI_INTEGER, </font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font color="#ffffff" size="2">&</font><font size="2"> PETSC_COMM_WORLD,ierr)</font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2">CHKERRQ(ierr)</font></div><font size="2"> <div> </div></font><font color="#ff0000" size="2"> </font><div><font size="2">xleftdomainrank=-10</font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2">yleftdomainrank=-10</font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2">zleftdomainrank=-10</font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2">xrightdomainrank=-10</font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2">yrightdomainrank=-10</font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2">zrightdomainrank=-10</font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">do</font></b><font color="#0000ff" size="2"></font><font size="2"> i=1,domainsize</font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">if</font></b><font color="#0000ff" size="2"></font><font size="2">(xs==1)</font><b><font color="#0000ff" size="2">then</font></b></div><b><font color="#0000ff" size="2"></font></b><font color="#0000ff" size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2">xleftdomainrank=-10</font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">endif</font></b></div><b><font color="#0000ff" size="2"></font></b><font color="#0000ff" size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">if</font></b><font color="#0000ff" size="2"></font><font size="2">(ys==1)</font><b><font color="#0000ff" size="2">then</font></b></div><b><font color="#0000ff" size="2"></font></b><font color="#0000ff" size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2">yleftdomainrank=-10</font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">endif</font></b></div><b><font color="#0000ff" size="2"></font></b><font color="#0000ff" size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">if</font></b><font color="#0000ff" size="2"></font><font size="2">(zs==1)</font><b><font color="#0000ff" size="2">then</font></b></div><b><font color="#0000ff" size="2"></font></b><font color="#0000ff" size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2">zleftdomainrank=-10</font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">endif</font></b></div><b><font color="#0000ff" size="2"></font></b><font color="#0000ff" size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">if</font></b><font color="#0000ff" size="2"></font><font size="2">(xe==nx)</font><b><font color="#0000ff" size="2">then</font></b></div><b><font color="#0000ff" size="2"></font></b><font color="#0000ff" size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2">xrightdomainrank=-10</font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">endif</font></b></div><b><font color="#0000ff" size="2"></font></b><font color="#0000ff" size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">if</font></b><font color="#0000ff" size="2"></font><font size="2">(ye==ny)</font><b><font color="#0000ff" size="2">then</font></b></div><b><font color="#0000ff" size="2"></font></b><font color="#0000ff" size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2">yrightdomainrank=-10</font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">endif</font></b></div><b><font color="#0000ff" size="2"></font></b><font color="#0000ff" size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">if</font></b><font color="#0000ff" size="2"></font><font size="2">(ze==nz)</font><b><font color="#0000ff" size="2">then</font></b></div><b><font color="#0000ff" size="2"></font></b><font color="#0000ff" size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2">zrightdomainrank=-10</font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">endif</font></b></div><b><font color="#0000ff" size="2"></font></b><font color="#0000ff" size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">enddo</font></b></div><b><font color="#0000ff" size="2"></font></b><font color="#0000ff" size="2"> <div> </div></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">do</font></b><font color="#0000ff" size="2"></font><font size="2"> i=1,domainsize</font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">if</font></b><font color="#0000ff" size="2"></font><font size="2">((xs-1)==xedomains(i) .and. </font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font color="#ffffff" size="2">&</font><font size="2"> ys==ysdomains(i) .and. ye==yedomains(i) .and.</font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font color="#ffffff" size="2">&</font><font size="2"> zs==zsdomains(i) .and. ze==zedomains(i)</font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font color="#ffffff" size="2">&</font><font size="2"> )</font><b><font color="#0000ff" size="2">then</font></b></div><b><font color="#0000ff" size="2"></font></b><font color="#0000ff" size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2">xleftdomainrank=i-1</font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">endif</font></b></div><b><font color="#0000ff" size="2"></font></b><font color="#0000ff" size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">if</font></b><font color="#0000ff" size="2"></font><font size="2">((ys-1)==yedomains(i) .and. </font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font color="#ffffff" size="2">&</font><font size="2"> xs==xsdomains(i) .and. xe==xedomains(i) .and.</font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font color="#ffffff" size="2">&</font><font size="2"> zs==zsdomains(i) .and. ze==zedomains(i)</font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font color="#ffffff" size="2">&</font><font size="2"> )</font><b><font color="#0000ff" size="2">then</font></b></div><b><font color="#0000ff" size="2"></font></b><font color="#0000ff" size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2">yleftdomainrank=i-1</font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">endif</font></b></div><b><font color="#0000ff" size="2"></font></b><font color="#0000ff" size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">if</font></b><font color="#0000ff" size="2"></font><font size="2">((zs-1)==zedomains(i) .and. </font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font color="#ffffff" size="2">&</font><font size="2"> xs==xsdomains(i) .and. xe==xedomains(i) .and.</font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font color="#ffffff" size="2">&</font><font size="2"> ys==ysdomains(i) .and. ye==yedomains(i)</font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font color="#ffffff" size="2">&</font><font size="2"> )</font><b><font color="#0000ff" size="2">then</font></b></div><b><font color="#0000ff" size="2"></font></b><font color="#0000ff" size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2">zleftdomainrank=i-1</font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">endif</font></b></div><b><font color="#0000ff" size="2"></font></b><font color="#0000ff" size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">enddo</font></b></div><b><font color="#0000ff" size="2"></font></b><font color="#0000ff" size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">do</font></b><font color="#0000ff" size="2"></font><font size="2"> i=1,domainsize</font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">if</font></b><font color="#0000ff" size="2"></font><font size="2">((xe+1)==xsdomains(i) .and.</font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font color="#ffffff" size="2">&</font><font size="2"> ys==ysdomains(i) .and. ye==yedomains(i) .and.</font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font color="#ffffff" size="2">&</font><font size="2"> zs==zsdomains(i) .and. ze==zedomains(i)</font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font color="#ffffff" size="2">&</font><font size="2"> )</font><b><font color="#0000ff" size="2">then</font></b></div><b><font color="#0000ff" size="2"></font></b><font color="#0000ff" size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2">xrightdomainrank=i-1</font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">endif</font></b></div><b><font color="#0000ff" size="2"></font></b><font color="#0000ff" size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">if</font></b><font color="#0000ff" size="2"></font><font size="2">((ye+1)==ysdomains(i) .and.</font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font color="#ffffff" size="2">&</font><font size="2"> xs==xsdomains(i) .and. xe==xedomains(i) .and.</font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font color="#ffffff" size="2">&</font><font size="2"> zs==zsdomains(i) .and. ze==zedomains(i)</font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font color="#ffffff" size="2">&</font><font size="2"> )</font><b><font color="#0000ff" size="2">then</font></b></div><b><font color="#0000ff" size="2"></font></b><font color="#0000ff" size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2">yrightdomainrank=i-1</font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">endif</font></b></div><b><font color="#0000ff" size="2"></font></b><font color="#0000ff" size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">if</font></b><font color="#0000ff" size="2"></font><font size="2">((ze+1)==zsdomains(i) .and.</font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font color="#ffffff" size="2">&</font><font size="2"> xs==xsdomains(i) .and. xe==xedomains(i) .and.</font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font color="#ffffff" size="2">&</font><font size="2"> ys==ysdomains(i) .and. ye==yedomains(i)</font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font color="#ffffff" size="2">&</font><font size="2"> )</font><b><font color="#0000ff" size="2">then</font></b></div><b><font color="#0000ff" size="2"></font></b><font color="#0000ff" size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2">zrightdomainrank=i-1</font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">endif</font></b></div><b><font color="#0000ff" size="2"></font></b><font color="#0000ff" size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">enddo</font></b></div><b><font color="#0000ff" size="2"></font></b><font color="#0000ff" size="2"></font><font size="2"> </font><div><font color="#008000" size="2">!**************************************** </font></div><font color="#008000" size="2"></font><font size="2"> </font><div><font color="#008000" size="2">! end of finding the neighbors</font></div><font color="#008000" size="2"></font><font size="2"> </font><div><font color="#008000" size="2">!**************************************** </font></div><font color="#008000" size="2"> <div> </div></font><font size="2"> </font><div><font color="#008000" size="2">!-------------------------------------</font></div><font color="#008000" size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">DEALLOCATE</font></b><font color="#0000ff" size="2"></font><font size="2">(xsdomains,STAT=status)</font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">if</font></b><font color="#0000ff" size="2"></font><font size="2">(status/=0)</font><b><font color="#0000ff" size="2">then</font></b></div><b><font color="#0000ff" size="2"></font></b><font color="#0000ff" size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">write</font></b><font color="#0000ff" size="2"></font><font size="2">(logfile,*) 'memory deallocation problem'</font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">call</font></b><font color="#0000ff" size="2"></font><font size="2"> programabort</font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">endif</font></b></div><b><font color="#0000ff" size="2"></font></b><font color="#0000ff" size="2"></font><font size="2"> </font><div><font color="#008000" size="2">!-------------------------------------</font></div><font color="#008000" size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">DEALLOCATE</font></b><font color="#0000ff" size="2"></font><font size="2">(xedomains,STAT=status)</font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">if</font></b><font color="#0000ff" size="2"></font><font size="2">(status/=0)</font><b><font color="#0000ff" size="2">then</font></b></div><b><font color="#0000ff" size="2"></font></b><font color="#0000ff" size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">write</font></b><font color="#0000ff" size="2"></font><font size="2">(logfile,*) 'memory deallocation problem'</font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">call</font></b><font color="#0000ff" size="2"></font><font size="2"> programabort</font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">endif</font></b></div><b><font color="#0000ff" size="2"></font></b><font color="#0000ff" size="2"></font><font size="2"> </font><div><font color="#008000" size="2">!-------------------------------------</font></div><font color="#008000" size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">DEALLOCATE</font></b><font color="#0000ff" size="2"></font><font size="2">(ysdomains,STAT=status)</font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">if</font></b><font color="#0000ff" size="2"></font><font size="2">(status/=0)</font><b><font color="#0000ff" size="2">then</font></b></div><b><font color="#0000ff" size="2"></font></b><font color="#0000ff" size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">write</font></b><font color="#0000ff" size="2"></font><font size="2">(logfile,*) 'memory deallocation problem'</font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">call</font></b><font color="#0000ff" size="2"></font><font size="2"> programabort</font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">endif</font></b></div><b><font color="#0000ff" size="2"></font></b><font color="#0000ff" size="2"></font><font size="2"> </font><div><font color="#008000" size="2">!-------------------------------------</font></div><font color="#008000" size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">DEALLOCATE</font></b><font color="#0000ff" size="2"></font><font size="2">(yedomains,STAT=status)</font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">if</font></b><font color="#0000ff" size="2"></font><font size="2">(status/=0)</font><b><font color="#0000ff" size="2">then</font></b></div><b><font color="#0000ff" size="2"></font></b><font color="#0000ff" size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">write</font></b><font color="#0000ff" size="2"></font><font size="2">(logfile,*) 'memory deallocation problem'</font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">call</font></b><font color="#0000ff" size="2"></font><font size="2"> programabort</font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">endif</font></b></div><b><font color="#0000ff" size="2"></font></b><font color="#0000ff" size="2"></font><font size="2"> </font><div><font color="#008000" size="2">!-------------------------------------</font></div><font color="#008000" size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">DEALLOCATE</font></b><font color="#0000ff" size="2"></font><font size="2">(zsdomains,STAT=status)</font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">if</font></b><font color="#0000ff" size="2"></font><font size="2">(status/=0)</font><b><font color="#0000ff" size="2">then</font></b></div><b><font color="#0000ff" size="2"></font></b><font color="#0000ff" size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">write</font></b><font color="#0000ff" size="2"></font><font size="2">(logfile,*) 'memory deallocation problem'</font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">call</font></b><font color="#0000ff" size="2"></font><font size="2"> programabort</font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">endif</font></b></div><b><font color="#0000ff" size="2"></font></b><font color="#0000ff" size="2"></font><font size="2"> </font><div><font color="#008000" size="2">!-------------------------------------</font></div><font color="#008000" size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">DEALLOCATE</font></b><font color="#0000ff" size="2"></font><font size="2">(zedomains,STAT=status)</font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">if</font></b><font color="#0000ff" size="2"></font><font size="2">(status/=0)</font><b><font color="#0000ff" size="2">then</font></b></div><b><font color="#0000ff" size="2"></font></b><font color="#0000ff" size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">write</font></b><font color="#0000ff" size="2"></font><font size="2">(logfile,*) 'memory deallocation problem'</font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">call</font></b><font color="#0000ff" size="2"></font><font size="2"> programabort</font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">endif</font></b></div><b><font color="#0000ff" size="2"></font></b><font color="#0000ff" size="2"></font><font size="2"> </font><div><font color="#008000" size="2">!-------------------------------------</font></div><font color="#008000" size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">call</font></b><font color="#0000ff" size="2"></font><font size="2"> DADestroy(daa,ierr)</font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">call</font></b><font color="#0000ff" size="2"></font><font size="2"> PetscFinalize(ierr)</font></div><font size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">return</font></b></div><b><font color="#0000ff" size="2"></font></b><font color="#0000ff" size="2"></font><font color="#ff0000" size="2"> </font><div><font size="2"></font><b><font color="#0000ff" size="2">end</font></b><font color="#0000ff" size="2"></font><font size="2"> </font></div> <div><font size="2"></font> </div> <div><font size="2">I hope it will be helpful.if you have question come back to me.</font></div> <div><font size="2"></font> </div> <div><font size="2">Best Regard</font></div> <div><font size="2"></font> </div> <div><font size="2">Mehdi</font></div><font size="2"></font> <div> </div> <div><br><br><b><i>Barry Smith <<a href="mailto:bsmith@mcs.anl.gov">bsmith@mcs.anl.gov</a>></i></b> wrote:</div> <blockquote class="replbq" style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid"><br>On Feb 6, 2008, at 6:38 AM, Tobias Kempe wrote:<br><br>> Hi Barry,<br>><br>> i have to propose you an additional PETSc feature that could <br>> interesting for<br>> some users. In our lagrangian particle tracking it is neccessary to <br>> send the<br>> particle data to some specific processor - the new particle "master<br>> processor" which performs the evaluation of the equations of motion <br>> for this<br>> particle.<br>><br>> In general we can do this with the MPI_isend, MPI_irecv routines.<br>><br>> In the PETSc environment this may be realized by an MPI_vector<br><br>Do you mean a PETSc vector of type VECMPI, that is a parallel Vec?<br><br>> with different<br>> numer of entrys on each processor. The entrys of this MPI_vector may <br>> be<br>> adressed by its index and the rank of the processor where you wish <br>> to set<br>> the value.<br><br>Do you mean something like<br><br>VecSetValues(vec,n,ranks,localindices,values)<br><br>where ranks[n], localindices[n], values[n]? Much like VecSetValues() <br>with the "global indices"<br>replaced with ranks,localindices?<br><br>Or do you want something more like a VecScatter operation where the <br>"global indices"<br>are replaced with ranks,localindices<br><br>Barry<br><br>><br>><br>> Perhaps it is possible to realize this feature in following petsc <br>> releases.<br>><br>> Best regards,<br>><br>> Tobias<br>><br>><br>><br>><br>> Am Samstag 02 Februar 2008 schrieben Sie:<br>>> Tobias,<br>>><br>>> I have added DAGetNeighbors(). You will need to use petsc-dev<br>>> see the developers<br>>> page link from <a href="http://www.mcs.anl.gov/petsc">www.mcs.anl.gov/petsc</a><br>>><br>>> Please let us know if you have any troubles.<br>>><br>>> Barry<br>>><br>>> On Feb 1, 2008, at 3:00 AM, Tobias Kempe wrote:<br>>>> Hi PETSc team,<br>>>><br>>>> we are using distributed arrays for the communication of the<br>>>> processors in our<br>>>> domain decomposition. Nomally the user dont has to worry obout the<br>>>> rank of<br>>>> the neighboring processors. Now we wont to compute large amounts of<br>>>> particles<br>>>> in viscous fluids. The problem is when a particle leaves the <br>>>> physical<br>>>> domain, an other processer becomes the "master" of this particle.<br>>>> With the<br>>>> backround of this lagrangian particle tracking it becomes neccesarry<br>>>> to<br>>>> determine the ranks of the neighboring processors in order to send<br>>>> particle<br>>>> specific data to this processors.<br>>>><br>>>> Is there some PETSc routine to dertermine the rank of the <br>>>> neighboring<br>>>> processors in the east, west, front ..... and so on?<br>>>><br>>>> Thank you very much.<br>>>><br>>>> Best regards<br>>>><br>>>> Tobias Kempe<br>>>><br>>>><br>>>><br>>>><br>>>> *****************************************************<br>>>> Dipl.-Ing. Tobias Kempe<br>>>> Technische Universit?? Dresden<br>>>> Institut f?? Str??ungsmechanik<br>>>> Tel.: 0351-46336651<br>>>> Fax: 0351-46335246<br>>>> E-Mail: <a href="mailto:tobias.kempe@ism.mw.tu-dresden.de">tobias.kempe@ism.mw.tu-dresden.de</a><br>>>> *****************************************************<br>><br>><br>><br>> -- <br>> *****************************************************<br>> Dipl.-Ing. Tobias Kempe<br>> Technische Universit?? Dresden<br>> Institut f?? Str??ungsmechanik<br>> Tel.: 0351-46336651<br>> Fax: 0351-46335246<br>> E-Mail: <a href="mailto:tobias.kempe@ism.mw.tu-dresden.de">tobias.kempe@ism.mw.tu-dresden.de</a><br>> *****************************************************<br>><br><br></blockquote><br><div> <br class="webkit-block-placeholder"></div><hr size="1">Looking for last minute shopping deals? <a href="http://us.rd.yahoo.com/evt=51734/*http://tools.search.yahoo.com/newsearch/category.php?category=shopping"> Find them fast with Yahoo! Search.</a></blockquote></div><br></div></body></html>