Skip to content

Commit

Permalink
Merge pull request #274 from laetitia-m/feature/tria-tag-REQ
Browse files Browse the repository at this point in the history
Ensure that required triangles are preserved
  • Loading branch information
Algiane authored Jul 22, 2024
2 parents 3286b61 + 3bcfeaa commit 2263f92
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions src/mmg3d/hash_3d.c
Original file line number Diff line number Diff line change
Expand Up @@ -1380,11 +1380,23 @@ int MMG5_bdryTria(MMG5_pMesh mesh, MMG5_int ntmesh) {
/* If the face from which we arrive is not a parallel face, then remove also the parallel tags
MG_PARBDY, MG_NOSURF and MG_REQ */
if ( !(pxt->ftag[i] & MG_PARBDY)) {
ptt->tag[j] &= ~MG_PARBDY;
ptt->tag[j] &= ~MG_NOSURF;
ptt->tag[j] &= ~MG_REQ;
/* Remove the tags only if the edge is identified as parallel.
By convention in ParMmg (see tag_pmmg.c in ParMmg), if an entity is
- parallel + not required: the tags are MG_PARBDY+MG_NOSURF+MG_REQ
- parallel + truly required by the user: the tags are MG_PARBDY+MG_REQ
so we remove the tags MG_NOSURF and MG_REQ only if the edge is identified as MG_NOSURF */
if ( ptt->tag[j] & MG_PARBDY ) {
ptt->tag[j] &= ~MG_PARBDY;
/* a truly required entity does not have MG_NOSURF tag so don't remove MG_REQ tag */
/* if MG_NOSURF tag, then also remove MG_REQ and MG_SURF tags */
if( ptt->tag[j] & MG_NOSURF ) {
ptt->tag[j] &= ~MG_NOSURF;
ptt->tag[j] &= ~MG_REQ;
}
}
}
}

/* Assign ref to tria from xtetra->edg */
if ( pxt->edg[MMG5_iarf[i][j]] )
ptt->edg[j] = pxt->edg[MMG5_iarf[i][j]];
Expand Down

0 comments on commit 2263f92

Please sign in to comment.