<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Dear all, <div><br></div><div>I have recently been playing around with the AMR capabilities embedded in PETSc for quad meshes using p4est. Based on the TS tutorial ex11, I was able to incorporate the AMR into a pre-existing code with different metrics for the adaptation process.</div><div>Now I would like to do something similar using tri meshes. I read that compiling PETSc with Triangle (in 2D and Tetgen for 3D) gives access to refinement and coarsening capabilities on triangular meshes.When I try to execute the code with a triangular mesh (that i manipulate as a DMPLEX), it yields "Triangle 1700 has an invalid vertex index" when trying to adapt the mesh (the initial mesh indeed has 1700 cells). From what i could tell, it comes from the reconstruct method called by the triangulate method of triangle.c, the latter being called by either <strong style="color:rgb(0,0,0)"><font color="#4169E1">DMPlexGenerate_Triangle </font></strong>or <strong style="color:rgb(0,0,0)"><font color="#4169E1">DMPlexRefine_Triangle </font></strong>in PETSc, I cannot be sure. </div><div><br></div><div>In substance, the code is the same as in ex11.c and the crash occurs in the first adaptation pass, i.e. an equivalent in ex11 is that it crashes after the SetInitialCondition in the first if (useAMR) located line 1835 when it calls adaptToleranceFVM (which I copied basically so the code is the same).</div><div><br></div><div>Is the automatic mesh refinement feature on tri meshes supposed to work or am I trying something that has not been completed yet ?</div><div><br></div><div>Thank you very much for your help, as always.</div><div><br clear="all"><div><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div><div><div><div><div>Thibault Bridel-Bertomeu<br>—<br></div></div></div></div>Eng, MSc, PhD</div><div>Research Engineer</div><div>CEA/CESTA</div><div>33114 LE BARP</div><div>Tel.: (+33)557046924</div><div>Mob.: (+33)611025322<br></div><div>Mail: <a href="mailto:thibault.bridelbertomeu@gmail.com" target="_blank">thibault.bridelbertomeu@gmail.com</a><br></div></div></div></div></div></div></div></div></div></div></div></div></div>