<div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">Found my way to the answer of the first question:</div><div class="gmail_default"><font face="arial, helvetica, sans-serif">ksp/ksp/examples/tutorials/ex13f90.F90</font><br></div><div class="gmail_default"><font face="arial, helvetica, sans-serif"><br></font></div><div class="gmail_default"><font face="arial, helvetica, sans-serif">With respect to question 2...</font></div><div class="gmail_default"><font face="arial, helvetica, sans-serif">I'm still confused about this behaviour of the DMPlex; or I am missing something.</font></div><div class="gmail_default"><font face="arial, helvetica, sans-serif"><br></font></div><div class="gmail_default"><font face="arial, helvetica, sans-serif">Best regards.</font></div><div class="gmail_default"><font face="arial, helvetica, sans-serif">Bernardo</font></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Apr 10, 2018 at 3:19 PM, Bernardo Rocha <span dir="ltr"><<a href="mailto:bernardomartinsrocha@gmail.com" target="_blank">bernardomartinsrocha@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">Hi everyone,</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">I have two questions.</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">(Q1)</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">The first one is related to the new PETSc 3.9.</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">I've been using Fortran and using the "userctx" to wrap some data<br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">for the function calls within my program. </div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">Just like : call func(...,userctx)</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">and retrieving data as:<br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">PetscFortranAddr userctx(*)<br></div><div class="gmail_default"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">b = userctx(2)<br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">With the new version I got the following error: </div><div class="gmail_default"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">b = userctx(2)</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">Error: Can't convert INTEGER(8) to TYPE(tvec) at (1)<br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">Is there a way to keep using the trick with "userctx", instead of passing</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">all the arguments to the functions separately?</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">(Q2)</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">The second is related to DMPlex.</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">When I use the CreateBoxMesh with 2x1x1 cells, I get the expected output:</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small"><br></div><div class="gmail_default"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">DM Object: 1 MPI processes<br></div><div style="font-family:arial,helvetica,sans-serif;font-size:small"><div>  type: plex</div><div>DM_0x84000000_0 in 3 dimensions:</div><div>  0-cells: 12</div><div> <b> 1-cells: 20</b></div><div>  <b>2-cells: 11</b></div><div>  3-cells: 2</div><div>Labels:</div><div>  depth: 4 strata with value/size (0 (12), 1 (20), 2 (11), 3 (2))</div><div><br></div></div><div style="font-family:arial,helvetica,sans-serif;font-size:small">However, If I try to create that manually to reproduce the same case 2x1x1 cells (creating this simple element connectivity by hand) using DMPlexCreateFromCellList I get the following:</div><div style="font-family:arial,helvetica,sans-serif;font-size:small"><br></div><div><div><font face="arial, helvetica, sans-serif">DM Object: DM_0x84000000_0 1 MPI processes</font></div><div><font face="arial, helvetica, sans-serif">  type: plex</font></div><div><font face="arial, helvetica, sans-serif">DM_0x84000000_0 in 3 dimensions:</font></div><div><font face="arial, helvetica, sans-serif">  0-cells: 12</font></div><div><font face="arial, helvetica, sans-serif">  <b>1-cells: 22</b></font></div><div><font face="arial, helvetica, sans-serif"><b>  2-cells: 12</b></font></div><div><font face="arial, helvetica, sans-serif">  3-cells: 2</font></div><div><font face="arial, helvetica, sans-serif">Labels:</font></div><div><font face="arial, helvetica, sans-serif">  depth: 4 strata with value/size (0 (12), 1 (22), 2 (12), 3 (2))</font></div></div><div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif">That is, it seems the shared face between the two cells is counted twice.</font></div><div><font face="arial, helvetica, sans-serif">Is that right? What am I missing here?</font></div><div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif">Best regards,</font></div><div><font face="arial, helvetica, sans-serif">Bernardo</font></div></div></div></div></div>
</blockquote></div><br></div>