From 65c40fd380de9d1ae992f748c23e29cd51b8013e Mon Sep 17 00:00:00 2001 From: Algiane Froehly Date: Tue, 12 Dec 2023 17:27:33 +0100 Subject: [PATCH] Modification of the settag function The settag function updates tag info by travelling the tetra of the shell of a given edge. Commit 0f487e0a (which aims to add the support of required entities) has introduced the fact that the edge tag is updated only for tetra in which the edge belongs to a boundary face. Thus, if the edge has no boundary face, it is not updated. It may leads to tag inconsistencies in ParMmg where the settag function is called (in `cleanMesh`function) and where edges not belonging to bdy faces may be marked as MG_BDY. As a recall: - any edge marked as MG_BDY has to have consistent tags with the tags of the same edge in the other tetra. - regular edges belonging to a boundary face inside the current tet may have a 0 tag (because for now the splitting operators are creating boundary edges with 0 tags when splitting boundary triangles, see split_3d.c). - regular or non regular edges not having a bdy face inside the tetra may have a 0 tag. --- src/mmg3d/boulep_3d.c | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/src/mmg3d/boulep_3d.c b/src/mmg3d/boulep_3d.c index 39d4011f1..4be16e6ac 100644 --- a/src/mmg3d/boulep_3d.c +++ b/src/mmg3d/boulep_3d.c @@ -1185,18 +1185,16 @@ int MMG3D_settag_oneDir(MMG5_pMesh mesh,MMG5_int start, MMG5_int na, MMG5_int n if ( pt->xt ) { pxt = &mesh->xtetra[pt->xt]; - if ( (pxt->ftag[MMG5_ifar[i][0]] & MG_BDY) || - (pxt->ftag[MMG5_ifar[i][1]] & MG_BDY) ) { - taginit = pxt->tag[i]; - pxt->tag[i] |= tag; - /* Remove the potential nosurf tag if initially the edge is - * really required */ - if ( ((taginit & MG_REQ) && !(taginit & MG_NOSURF)) || - (( tag & MG_REQ) && !( tag & MG_NOSURF)) ) { - pxt->tag[i] &= ~MG_NOSURF; - } - pxt->edg[i] = MG_MAX(pxt->edg[i],edg); + + taginit = pxt->tag[i]; + pxt->tag[i] |= tag; + /* Remove the potential nosurf tag if initially the edge is + * really required */ + if ( ((taginit & MG_REQ) && !(taginit & MG_NOSURF)) || + (( tag & MG_REQ) && !( tag & MG_NOSURF)) ) { + pxt->tag[i] &= ~MG_NOSURF; } + pxt->edg[i] = MG_MAX(pxt->edg[i],edg); } /* set new triangle for travel */ adja = &mesh->adja[4*(adj-1)+1];