From b53f33c8033e762eeb7d0be540c76baaa4161518 Mon Sep 17 00:00:00 2001 From: Mark Potse Date: Fri, 21 Mar 2025 13:24:54 +0100 Subject: [PATCH 1/2] allow the 3d swapper to create tetrahedra with 4 bdy vertices when not in FEM mode --- src/mmg3d/swapgen_3d.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mmg3d/swapgen_3d.c b/src/mmg3d/swapgen_3d.c index cac3926df..7845aca96 100644 --- a/src/mmg3d/swapgen_3d.c +++ b/src/mmg3d/swapgen_3d.c @@ -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 && (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 ) || From a3ebba9bf793418d839e3ddf10b14ce51d8db1da Mon Sep 17 00:00:00 2001 From: Mark Potse Date: Sat, 12 Apr 2025 21:19:27 +0200 Subject: [PATCH 2/2] swapgen_3d.c: assume (mesh->info.fem == typchk) means FEM mode, not .fem being nonzero --- src/mmg3d/swapgen_3d.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mmg3d/swapgen_3d.c b/src/mmg3d/swapgen_3d.c index 7845aca96..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 ) { @@ -208,7 +208,7 @@ MMG5_int MMG5_chkswpgen(MMG5_pMesh mesh,MMG5_pSol met,MMG5_int start,int ia, /* Prevent from creating a tetra with 4 bdy vertices */ /* when the mesh is in FEM mode */ - if ( mesh->info.fem && (mesh->point[np].tag & MG_BDY) ) { + 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 ) ||