Skip to content

Commit

Permalink
Remove the assumption that we can enter the chkswpbdy function from a…
Browse files Browse the repository at this point in the history
… non boundary tetra and add the associated check (a similar check was already added by commit ffe6fc2).
  • Loading branch information
Algiane committed Apr 5, 2024
1 parent 2c3b086 commit cf23ad2
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/mmg3d/swap_3d.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,15 @@ int MMG5_chkswpbdy(MMG5_pMesh mesh, MMG5_pSol met, int64_t *list,int ilist,
np = pt->v[MMG5_iare[ia][0]];
nq = pt->v[MMG5_iare[ia][1]];

// Algiane 05/04/24: I think that the assumption that was previously made that
// we can arrive from a tetrahedra without a boundary face (i.e. without an
// xtetra) never happens
assert ( pt->xt && "Boundary edges have to be swapped from a boundary face" );

/* No swap of geometric edge */
if ( pt->xt ) {
pxt = &mesh->xtetra[pt->xt];
if ( (pxt->edg[ia]>0) || MG_EDG_OR_NOM(pxt->tag[ia]) || (pxt->tag[ia] & MG_REQ) ) {
return 0;
}
pxt = &mesh->xtetra[pt->xt];
if ( (pxt->edg[ia]>0) || MG_EDG_OR_NOM(pxt->tag[ia]) || (pxt->tag[ia] & MG_REQ) ) {
return 0;
}

/* No swap when either internal or external component has only 1 element (as
Expand Down

0 comments on commit cf23ad2

Please sign in to comment.