<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, Apr 11, 2018 at 9:06 AM, 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 style="font-family:arial,helvetica,sans-serif;font-size:small">OK Matthew, thanks a lot for your feedback.</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">Reading the code for the first two faces I noted you used the standard numbering for the faces.</div><div style="font-family:arial,helvetica,sans-serif;font-size:small">face 0 (bottom) -> nodes 0 1 2 3</div><div style="font-family:arial,helvetica,sans-serif;font-size:small">face 1 (top) -> nodes 4 5 6 7</div></div></blockquote><div><br></div><div>Hi Bernardo,</div><div><br></div><div>No, you are misinterpreting the numbering. I want all cell faces to have outward facing normal, so</div><div>the unit cell looks like</div><div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"> 7------6</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"> /| /|</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"> / | / |</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"> 4------5 |</div> | | | |<br class="gmail-Apple-interchange-newline"> | | | |</div><div> | 1------2</div><div> | / | /</div><div> | / |/</div><div> 0------3</div><div><br></div><div>Does it make more sense now?</div><div><br></div><div> Thanks,</div><div><br></div><div> Matt</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div style="font-family:arial,helvetica,sans-serif;font-size:small">When this is defined, all the other faces are fixed.</div><div style="font-family:arial,helvetica,sans-serif;font-size:small">Therefore, I noticed some indexes errors in the code:</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"><div> //facesTmp[8] = cone[0]; facesTmp[9] = cone[3]; facesTmp[10] = cone[5]; facesTmp[11] = cone[4]; /* Front */</div><div> //facesTmp[12] = cone[2]; facesTmp[13] = cone[1]; facesTmp[14] = cone[7]; facesTmp[15] = cone[6]; /* Back */</div><div> //facesTmp[16] = cone[3]; facesTmp[17] = cone[2]; facesTmp[18] = cone[6]; facesTmp[19] = cone[5]; /* Right */</div><div> //facesTmp[20] = cone[0]; facesTmp[21] = cone[4]; facesTmp[22] = cone[7]; facesTmp[23] = cone[1]; /* Left */</div><div><br></div><div>It should be fixed to (basically swap cone[5] with cone[7]):</div><div><br></div><div> facesTmp[8] = cone[0]; facesTmp[9] = cone[3]; facesTmp[10] = cone[7]; facesTmp[11] = cone[4]; /* Front */</div><div> facesTmp[12] = cone[2]; facesTmp[13] = cone[1]; facesTmp[14] = cone[5]; facesTmp[15] = cone[6]; /* Back */</div><div> facesTmp[16] = cone[3]; facesTmp[17] = cone[2]; facesTmp[18] = cone[6]; facesTmp[19] = cone[7]; /* Right */</div><div> facesTmp[20] = cone[0]; facesTmp[21] = cone[4]; facesTmp[22] = cone[5]; facesTmp[23] = cone[1]; /* Left */</div><div><br></div><div>I did it like this, recompiled the code and at least the number of faces and edge are correct for me now</div><div>when using DMPlexCreateFromCellList.</div><div><br></div><div>I don't know if this change has some impact in other parts of the code.</div><div>I hope not.</div><div><br></div><div>Best regards,</div><div>Bernardo M. Rocha</div><div><br></div><div><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Apr 10, 2018 at 5:14 PM, Matthew Knepley <span dir="ltr"><<a href="mailto:knepley@gmail.com" target="_blank">knepley@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_extra"><div class="gmail_quote"><div><div class="m_-5202784948992912906h5">On Tue, Apr 10, 2018 at 2:19 PM, Bernardo Rocha <span dir="ltr"><<a href="mailto:bernardomartinsrocha@gmail.com" target="_blank">bernardomartinsrocha@gmail.co<wbr>m</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></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" target="_blank">https://bitbucket.org/petsc/<wbr>petsc/src/05d412bc580c652749a0<wbr>91cc13ab756bb8816ec1/src/dm/<wbr>impls/plex/plexinterpolate.c?<wbr>at=master&fileviewer=file-<wbr>view-default#plexinterpolate.<wbr>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><span class="m_-5202784948992912906HOEnZb"><font color="#888888">
</font></span></blockquote></div><span class="m_-5202784948992912906HOEnZb"><font color="#888888"><br><br clear="all"><span class="HOEnZb"><font color="#888888"><div><br></div>-- <br><div class="m_-5202784948992912906m_-2182482925119259520gmail_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/~k<wbr>nepley/</a><br></div></div></div></div></div>
</font></span></font></span></div></div>
</blockquote></div><br></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="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>