From 1c2d9d9ab8b827979e1308b6718dc971a359d974 Mon Sep 17 00:00:00 2001 From: Corentin Prigent Date: Thu, 10 Jul 2025 16:59:41 +0200 Subject: [PATCH 1/2] Correct initialization of tagdel fields of points in mesh generation --- src/mmg2d/delone_2d.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/mmg2d/delone_2d.c b/src/mmg2d/delone_2d.c index ece65221b..32bdeb860 100644 --- a/src/mmg2d/delone_2d.c +++ b/src/mmg2d/delone_2d.c @@ -261,8 +261,14 @@ int MMG2D_delone(MMG5_pMesh mesh,MMG5_pSol sol,MMG5_int ip,MMG5_int *list,int il static int8_t mmgWarn0=0,mmgWarn1=0; /* Initialize tagdel field */ - for (k=1; k<=mesh->np-4; k++) - mesh->point[k].tagdel = 0; + for (k=0; ktria[old]; + for (i=0; i<3; i++) { + ppt = &mesh->point[ pt1->v[i] ]; + ppt->tagdel = 0; + } + } /* Triangles in the cavity are those s.t. pt->base == base */ base = mesh->base; From 63745aeae5a4575652d1f916dea38db02794fd52 Mon Sep 17 00:00:00 2001 From: Corentin Prigent Date: Thu, 17 Jul 2025 17:30:14 +0200 Subject: [PATCH 2/2] replaced old with iel when appropriate --- src/mmg2d/delone_2d.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/mmg2d/delone_2d.c b/src/mmg2d/delone_2d.c index 32bdeb860..c70bc56d7 100644 --- a/src/mmg2d/delone_2d.c +++ b/src/mmg2d/delone_2d.c @@ -262,8 +262,8 @@ int MMG2D_delone(MMG5_pMesh mesh,MMG5_pSol sol,MMG5_int ip,MMG5_int *list,int il /* Initialize tagdel field */ for (k=0; ktria[old]; + iel = list[k]; + pt1 = &mesh->tria[iel]; for (i=0; i<3; i++) { ppt = &mesh->point[ pt1->v[i] ]; ppt->tagdel = 0; @@ -275,9 +275,9 @@ int MMG2D_delone(MMG5_pMesh mesh,MMG5_pSol sol,MMG5_int ip,MMG5_int *list,int il /* Count the number of external faces in the cavity, and tag the corresponding vertices */ size = 0; for (k=0; ktria[old]; - iadr = (old-1)*3 + 1; + iel = list[k]; + pt1 = &mesh->tria[iel]; + iadr = (iel-1)*3 + 1; adja = &mesh->adja[iadr]; nei[0] = adja[0]/3 ; nei[1] = adja[1]/3 ; @@ -298,8 +298,8 @@ int MMG2D_delone(MMG5_pMesh mesh,MMG5_pSol sol,MMG5_int ip,MMG5_int *list,int il /* Check for an isolated vertex (the cavity should ne contain any internal vertex) */ alert = 0; for (k=0; ktria[old]; + iel = list[k]; + pt1 = &mesh->tria[iel]; for (i=0; i<3; i++) { ppt = &mesh->point[ pt1->v[i] ]; if ( !ppt->tagdel ) { @@ -309,8 +309,8 @@ int MMG2D_delone(MMG5_pMesh mesh,MMG5_pSol sol,MMG5_int ip,MMG5_int *list,int il } /* Reset tagdel field */ for (k=0; ktria[old]; + iel = list[k]; + pt1 = &mesh->tria[iel]; for (i=0; i<3; i++) { ppt = &mesh->point[ pt1->v[i] ]; ppt->tagdel = 0;