diff --git a/src/mmg3d/colver_3d.c b/src/mmg3d/colver_3d.c index d4e53e73..5c2c0e7a 100644 --- a/src/mmg3d/colver_3d.c +++ b/src/mmg3d/colver_3d.c @@ -428,7 +428,7 @@ int MMG3D_get_shellEdgeTag_oneDir(MMG5_pMesh mesh,MMG5_int start, MMG5_int na, * consistent through the edge shell); * */ -static inline +//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 5f46d238..bb832b8d 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 mesh,MMG5_int start, int8_t ia,int16_t *tag,MMG5_int *ref); 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 b07d4a56..90b4f505 100644 --- a/src/mmg3d/mmg3d3.c +++ b/src/mmg3d/mmg3d3.c @@ -127,6 +127,7 @@ static MMG5_int MMG5_spllag(MMG5_pMesh mesh,MMG5_pSol disp,MMG5_pSol met,int itd /* find longest, internal edge */ imax = -1; lmax = 0.0; + int ddebug = -1; for (i=0; i<6; i++) { i1 = MMG5_iare[i][0]; i2 = MMG5_iare[i][1]; @@ -139,7 +140,27 @@ static MMG5_int MMG5_spllag(MMG5_pMesh mesh,MMG5_pSol disp,MMG5_pSol met,int itd if ( pxt && (pxt->tag[i] & MG_BDY) ) continue; - if( (p0->tag & MG_BDY) && (p1->tag & MG_BDY) ) continue; + if( (p0->tag & MG_BDY) && (p1->tag & MG_BDY) ) { + + if ( pxt ) { + printf(" ftag %d %d\n",pxt->ftag[MMG5_ifar[i][0]],pxt->ftag[MMG5_ifar[i][1]]); + } + 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 ( tag ) { + printf("Result with getShellEdgeTag %d\n",tag); + ddebug = i; + // continue; + } + else { + printf("split of int edge\n"); + } + } 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]) @@ -150,11 +171,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; } @@ -257,6 +279,14 @@ static MMG5_int MMG5_spllag(MMG5_pMesh mesh,MMG5_pSol disp,MMG5_pSol met,int itd else { ns++; } + + if ( ddebug == imax ) { + printf("Split bdy edge in Elt %d\n",MMG3D_indElt(mesh,k)); + MMG3D_packMesh(mesh,0,0); + MMG3D_saveMesh(mesh,"BdyEdg-split-avtSplit.mesh"); + assert ( 0 ); + } + } return ns;