<div dir="ltr"><div>From your output, it seems a triangle cell.</div><div><br></div><div>Reading  the documentation of DMPlexGetTransitiveClosure I have already pointed you to: the output is interleaved between points (cell, edges and vertices in this case) and their relative orientation wrt the point of higher dimension.</div><div><br></div><div>Reading your output</div><div><br></div><div>0 0 -> cell number 0 (relative orientation is 0)</div><div><br></div><div>then the edges (all edges are points locally numbered from eStart to eEnd, where DMPlexGetDepthStratum(dm,1,&eStart,&eEnd))<br></div><div><br></div><div>370 -2 369 -2 368 -2 -> cell 0 is made up by points 370, 369 and 368 (traversed in this specific order), and each edge must be traversed -2 (from second endpoint to first)</div><div><br></div><div>then the vertices (start and end of local per process numbering via DMPlexGetDepthStratum(dm,0,&vStart,&vEnd))</div><div><br></div><div>309 0 306 0 312 0  -> vertices have no orientation.<br></div><div><br></div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Il giorno lun 22 feb 2021 alle ore 15:09 Fabien Vergnet <<a href="mailto:fabien.vergnet@sorbonne-universite.fr">fabien.vergnet@sorbonne-universite.fr</a>> ha scritto:<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 style="overflow-wrap: break-word;">Hi Stefano,<div><br></div><div>Thank you for your response.</div><div><br></div><div>Could you explain more what the output of <span style="color:rgb(99,99,36);font-family:Menlo,Monaco,"Courier New",monospace;white-space:pre-wrap;background-color:rgb(255,255,255)">DMPlexGetTransitiveClosure</span> is ? For example for cell 0 I get the following array of size 14 for the closure:</div><div><br></div><div>0 0 370 -2 369 -2 368 -2 309 0 306 0 312 0 </div><div><br></div><div>but I do not understand the order of the points (center of the cell, middle of the edges, vertices ?). Also what the orientation means for each point ?</div><div><br></div><div>Regards,</div><div>Fabien</div><div><div><br><blockquote type="cite"><div>Le 22 févr. 2021 à 12:48, Stefano Zampini <<a href="mailto:stefano.zampini@gmail.com" target="_blank">stefano.zampini@gmail.com</a>> a écrit :</div><br><div><div dir="ltr" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none"><div>The plex way is to use the transitive closure<span> </span><a href="https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/DMPLEX/DMPlexGetTransitiveClosure.html" target="_blank">https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/DMPLEX/DMPlexGetTransitiveClosure.html</a><span> </span>and filter out points you are not interested in.</div><div>See for example<span> </span><a href="https://gitlab.com/petsc/petsc/-/blob/master/src/dm/impls/plex/plex.c#L828" target="_blank">https://gitlab.com/petsc/petsc/-/blob/master/src/dm/impls/plex/plex.c#L828</a><span> </span>and<span> </span><a href="https://gitlab.com/petsc/petsc/-/blob/master/src/dm/impls/plex/plex.c#L833" target="_blank">https://gitlab.com/petsc/petsc/-/blob/master/src/dm/impls/plex/plex.c#L833</a></div></div><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none"><div class="gmail_quote" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none"><div dir="ltr" class="gmail_attr">Il giorno lun 22 feb 2021 alle ore 14:28 Fabien Vergnet <<a href="mailto:fabien.vergnet@sorbonne-universite.fr" target="_blank">fabien.vergnet@sorbonne-universite.fr</a>> ha scritto:<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>Dear PETSc community,<div><br></div><div>Thank you for your amazing work. I discovered PETSc recently and I need your help for a project.</div><div><br></div><div>As a training, I would like to assemble the Finite Element Matrix for the Poisson problem on a part of my mesh. So, I create a DMPlex from a .msh file and I create a Submesh with</div><div><br></div><div><div style="color:rgb(54,54,54);background-color:rgb(255,255,255);font-family:Menlo,Monaco,"Courier New",monospace;line-height:18px;white-space:pre-wrap"><span style="color:rgb(99,99,36)">DMPlexCreateSubmesh</span>(<span style="color:rgb(9,89,132)">dm</span>, <span style="color:rgb(9,89,132)">label</span>, <span style="color:rgb(73,104,57)">1</span>, PETSC_TRUE, &sub<span style="color:rgb(9,89,132)">dm</span>);</div><div><br></div><div>In order to assemble my Finite Element Matrix, I need to iterate over the cells of the mesh <span>(which are triangles)</span> and identify the vertices composing each cell.</div></div><div><br></div><div>My question is the following : how can I get, for each cell, the vertices composing the cell ?</div><div><br></div><div>I have tried to uninterpolate the subdm with <span style="color:rgb(99,99,36);font-family:Menlo,Monaco,"Courier New",monospace;white-space:pre-wrap;background-color:rgb(255,255,255)">DMPlexUninterpolate</span> (with the objective to get the vertices from <span style="color:rgb(99,99,36);font-family:Menlo,Monaco,"Courier New",monospace;white-space:pre-wrap;background-color:rgb(255,255,255)">DMPlexGetCone</span>) but it does not seem to work for a Submesh since I get the following error:</div><div><br></div><div>----------</div><div><br></div><div><div>[0]PETSC ERROR: --------------------- Error Message --------------------------------------------------------------</div><div>[0]PETSC ERROR: Invalid argument</div><div>[0]PETSC ERROR: Not for partially interpolated meshes</div><div>[0]PETSC ERROR: See<span> </span><a href="https://www.mcs.anl.gov/petsc/documentation/faq.html" target="_blank">https://www.mcs.anl.gov/petsc/documentation/faq.html</a><span> </span>for trouble shooting.</div><div>[0]PETSC ERROR: Petsc Release Version 3.14.4, Feb 03, 2021 </div><div>[0]PETSC ERROR: Configure options --prefix=/users/home/vergnet/apps/spack/opt/spack/linux-ubuntu20.04-zen2/gcc-9.3.0/petsc-3.14.4-xtae5tcwlzkb4oiifbayj77bqlz5nngk --with-ssl=0 --download-c2html=0 --download-sowing=0 --download-hwloc=0 CFLAGS= FFLAGS= CXXFLAGS= --with-cc=/users/home/vergnet/apps/spack/opt/spack/linux-ubuntu20.04-zen2/gcc-9.3.0/openmpi-4.0.5-ygn7zymoy7crl7b4xsdkc4zmfojugmdy/bin/mpicc --with-cxx=/users/home/vergnet/apps/spack/opt/spack/linux-ubuntu20.04-zen2/gcc-9.3.0/openmpi-4.0.5-ygn7zymoy7crl7b4xsdkc4zmfojugmdy/bin/mpic++ --with-fc=/users/home/vergnet/apps/spack/opt/spack/linux-ubuntu20.04-zen2/gcc-9.3.0/openmpi-4.0.5-ygn7zymoy7crl7b4xsdkc4zmfojugmdy/bin/mpif90 --with-precision=double --with-scalar-type=real --with-shared-libraries=1 --with-debugging=0 --with-64-bit-indices=0 COPTFLAGS= FOPTFLAGS= CXXOPTFLAGS= --with-blaslapack-lib=/users/home/vergnet/apps/spack/opt/spack/linux-ubuntu20.04-zen2/gcc-9.3.0/openblas-0.3.13-6b3u6zc5j4hvauqh3ldcwnf7lm2o4vyl/lib/libopenblas.so --with-x=0 --with-clanguage=C --with-scalapack=0 --with-cuda=0 --with-metis=1 --with-metis-dir=/users/home/vergnet/apps/spack/opt/spack/linux-ubuntu20.04-zen2/gcc-9.3.0/metis-5.1.0-lm3k7dh2vslghqtqc6dvcpnc54bfpqq2 --with-hypre=1 --with-hypre-dir=/users/home/vergnet/apps/spack/opt/spack/linux-ubuntu20.04-zen2/gcc-9.3.0/hypre-2.20.0-4pyxhku65wb5lmh2fpflhmjmow2pbjg7 --with-parmetis=1 --with-parmetis-dir=/users/home/vergnet/apps/spack/opt/spack/linux-ubuntu20.04-zen2/gcc-9.3.0/parmetis-4.0.3-pfiam4ccxkyqpapejcdjtlyr6cyz7irc --with-mumps=0 --with-trilinos=0 --with-fftw=0 --with-valgrind=0 --with-gmp=0 --with-libpng=0 --with-giflib=0 --with-mpfr=0 --with-netcdf=0 --with-pnetcdf=0 --with-moab=0 --with-random123=0 --with-exodusii=0 --with-cgns=0 --with-memkind=0 --with-p4est=0 --with-saws=0 --with-yaml=0 --with-libjpeg=0 --with-cxx-dialect=C++11 --with-superlu_dist-include=/users/home/vergnet/apps/spack/opt/spack/linux-ubuntu20.04-zen2/gcc-9.3.0/superlu-dist-6.4.0-bagymefhq7s7gerf7jxwiv4fv7szoljh/include --with-superlu_dist-lib=/users/home/vergnet/apps/spack/opt/spack/linux-ubuntu20.04-zen2/gcc-9.3.0/superlu-dist-6.4.0-bagymefhq7s7gerf7jxwiv4fv7szoljh/lib/libsuperlu_dist.a --with-superlu_dist=1 --with-suitesparse=0 --with-ptscotch=0 --with-hdf5-include=/users/home/vergnet/apps/spack/opt/spack/linux-ubuntu20.04-zen2/gcc-9.3.0/hdf5-1.10.7-dkfs4ir3hlahyfs5z4xcmsf4ogklimji/include --with-hdf5-lib=/users/home/vergnet/apps/spack/opt/spack/linux-ubuntu20.04-zen2/gcc-9.3.0/hdf5-1.10.7-dkfs4ir3hlahyfs5z4xcmsf4ogklimji/lib/libhdf5.so --with-hdf5=1 --with-zlib-include=/users/home/vergnet/apps/spack/opt/spack/linux-ubuntu20.04-zen2/gcc-9.3.0/zlib-1.2.11-2pwsgfxppopolmjj6tf34k5jsaqzpodo/include --with-zlib-lib=/users/home/vergnet/apps/spack/opt/spack/linux-ubuntu20.04-zen2/gcc-9.3.0/zlib-1.2.11-2pwsgfxppopolmjj6tf34k5jsaqzpodo/lib/libz.so --with-zlib=1</div><div>[0]PETSC ERROR: #1 DMPlexUninterpolate() line 1514 in /tmp/vergnet/spack-stage/spack-stage-petsc-3.14.4-xtae5tcwlzkb4oiifbayj77bqlz5nngk/spack-src/src/dm/impls/plex/plexinterpolate.c</div><div>[0]PETSC ERROR: #2 assemble_mass() line 59 in /users/home/vergnet/codes/cilia/cilia/cpp/assembling.hpp</div></div><div><br></div><div>----------</div><div><br></div><div>Attached are a minimal working example, a mesh file and a makefile.</div><div><br></div><div>Any ideas or suggestions are more than welcome !</div><div><br></div><div>Regards,</div><div>Fabien</div><div><br></div><div></div></div><div><div></div></div><div><div></div></div><div><div></div><div><br></div><div><br></div></div></blockquote></div><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none" clear="all"><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none"><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;float:none;display:inline">--<span> </span></span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none"><div dir="ltr" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none">Stefano</div></div></blockquote></div><br></div></div></blockquote></div><br clear="all"><br>-- <br><div dir="ltr" class="gmail_signature">Stefano</div>