<br><br><div class="gmail_quote">On Fri, Dec 10, 2010 at 4:56 PM, Jed Brown <span dir="ltr">&lt;<a href="mailto:jed@59a2.org">jed@59a2.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im"><div class="gmail_quote">On Sat, Dec 11, 2010 at 01:53, Matthew Knepley <span dir="ltr">&lt;<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div>What are you guys talking about? He is asking (&quot;global index for any given 3-d index&quot;) for a map</div><div><br></div><div>  (i, j, k) --&gt;  ((k*N + j)*M + i)*C + c</div><div><br>
</div><div>I can&#39;t imagine what you are searching for? The process which owns a given index does not involve a search.</div></blockquote></div><br></div><div>The &quot;global index&quot; is in the &quot;PETSc ordering&quot;.  He wants this index for an arbitrary (i,j,k) which are not in the ghosted patch of the current process.  You either have to store the full mapping, on search lx,ly,lz to locate the owner, then compute the index relative to that process.  I don&#39;t think that code exists in PETSc.  It wouldn&#39;t be too hard to write, but it&#39;s not the most beautiful thing to do.</div>

</blockquote></div><br><div>Mat, that&#39;s exactly came to my mind as the first solution. But I was hoping that I could avoid that. As you said it is not that hard to write that function, that&#39;s why I hoped that PETSc alread has that. </div>
<div>Thanks for your help, </div><div>Mohamad</div><div><br></div>