<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Nov 17, 2015 at 10:11 AM, Morten Nobel-Jørgensen <span dir="ltr"><<a href="mailto:mono@mek.dtu.dk" target="_blank">mono@mek.dtu.dk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">



<div style="word-wrap:break-word;color:rgb(0,0,0);font-size:14px;font-family:Calibri,sans-serif">
<div>After distributing a DMPlex it seems like my cells are appearing twice (or rather multiple cells maps onto the same vertices). </div></div></blockquote><div><br></div><div>Your code is creating the serial mesh on each process. You only want nonzero sizes on one proc.</div><div><br></div><div>You can see the mesh using -dm_view, and everything using -dm_view ::ascii_info_detail</div><div><br></div><div>  Thanks,</div><div><br></div><div>     Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word;color:rgb(0,0,0);font-size:14px;font-family:Calibri,sans-serif">
<div>I’m assuming the way I’m iterating the DMPlex is wrong. Essentially I iterate the DMPlex the following way after distribution (see code snippet below – or attached file). </div>
<div><br>
</div>
<div>A related problem; Since distribution of a DMPlex reorders the point indices, how to do I map between distributed point indices and the original point indices. </div>
<div><br>
</div>
<div>And a final question: After distributing a DMPlex, some of the vertices are shared and exists in multiple instances. When adding dofs to these, how I I know if dof is owned by the current instance or it is a ghost dof? </div>
<div><br>
</div>
<div>I hope someone can point me in the right direction :)</div>
<div><br>
</div>
<div>Kind regards, </div>
<div>Morten</div>
<div><br>
</div>
<div><br>
</div>
<div>Code snippet</div>
<div>
<pre style="background-color:rgb(255,255,255);font-family:Menlo;font-size:9pt"><pre style="font-family:Menlo;font-size:9pt">PetscInt from,to,dof,off;<br>DMPlexGetHeightStratum(dm, <span style="color:#0000ff">0</span>,&from, &to);<br><span style="color:#000080;font-weight:bold">for </span>(<span style="color:#000080;font-weight:bold">int </span>cellIndex=from;cellIndex<to;cellIndex++){<br>    <span style="color:#000080;font-weight:bold">const </span>PetscInt *edges;<br>    PetscInt       numEdges;<br>    DMPlexGetConeSize(dm, cellIndex, &numEdges);<br>    DMPlexGetCone(dm, cellIndex, &edges);<br>    <span style="color:#000080;font-weight:bold">for </span>(<span style="color:#000080;font-weight:bold">int </span>e = <span style="color:#0000ff">0</span>;e<numEdges;e++) {<br>        <span style="color:#000080;font-weight:bold">int </span>edgeIndex = edges[e];<br>        <span style="color:#000080;font-weight:bold">const </span>PetscInt *vertices;<br>        PetscInt       numVertices;<br>        DMPlexGetConeSize(dm, edgeIndex, &numVertices);<br>        DMPlexGetCone(dm, edgeIndex, &vertices);<br>        <span style="color:#000080;font-weight:bold">for </span>(<span style="color:#000080;font-weight:bold">int </span>v = <span style="color:#0000ff">0</span>;v<numVertices;v++){<br>            <span style="color:#000080;font-weight:bold">int </span>vertexIndex = vertices[v];<br></pre></pre>
</div>
<div>For a non distibuted mesh the top of the hasse diagram looks like this:</div>
<div>
<div>0 --> 2</div>
<div>0 --> 3</div>
<div>0 --> 4</div>
<div>1 --> 4</div>
<div>1 --> 5</div>
<div>1 --> 6</div>
</div>
<div><br>
</div>
<div>But when distributing (on two cores) it looks like this, where both cells maps to the same edges (true for both cores):</div>
<div>
<div>0 --> 11</div>
<div>0 --> 12</div>
<div>0 --> 13</div>
<div>1 --> 11</div>
<div>1 --> 12</div>
<div>1 --> 13</div>
</div>
<div><br>
</div>
<div><br>
</div>
<div>
<div></div>
</div>
</div>

</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener</div>
</div></div>