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

Fix CoquilFace warning #234

Merged
merged 2 commits into from
Jan 19, 2024
Merged
Changes from 1 commit
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
6 changes: 4 additions & 2 deletions src/mmg3d/colver_3d.c
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,8 @@ int MMG3D_get_shellEdgeTag_oneDir(MMG5_pMesh mesh,MMG5_int start, MMG5_int na,
if ( pt->xt ) {
pxt = &mesh->xtetra[pt->xt];
*ref = pxt->edg[i];
if ( pxt->tag[i] & MG_BDY ) {
if ((pxt->ftag[MMG5_ifar[i][0]] & MG_BDY) || (pxt->ftag[MMG5_ifar[i][1]] & MG_BDY)) {
*tag |= MG_BDY;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • The if ( pxt->tag[i] & MG_BDY ) can be kept as it may allow to exit the loop faster;
  • You can assign both pxt->tag[i] and MG_BDY tag using the bitewise OR operator pxt->tag[i] | MG_BDY

Finally, the test must be something like that:

if ( pxt->tag[i] & MG_BDY ) {
  *tag |= pxt->tag[i];
  *filled =1;
   return adj;
}  else if ((pxt->ftag[MMG5_ifar[i][0]] & MG_BDY) || (pxt->ftag[MMG5_ifar[i][1]] & MG_BDY)) {
  *tag |= (pxt->tag[i] | MG_BDY);
  *filled = 1;
   return adj;
}

*tag |= pxt->tag[i];
*filled = 1;
return adj;
Expand Down Expand Up @@ -445,7 +446,8 @@ int MMG3D_get_shellEdgeTag(MMG5_pMesh mesh,MMG5_int start, int8_t ia,int16_t *t

if ( pt->xt ) {
pxt = &mesh->xtetra[pt->xt];
if ( pxt->tag[ia] & MG_BDY ) {
if ((pxt->ftag[MMG5_ifar[ia][0]] & MG_BDY) || (pxt->ftag[MMG5_ifar[ia][1]] & MG_BDY)) {
*tag |= MG_BDY;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same remarks

*tag |= pxt->tag[ia];
*ref = pxt->edg[ia];
return 1;
Expand Down