Skip to content

Commit 5185efa

Browse files
committed
Patch errors in pattern step : do not compute normals and tangent along non-manifold edges to avoid failure in pattern step.
1 parent fcb5fa6 commit 5185efa

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

src/mmgs/mmgs1.c

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -222,12 +222,6 @@ int chkedg(MMG5_pMesh mesh,int iel) {
222222
p[1] = &mesh->point[pt->v[1]];
223223
p[2] = &mesh->point[pt->v[2]];
224224

225-
for(i=0 ; i<3 ;i++) {
226-
t1[i]=400;
227-
t2[i]=300;
228-
for(i1=0 ; i1<3 ; i1++)
229-
t[i][i1] = 1000000;
230-
}
231225
/* normal recovery */
232226
for (i=0; i<3; i++) {
233227
if ( MS_SIN(p[i]->tag) ) {
@@ -617,6 +611,7 @@ static int anaelt(MMG5_pMesh mesh,MMG5_pSol met,char typchk) {
617611
ppt->ref = pt->edg[i];
618612
ppt->xp = mesh->xp;
619613
go = &mesh->xpoint[mesh->xp];
614+
memset(go->n2,0x00,3*sizeof(double));
620615
memcpy(go->n1,no,3*sizeof(double));
621616

622617
dd = go->n1[0]*ppt->n[0] + go->n1[1]*ppt->n[1] + go->n1[2]*ppt->n[2];
@@ -647,7 +642,7 @@ static int anaelt(MMG5_pMesh mesh,MMG5_pSol met,char typchk) {
647642
return -1;
648643
}
649644
}
650-
else if ( pt->tag[i] & MG_GEO ) {
645+
else if ( pt->tag[i] & MG_GEO && !(pt->tag[i] & MG_NOM) ) {
651646
ppt = &mesh->point[ip];
652647
go = &mesh->xpoint[ppt->xp];
653648
memcpy(go->n2,no,3*sizeof(double));
@@ -669,7 +664,9 @@ static int anaelt(MMG5_pMesh mesh,MMG5_pSol met,char typchk) {
669664
fprintf(stderr,"\n ## Warning: %s: flattened angle around ridge."
670665
" Unable to split it.\n",__func__);
671666
}
672-
if ( !MMGS_delPatternPts( mesh, hash) ) return -1;
667+
/* Remove the point */
668+
MMGS_delPt(mesh,ip);
669+
MMG5_hashUpdate(&hash,ip1,ip2,0);
673670
}
674671
}
675672
}
@@ -1095,7 +1092,7 @@ static int adpspl(MMG5_pMesh mesh,MMG5_pSol met) {
10951092
MMGS_delPt(mesh,ip);
10961093
return ns;
10971094
}
1098-
/* if we realloc memory in split1b pt pointer is not valid aymore. */
1095+
/* if we realloc memory in split1b pt pointer is not valid anymore. */
10991096
ns += ier;
11001097
}
11011098
}

0 commit comments

Comments
 (0)