diff --git a/src/mmg3d/swapgen_3d.c b/src/mmg3d/swapgen_3d.c index cac3926df..e512721b9 100644 --- a/src/mmg3d/swapgen_3d.c +++ b/src/mmg3d/swapgen_3d.c @@ -147,7 +147,7 @@ MMG5_int MMG5_chkswpgen(MMG5_pMesh mesh,MMG5_pSol met,MMG5_int start,int ia, calnew = 1.0; ier = 1; - if ( mesh->info.fem ) { + if ( mesh->info.fem == typchk ) { /* Do not create internal edges between boundary points */ p0 = &mesh->point[np]; if ( p0->tag & MG_BDY ) { @@ -207,7 +207,8 @@ MMG5_int MMG5_chkswpgen(MMG5_pMesh mesh,MMG5_pSol met,MMG5_int start,int ia, } /* Prevent from creating a tetra with 4 bdy vertices */ - if ( mesh->point[np].tag & MG_BDY ) { + /* when the mesh is in FEM mode */ + if ( mesh->info.fem == typchk && (mesh->point[np].tag & MG_BDY) ) { if ( ( mesh->point[pt->v[MMG5_ifar[i][0]]].tag & MG_BDY ) && ( mesh->point[pt->v[MMG5_ifar[i][1]]].tag & MG_BDY ) ) { if ( ( mesh->point[pt->v[MMG5_iare[i][0]]].tag & MG_BDY ) ||