<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:arial, helvetica, sans-serif;font-size:12pt"><div><div>It doesn't seem like the problem is with the natural ordering. Since in Fig.9 of the manual,</div><div>the highest number of the grid should be the same(30 in fig. 9) for natural and petsc ordering.</div><div>But I get a lower number when I print it. </div><div><br></div><div>I also tried the petsc to natural conversion using the following code, </div><div><div> {</div><div><div> ia[0]=(PetscInt)((k)*(my)*(mx)+(j)*(mx)+(i));</div><div> AOPetscToApplication(ao,1,ia);</div><div> w_localptr[k][j][i] = ia[0];</div><div>PetscPrintf(PETSC_COMM_WORLD,"%d\n",ia[0]);</div><div>}</div><div>But this gives even lower number for the highest index.</div><div><br></div><div>Anyway my goal is to be able to determine the
global natural index of the </div><div>grid within the for loops in the following way:</div></div></div><div>for (k=zs; k<zs+zm; k++) {</div><div> for (j=ys; j<ys+ym; j++) {</div><div> for (i=xs; i<xs+xm; i++) {</div><div>natural_global_coordinate(k',j',i')=f(k,j,i);</div><div>if natural_global_coord[k'][j'][i'] > half of the grid along x {Do something}</div><div><div>if natural_global_coord[k'][j'][i'] > half of the grid along y {Do something}</div><div>etc..</div></div><div>}}} </div><div>Could you please suggest what would be the simplest way to achieve this. </div><div>Thanks in advance.</div><div><br></div><div><br></div><div><br></div></div><div style="position:fixed"></div>
</div><br>
</body></html>