<div dir="ltr">On Wed, Aug 21, 2013 at 5:25 AM,  <span dir="ltr"><<a href="mailto:obonnefon@paca.inra.fr" target="_blank">obonnefon@paca.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">



<div style="font-family:Arial;font-size:14px">
<p>Hello,<br>
<br>
Hello,I found my bug: The indices of the points are offseted in the function DMPlexCreateFromCellList.<br>
Using the correct indicices in the  DMPlexSetLabelValue leads to the expected behaviour.<br></p></div></blockquote><div>Yes, here is how I organize point numbers by default:</div><div><br></div><div>[ 0                 - numCells):                         Cells</div>
<div>[nC               - nC+numVertices):            Vertices</div><div>[nC+nV        - nC+nV+numFaces):         Faces<br></div><div>[nC+nV+nF - nC+nV+nF+numEdges): Edges</div><div><br></div><div>The reason I do this is to preserve the representation of cell-vertex meshes inside of a mesh with faces and edges</div>
<div>added.</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">
<div style="font-family:Arial;font-size:14px"><p>
Thanks you.<br>
Olivier B<br>
<br>
Quoting <a href="mailto:obonnefon@paca.inra.fr" target="_blank">obonnefon@paca.inra.fr</a>:</p><div><div class="h5">
<blockquote style="border-left-width:2px;border-left-style:solid;border-left-color:blue;margin-left:2px;padding-left:12px" type="cite">
<p>Hello,<br>
<br>
Ok, I did it:<br>
    ierr = DMPlexCreateFromCellList(comm,dim,8,9,3,0,obcells,2,obvertex,dm);CHKERRQ(ierr);<br>
    for (i=0;i<obNbBound;i++){<br>
      ierr =DMPlexSetLabelValue(*dm, "marker", obboundary[i], 1);CHKERRQ(ierr);<br>
    }<br>
<br>
but, it is not efficient: The degree of freedom are still present in the linear system.<br>
In the source of  DMPlexCreateSquareBoundary, the label is set for the edges and for the points.<br>
Do I have to do something like this ?<br>
Thanks,<br>
Olivier B<br>
<br>
Quoting Matthew Knepley <<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>>:</p>
<blockquote style="border-left-width:2px;border-left-style:solid;border-left-color:blue;margin-left:2px;padding-left:12px" type="cite">
<div dir="ltr">On Tue, Aug 20, 2013 at 10:16 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">
<div bgcolor="#FFFFFF" text="#000000">
<div>Hello,<br>
<br>
Thank-you, I'm using DMPlexCreateFromCellList(), and it works except for the boundary conditions.<br>
I'm using Dirichlet boundary conditions, and the corresponding degree of freedom are not substituted (like when I use DMPlexCreateBoxMesh).<br>
So, I do have missing a step to define the boundary ?</div>
</div>
</blockquote>
<div> </div>
<div>Yes. For the other formats, it translates boundary markers to DMLabels. With the CellList you will have to label your boundary.</div>
<div>If you want it to work exactly as in the example, for every point p on your boundary,</div>
<div> </div>
<div>  DMPlexSetLabelValue(dm, "marker", p, 1);</div>
<div> </div>
<div>You can avoid the string lookup by using</div>
<div> </div>
<div>  DMPlexCreateLabel(dm, "marker");</div>
<div>  DMPlexGetLabel(dm, "marker", &label);</div>
<div>  DMLabelSetValue(label, p, 1);</div>
<div> </div>
<div>Obviously, if you have multiple BC, you can use a label for each condition.</div>
<div> </div>
<div>  Thanks,</div>
<div> </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">
<div bgcolor="#FFFFFF" text="#000000">
<div>Olivier B<br>
<br>
<br>
On 08/20/2013 03:08 PM, Matthew Knepley wrote:</div>
<blockquote type="cite">
<div dir="ltr">On Tue, Aug 20, 2013 at 7:50 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">
<p>Hello,<br>
<br>
I have modify the ex12.c example for a like diffusive problem (FEM+unstructured mesh+SNES).<br>
The next step, is to replace the square mesh by my own mesh.<br>
I want import my mesh from a simple file, and after distributed it with DMPlexDistribute.<br>
Is it the good way ?<br>
Is it possible to import a mesh in petsc ? I didn't find the answer in the documentation. Is there an example ?</p>
</blockquote>
<div> </div>
<div>There are a few formats supported:</div>
<div> </div>
<div>  1) Cell-vertex: DMPlexCreateFromCellList()</div>
<div> </div>
<div>  2) Exodus: DMPlexCreateExodus()</div>
<div> </div>
<div>  3) CGNS: DMPlexCreateCGNS()</div>
<div> </div>
<div>  Thanks,</div>
<div> </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">
<p>Thanks<br>
<span><font color="#888888">Olivier Bonnefon<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></font></span><br>
 </p>
</blockquote>
</div>
<br>
<br clear="all">
<div> </div>
<span><font color="#888888">--<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</font></span></div>
</div>
</blockquote>
<br>
<br>
<pre cols="72"><span><font color="#888888">-- 
Olivier Bonnefon
INRA PACA-Avignon, Unité BioSP
Tel: <a href="tel:%2B33%20%280%294%2032%2072%2021%2058" value="+33432722158" target="_blank">+33 (0)4 32 72 21 58</a></font></span>
</pre></div>
</blockquote>
</div>
<br>
<br clear="all">
<div> </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>
</blockquote>
<p><br>
 </p>
</blockquote>
<p><br>
<br></p>
</div></div></div>
</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>