<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Apr 10, 2018 at 2: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:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div style="font-family:arial,helvetica,sans-serif;font-size:small">Hi everyone,</div><div style="font-family:arial,helvetica,sans-serif;font-size:small"><br></div><div style="font-family:arial,helvetica,sans-serif;font-size:small">I have two questions.</div><div style="font-family:arial,helvetica,sans-serif;font-size:small"><br></div><div style="font-family:arial,helvetica,sans-serif;font-size:small">(Q1)</div><div style="font-family:arial,helvetica,sans-serif;font-size:small">The first one is related to the new PETSc 3.9.</div><div 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 style="font-family:arial,helvetica,sans-serif;font-size:small">for the function calls within my program. </div><div style="font-family:arial,helvetica,sans-serif;font-size:small"><br></div><div style="font-family:arial,helvetica,sans-serif;font-size:small">Just like : call func(...,userctx)</div><div style="font-family:arial,helvetica,sans-serif;font-size:small">and retrieving data as:<br></div><div style="font-family:arial,helvetica,sans-serif;font-size:small">PetscFortranAddr userctx(*)<br></div><div><div style="font-family:arial,helvetica,sans-serif;font-size:small">b = userctx(2)<br></div><div style="font-family:arial,helvetica,sans-serif;font-size:small"><br></div><div style="font-family:arial,helvetica,sans-serif;font-size:small">With the new version I got the following error: </div><div><div style="font-family:arial,helvetica,sans-serif;font-size:small">b = userctx(2)</div><div style="font-family:arial,helvetica,sans-serif;font-size:small">Error: Can't convert INTEGER(8) to TYPE(tvec) at (1)<br></div><div style="font-family:arial,helvetica,sans-serif;font-size:small"><br></div><div 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 style="font-family:arial,helvetica,sans-serif;font-size:small">all the arguments to the functions separately?</div><div style="font-family:arial,helvetica,sans-serif;font-size:small"><br></div><div style="font-family:arial,helvetica,sans-serif;font-size:small">(Q2)</div><div style="font-family:arial,helvetica,sans-serif;font-size:small">The second is related to DMPlex.</div><div 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 style="font-family:arial,helvetica,sans-serif;font-size:small"><br></div><div><div 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></div></div></div></blockquote><div><br></div><div>Since the input is cell-vertex, my guess is that the order of the vertices on a cell is not what I expect.</div><div>I have readers for common formats, but FromCellList() is my own. You can see what vertices I think</div><div>constitute the faces:</div><div><br></div><div> <a href="https://bitbucket.org/petsc/petsc/src/05d412bc580c652749a091cc13ab756bb8816ec1/src/dm/impls/plex/plexinterpolate.c?at=master&fileviewer=file-view-default#plexinterpolate.c-113">https://bitbucket.org/petsc/petsc/src/05d412bc580c652749a091cc13ab756bb8816ec1/src/dm/impls/plex/plexinterpolate.c?at=master&fileviewer=file-view-default#plexinterpolate.c-113</a></div><div><br></div><div>Sorry, this was confusing. Most people are using the input formats, mesh generators, or predefined shapes,</div><div>so I do not get a lot of feedback on this interface.</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:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div><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><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>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><br></div><div><a href="http://www.caam.rice.edu/~mk51/" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br></div></div></div></div></div>
</div></div>