diff --git a/src/mmg3d/colver_3d.c b/src/mmg3d/colver_3d.c index d4e53e73f..5400b4a72 100644 --- a/src/mmg3d/colver_3d.c +++ b/src/mmg3d/colver_3d.c @@ -428,7 +428,6 @@ int MMG3D_get_shellEdgeTag_oneDir(MMG5_pMesh mesh,MMG5_int start, MMG5_int na, * consistent through the edge shell); * */ -static inline int MMG3D_get_shellEdgeTag(MMG5_pMesh mesh,MMG5_int start, int8_t ia,int16_t *tag,MMG5_int *ref) { MMG5_pTetra pt; MMG5_pxTetra pxt; diff --git a/src/mmg3d/libmmg3d_private.h b/src/mmg3d/libmmg3d_private.h index 5f46d2380..472f7ed89 100644 --- a/src/mmg3d/libmmg3d_private.h +++ b/src/mmg3d/libmmg3d_private.h @@ -260,6 +260,7 @@ void MMG3D_coquilFaceSecondLoopInit(MMG5_pMesh mesh,MMG5_int piv,int8_t *iface,i void MMG5_coquilFaceErrorMessage(MMG5_pMesh mesh, MMG5_int k1, MMG5_int k2); int16_t MMG5_coquilTravel(MMG5_pMesh,MMG5_int,MMG5_int,MMG5_int*,MMG5_int*,int8_t*,int8_t*); int16_t MMG5_openCoquilTravel(MMG5_pMesh,MMG5_int,MMG5_int,MMG5_int*,MMG5_int*,int8_t*,int8_t*); +int MMG3D_get_shellEdgeTag(MMG5_pMesh,MMG5_int,int8_t,int16_t*,MMG5_int *); int MMG5_settag(MMG5_pMesh,MMG5_int,int,int16_t,int); int MMG5_deltag(MMG5_pMesh,MMG5_int,int,int16_t); int MMG5_setNmTag(MMG5_pMesh mesh, MMG5_Hash *hash); diff --git a/src/mmg3d/mmg3d3.c b/src/mmg3d/mmg3d3.c index b07d4a56a..d92575362 100644 --- a/src/mmg3d/mmg3d3.c +++ b/src/mmg3d/mmg3d3.c @@ -136,11 +136,26 @@ static MMG5_int MMG5_spllag(MMG5_pMesh mesh,MMG5_pSol disp,MMG5_pSol met,int itd p1 = &mesh->point[ip2]; /* Skip the non-internal edges */ + + // Fast check but incomplete: regular boundary edges may have no tags (bdy + // tags are not added at new edges created during the split of boudary + // faces for example). if ( pxt && (pxt->tag[i] & MG_BDY) ) continue; + // Slower test but allowing to be sure to detect boundary edges + int16_t tag = 0; + MMG5_int ref = 0; + if ( !MMG3D_get_shellEdgeTag(mesh,k,MMG5_iarf[i][0],&tag,&ref) ) { + fprintf(stderr,"\n ## Warning: %s: 0. unable to get edge info" + " (tetra %d).\n",__func__,MMG3D_indElt(mesh,k)); + continue; + } - if( (p0->tag & MG_BDY) && (p1->tag & MG_BDY) ) continue; + if ( tag & MG_BDY ) { + continue; + } + /* Here we are sure to work on a non-boundary edge */ len = (p1->c[0]-p0->c[0])*(p1->c[0]-p0->c[0]) + (p1->c[1]-p0->c[1])*(p1->c[1]-p0->c[1]) + (p1->c[2]-p0->c[2])*(p1->c[2]-p0->c[2]); @@ -150,11 +165,12 @@ static MMG5_int MMG5_spllag(MMG5_pMesh mesh,MMG5_pSol disp,MMG5_pSol met,int itd imax = i; } } + if ( imax==-1 ) { if ( !mmgWarn0 ){ mmgWarn0 = 1; - fprintf(stderr,"\n ## Warning: %s: all edges of tetra %" MMG5_PRId " are required" - " or of length null.\n",__func__,k); + fprintf(stderr,"\n ## Warning: %s: No possible edge split in tetra %" MMG5_PRId + ".\n",__func__,MMG3D_indElt(mesh,k)); } continue; }