<div dir="ltr"><div dir="ltr">On Wed, Oct 9, 2019 at 9:59 AM Asitav Mishra <<a href="mailto:asitav@gmail.com">asitav@gmail.com</a>> wrote:<br></div><div class="gmail_quote"><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">Matt,<div><br></div><div>Please excuse me for not having stated it clearly. Of course, ultimately residuals/Jacobians are what I'd need to evaluate using higher-order nodes. I just meant my first concern is to create a mesh graph structure that can be appropriately partitioned (and hopefully re-distributed) among multiple processors without losing the higher order topological information of the geometry, such as those in curved (higher-order) elements.</div></div></blockquote><div><br></div><div>Okay, that is clear.</div><div><br></div><div>So its turns out there is no topological difference between low order and high order geometry (that is actually</div><div>that point, a teacup and a donut are topologically equivalent). As Stefano says, you need to treat the coordinates</div><div>as just another field. Sp exactly as if you were making a solution field, you create the coordinate field you want.</div><div>Then that coordinate field should be able to be input to the DM using</div><div><br></div><div>  DMGetCoordinateDM(dm, &cdm);</div><div>  <Set field information into cdm instead of dm></div><div> DMCreateLocalVector(cdm, &coordinatesLocal);</div><div> <Fill in higher order coordinate values></div><div> DMSetCoordinatesLocal(dm, coordinatesLocal);</div><div><br></div><div>You will probably use a DMProject*(cdm, ...) to fill in the coordinate values.</div><div><br></div><div>This has not been extensively tested. I will look for the example I have of this.</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>Thanks,</div><div>Asitav</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Oct 9, 2019 at 12:25 AM Matthew Knepley <<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>> wrote:<br></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 dir="ltr">On Tue, Oct 8, 2019 at 4:45 PM Asitav Mishra via petsc-users <<a href="mailto:petsc-users@mcs.anl.gov" target="_blank">petsc-users@mcs.anl.gov</a>> wrote:<br></div><div class="gmail_quote"><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>Stefano,</div><div><br></div>Thanks a lot for your prompt response. I have a higher-order mesh, so will need to create my own PetscSection to add the local coordinates looks  like.<br><div>At this point, FEM residuals and Jacobian computations are not as important. But, could you direct me to any examples in creating PetscSection for such elements?</div></div></blockquote><div><br></div><div>Asitav,</div><div><br></div><div>What do you want to do with higher oder coordinate embeddings, if not calculate residuals and Jacobians?</div><div>Are you absolutely certain that is what you need, since this is not normally called P2.</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>Thanks,</div><div>Asitav</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Oct 8, 2019 at 3:18 PM Stefano Zampini <<a href="mailto:stefano.zampini@gmail.com" target="_blank">stefano.zampini@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>DMPlex abstracts the mesh topology. PetscSection defines the dofs associated to the mesh entities.<div>Why do you need P2 elements? For the discrete solution or because you have a high order mesh?</div><div><br></div><div>If it is only for the solution, you should create a linear mesh (cell-vertex only), interpolate the mesh, and then use</div><div>PetscFECreateDefault (<a href="https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/FE/PetscFECreateDefault.htm" target="_blank">https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/FE/PetscFECreateDefault.htm</a>)</div><div>+</div><div>DMAddField (<a href="https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/DM/DMAddField.html" target="_blank">https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/DM/DMAddField.html</a>)</div><div>+</div><div>DMCreateDS (<a href="https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/DM/DMCreateDS.html" target="_blank">https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/DM/DMCreateDS.html</a>)</div><div><br></div><div>Instead, if you have a high-order mesh, you should create a linear mesh, and then manipulate yourself the PetscSection defining the local coordinates.</div><div>However, I’m not sure how complete is the support for high-order meshes when it comes to compute FEM residuals and assemble Jacobians</div><div><br></div><div><br></div><div><div><blockquote type="cite"><div>On Oct 8, 2019, at 9:54 PM, Asitav Mishra via petsc-users <<a href="mailto:petsc-users@mcs.anl.gov" target="_blank">petsc-users@mcs.anl.gov</a>> wrote:</div><br><div><div dir="ltr"><div>Hi,</div><div><br></div><div>Does Petsc support DMPlexCreateFromDAG for 2nd order (P2) elements, or any orders higher than one (P1) for that matter? I know it is possible to create DMPlex mesh from GMSH files with P2 elements, but not sure how the 'cone/support' structures are built. One approach is to ignore the higher order nodes in an element to create the 'cones', but is there a way to preserve the P2 element information in the 'cones'? </div><div><br></div><div>For example: how would the depth=1 cone structure look like for a mesh with two P2 triangles sharing a face?</div><div>            2<br>          / | \</div><div>        /   |   \<br>     6     |     8</div><div>    /       |       \<br>  /         |         \<br>0   0    5    1    3<br>  \         |         /<br>    \       |       /<br>     4     |     7<br>        \   |   /<br></div><div>          \ | /</div><div><div>           1</div><div><br></div><div>Higher order nodes: [4, 5, 6, 7, 8]. Can we construct cones with cells-to-nodes (depth = 1)?:</div><div><br></div><div>numPoints = [9, 2];                                             // 9 nodes instead of just 4?</div><div>coneSizes = [6, 6,    0, 0, 0, 0, 0, 0, 0, 0, 0];</div><div>cones        = [0, 1, 2, 4, 5, 6,    2, 1, 3, 5, 7, 8];</div><div>etc.<br><div><div><br></div><div>Any help would be greatly appreciated.</div><div><br></div><div>Thanks,</div><div>Asitav</div><div><br></div>-- <br><div dir="ltr"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr">Asitav Mishra, PhD <div><div>Research Engineer II, NIA</div></div></div></div></div></div></div></div></div></div></div></div></div></div>
</div></blockquote></div><br></div></div></blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr">Asitav Mishra, PhD <div><div>Research Engineer II, NIA</div></div></div></div></div></div></div></div></div></div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr"><div dir="ltr"><div><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.cse.buffalo.edu/~knepley/" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br></div></div></div></div></div></div></div></div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr">Asitav Mishra, PhD <div><div>Research Engineer II, NIA</div></div></div></div></div></div></div></div></div></div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><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.cse.buffalo.edu/~knepley/" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br></div></div></div></div></div></div></div></div>