Skip to content

Commit

Permalink
Split internal edges connecting bdy points (mmg3d lag).
Browse files Browse the repository at this point in the history
  - Autorize the split of internal edges connecting boundary points in lagrangian option of mmg3d.
  - Fix the detection of boundary edges (that has lead to forbid the previous splits, see commit `73ae8fe7e`). Erroneous check was added by commit `5384387d7` under the erroneous assertion that boundary edges belonging to boundary faces are always marked as `MG_BDY`. It is not the case as at least pattern splitting are created regular boundary edges with no tags and as tetra without boundary faces may have edges along the boundary and either no xtetra, or a xtetra with a 0 tag for the edge or a xtetra whith suitable edge infos.
  • Loading branch information
Algiane committed Dec 18, 2023
1 parent 3a5e3ab commit fb79efb
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
1 change: 0 additions & 1 deletion src/mmg3d/colver_3d.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions src/mmg3d/libmmg3d_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
22 changes: 19 additions & 3 deletions src/mmg3d/mmg3d3.c
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
Expand All @@ -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;
}
Expand Down

0 comments on commit fb79efb

Please sign in to comment.