<div dir="ltr">On Fri, Aug 23, 2013 at 9:35 AM, Olivier Bonnefon <span dir="ltr"><<a href="mailto:olivier.bonnefon@avignon.inra.fr" target="_blank">olivier.bonnefon@avignon.inra.fr</a>></span> wrote:<br><div class="gmail_extra">
<div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Hello,<br>
<br>
Thanks for your answers, I'm now able to import and distribute a mesh:<br></blockquote><div><br></div><div>You might simplify this to</div><div><br></div><div>if (rank) {obNbCells = 0; obNbVertex = 0;}</div><div>ierr = DMPlexCreateFromCellList(comm,<u></u>dim,obNbCells,obNbVertex,3,0,<u></u>obCells,2,obVertex,dm);<u></u>CHKERRQ(ierr);<br>
</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
if (!rank){<br>
        ierr = DMPlexCreateFromCellList(comm,<u></u>dim,obNbCells,obNbVertex,3,0,<u></u>obCells,2,obVertex,dm);<u></u>CHKERRQ(ierr);<br>
         for (i=0;i<obNbBound;i++){<br>
           ierr =DMPlexSetLabelValue(*dm, "marker", obBoundary[i]+obNbCells, 1);CHKERRQ(ierr);<br>
         }<br>
}else {<br>
          ierr = DMPlexCreateFromCellList(comm,<u></u>dim,0,0,3,0,obCells,2,<u></u>obVertex,dm);CHKERRQ(ierr);<br>
}<br>
<br>
ierr = DMPlexDistribute(*dm, partitioner, 0, &distributedMesh);CHKERRQ(<u></u>ierr);<br>
if (distributedMesh) {<br>
      ierr = DMDestroy(dm);CHKERRQ(ierr);<br>
      *dm  = distributedMesh;<br>
}<br>
<br>
Is it possible to known the resulting partition ? ie, What is the mapping between the initial cell number and the local cell (used in DMPlexComputeResidualFEM)?<br>
I need this to write an efficient implementation of the FEM struct functions f0 and g0, space depending.<br></blockquote><div><br></div><div>Yes, but I really do not think you want to do things that way. I am assuming you want different material models or something</div>
<div>in different places. The way I envision that is using a DMLabel to mark up parts of the domain. All labels are automatically</div><div>distributed with the mesh. Is that what you want?</div><div><br></div><div>  Thanks,</div>
<div><br></div><div>     Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
Regards,<br>
<br>
Olivier B<span class=""><font color="#888888"><br>
<br>
-- <br>
Olivier Bonnefon<br>
INRA PACA-Avignon, Unité BioSP<br>
Tel: <a href="tel:%2B33%20%280%294%2032%2072%2021%2058" value="+33432722158" target="_blank">+33 (0)4 32 72 21 58</a><br>
<br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br>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>