<div dir="ltr"><div dir="ltr">On Thu, Jun 24, 2021 at 10:34 AM Abisheik Panneerselvam <<a href="mailto:a.panneerselvam@mpie.de">a.panneerselvam@mpie.de</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 lang="en-DE"><div class="gmail-m_-3190199887528869438WordSection1"><p class="MsoNormal"><span lang="EN-US">Hello,<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p><p class="MsoNormal"><span lang="EN-US">Good Morning. My name is Abisheik Panneerselvam and I am presently working in Max-Planck Düsseldorf. <u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US">I am working on a FE software development project. The FE computation code is already written in Fortran (using Petsc for solving) few years ago. I am currently working on post-processing the results of the computation (nodal displacements, integration point displacements etc.). I am facing problems in getting the coordinates of vertices. I tried the following<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p><p class="MsoNormal">call SNESGetDM(mechanical_snes,dm_local,ierr); CHKERRQ(ierr)<span lang="EN-US"> !Gets the local DM from the SNES solve<u></u><u></u></span></p><p class="MsoNormal">call DMGetLocalVector(dm_local,x_local,ierr); CHKERRQ(ierr)<span lang="EN-US"> !Gets the local vector from the DM<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p><p class="MsoNormal"><span lang="EN-US">This functions successfully gets the coordinates of all the nodes. This works fine for linear elements as there are only nodes on cell vertices. But for higher order elements, the local vector (x_local) contains additional nodal points (I think its called ghost points in Petsc) on the edges. In this case how do I get the coordinates of only the cell vertices? <u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p><p class="MsoNormal"><span lang="EN-US">I tried the below code for getting the vertex coordinates but its giving random values. <u></u><u></u></span></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal"> call DMPlexGetDepthStratum(dm_local, 0, vStart, vEnd,ierr); CHKERRQ(ierr) !Get t<span lang="EN-US">he vertices <u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US"> </span>call VecGetArrayF90(x_local, node_coords_local,ierr)<u></u><u></u></p><p class="MsoNormal"> v_count=1<u></u><u></u></p><p class="MsoNormal"> do v=vStart, vEnd-1<u></u><u></u></p><p class="MsoNormal"> call DMPlexGetPointLocal(dm_local, v, x, y, ierr); CHKERRQ(ierr) <span lang="EN-US"> !Get the position of the vertice in the local DM<u></u><u></u></span></p><p class="MsoNormal"> d_count=1<u></u><u></u></p><p class="MsoNormal"> do d=x,y-1<u></u><u></u></p><p class="MsoNormal"> node_coords(d_count,v_count)=node_coords_local(d)<u></u><u></u></p><p class="MsoNormal"> d_count=d_count+1<u></u><u></u></p><p class="MsoNormal"> end do<u></u><u></u></p><p class="MsoNormal"> v_count = v_count+1<u></u><u></u></p><p class="MsoNormal"> end do<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal"><span lang="EN-US">It will be really helpful if you could advise me on this.</span></p></div></div></blockquote><div><br></div><div>Hi Abisheik,</div><div><br></div><div>One question to start off. Are you using DMPlex to describe the grid? It sounded like your FEM code was in Fortran. If you are only using PETSc</div><div>for solving the equations, it will not know the difference between unknowns on vertices and edges.</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 lang="en-DE"><div class="gmail-m_-3190199887528869438WordSection1"><p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p><p class="MsoNormal"><span lang="EN-US">Best regards<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US">Abisheik<u></u><u></u></span></p></div><br>
<br>
<hr>
-------------------------------------------------<br>
Max-Planck-Institut für Eisenforschung GmbH<br>
Max-Planck-Straße 1<br>
D-40237 Düsseldorf<br>
<br>
Handelsregister B 2533 <br>
Amtsgericht Düsseldorf<br>
<br>
Geschäftsführung<br>
Prof. Dr. Gerhard Dehm<br>
Prof. Dr. Jörg Neugebauer<br>
Prof. Dr. Dierk Raabe<br>
Dr. Kai de Weldige<br>
<br>
Ust.-Id.-Nr.: DE 11 93 58 514 <br>
Steuernummer: 105 5891 1000<br>
<br>
<br>
Please consider that invitations and e-mails of our institute are <br>
only valid if they end with …@<a href="http://mpie.de" target="_blank">mpie.de</a>. <br>
If you are not sure of the validity please contact <a href="mailto:rco@mpie.de" target="_blank">rco@mpie.de</a><br>
<br>
Bitte beachten Sie, dass Einladungen zu Veranstaltungen und E-Mails<br>
aus unserem Haus nur mit der Endung …@<a href="http://mpie.de" target="_blank">mpie.de</a> gültig sind. <br>
In Zweifelsfällen wenden Sie sich bitte an <a href="mailto:rco@mpie.de" target="_blank">rco@mpie.de</a><br>
-------------------------------------------------<br>
</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>