Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore MG_OLDPARBDY tag in MMG5_coltet and MMG5_coltetlag #272

Merged
merged 1 commit into from
May 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 18 additions & 7 deletions src/mmg3d/mmg3d1.c
Original file line number Diff line number Diff line change
Expand Up @@ -899,7 +899,7 @@ static MMG5_int MMG5_coltet(MMG5_pMesh mesh,MMG5_pSol met,int8_t typchk) {
MMG5_int base,k,nc,nnm,lists[MMG3D_LMAX+2],refmin,refplus;
int64_t list[MMG3D_LMAX+2];
int l,kk,isloc,ifac1;
int16_t tag,isnm,isnmint;
int16_t tag,tag0,tag1,isnm,isnmint;
int8_t i,j,ip,iq;
int ier, bsret; // function return values/error codes

Expand Down Expand Up @@ -938,9 +938,10 @@ static MMG5_int MMG5_coltet(MMG5_pMesh mesh,MMG5_pSol met,int8_t typchk) {
}
else {
/* Ignore OLDPARBDY tag of p0 */
int16_t tag = p0->tag;
tag &= ~MG_OLDPARBDY;
if ( (tag > p1->tag) || (tag & MG_REQ) ) {
int16_t tag0 = p0->tag, tag1 = p1->tag;
tag0 &= ~MG_OLDPARBDY;
tag1 &= ~MG_OLDPARBDY;
if ( (tag0 > tag1) || (tag0 & MG_REQ) ) {
/* Unable to merge edge */
continue;
}
Expand All @@ -956,8 +957,13 @@ static MMG5_int MMG5_coltet(MMG5_pMesh mesh,MMG5_pSol met,int8_t typchk) {
tag = pxt->tag[MMG5_iarf[i][j]];
isnm = (tag & MG_NOM);
isnmint = ( p0->xp && mesh->xpoint[p0->xp].nnor );
/* Ignore MG_OLDPARBDY for tags: commit c51f5f4f86292bdb0e33adb07c21ed327b1e2ec0 (pull request #241)
updates edge tags in splits: MG_OLDPARBDY may appear in edge tags and not in corresponding points
which could cause a wrong treatment of the next if statement */
tag0 = p0->tag & ~MG_OLDPARBDY;
tag &= ~MG_OLDPARBDY;

if ( p0->tag > tag ) continue;
if ( tag0 > tag ) continue;

/* Catch an exterior non manifold point by an external face */
if ( isnm ) {
Expand Down Expand Up @@ -1096,7 +1102,10 @@ static MMG5_int MMG5_coltet(MMG5_pMesh mesh,MMG5_pSol met,int8_t typchk) {
isnm = (tag & MG_NOM);
isnmint = ( p0->xp && mesh->xpoint[p0->xp].nnor );

if ( p0->tag > tag ) continue;
tag0 = p0->tag & ~MG_OLDPARBDY;
tag &= ~MG_OLDPARBDY;

if ( tag0 > tag ) continue;
if ( isnm ) {
if ( isnmint ) {
assert( 0<=ip && ip<4 && "unexpected local index for vertex");
Expand Down Expand Up @@ -1130,7 +1139,9 @@ static MMG5_int MMG5_coltet(MMG5_pMesh mesh,MMG5_pSol met,int8_t typchk) {
if ( pt->xt && (pxt->ftag[i] & MG_BDY) ) {
tag = pxt->tag[MMG5_iarf[i][j]];
tag |= MG_BDY;
if ( p0->tag > tag ) continue;
tag &= ~MG_OLDPARBDY;
tag0 &= ~MG_OLDPARBDY;
if ( tag0 > tag ) continue;

isnm = ( tag & MG_NOM );
isnmint = ( tag & MG_NOM ) ? ( p0->xp && mesh->xpoint[p0->xp].nnor ) : 0;
Expand Down
5 changes: 4 additions & 1 deletion src/mmg3d/mmg3d3.c
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,7 @@
MMG5_int k,nc,nnm,base;
int ier;
int8_t i,j,ip,iq,isnm;
int16_t tag0, tag1;

nc = nnm = 0;
hmi2 = mesh->info.hmin*mesh->info.hmin;
Expand All @@ -435,9 +436,11 @@

p0 = &mesh->point[pt->v[ip]];
p1 = &mesh->point[pt->v[iq]];
tag0 = p0->tag & ~MG_OLDPARBDY;
tag1 = p1->tag & ~MG_OLDPARBDY;
if ( p0->flag == base ) continue;
else if ( p0->tag & MG_BDY ) continue;
else if ( (p0->tag & MG_REQ) || (p0->tag > p1->tag) ) continue;
else if ( (p0->tag & MG_REQ) || (tag0 > tag1) ) continue;

Check warning on line 443 in src/mmg3d/mmg3d3.c

View check run for this annotation

Codecov / codecov/patch

src/mmg3d/mmg3d3.c#L443

Added line #L443 was not covered by tests

/* check length */
ux = p1->c[0] - p0->c[0];
Expand Down