60 uint16_t tag,MMG5_int nmref,MMG5_int edgref,
61 double no1[3],
double no2[3],
double to[3]) {
72 memcpy(pxp->
n1,no1,3*
sizeof(
double));
73 memcpy(ppt->
n,to,3*
sizeof(
double));
77 memcpy(pxp->
n1,no1,3*
sizeof(
double));
78 memcpy(pxp->
n2,no2,3*
sizeof(
double));
79 memcpy(ppt->
n,to,3*
sizeof(
double));
83 memcpy(pxp->
n1,no1,3*
sizeof(
double));
84 memcpy(ppt->
n,to,3*
sizeof(
double));
88 memcpy(pxp->
n1,no1,3*
sizeof(
double));
107 assert ( 0<=ie && ie<4 &&
"unexpected local face idx");
117 for (i=0; i<3; i++) {
123 for (i=0; i<3; i++) {
143 double o[6][3],p[6][3];
153 for (i=0; i<6; i++) {
154 memset(p[i],0,3*
sizeof(
double));
155 memset(o[i],0,3*
sizeof(
double));
162 o[i][0] = 0.5 * (pa->
c[0] + pb->
c[0]);
163 o[i][1] = 0.5 * (pa->
c[1] + pb->
c[1]);
164 o[i][2] = 0.5 * (pa->
c[2] + pb->
c[2]);
177 for (i=0; i<6; i++) {
180 ps->
c[0] = o[i][0] + t*(p[i][0] - o[i][0]);
181 ps->
c[1] = o[i][1] + t*(p[i][1] - o[i][1]);
182 ps->
c[2] = o[i][2] + t*(p[i][2] - o[i][2]);
186 case 1:
case 2:
case 4:
case 8:
case 16:
case 32:
189 case 48:
case 24:
case 40:
case 6:
case 34:
case 36:
190 case 20:
case 5:
case 17:
case 9:
case 3:
case 10:
193 case 33:
case 18:
case 12:
196 case 11:
case 21:
case 38:
case 56:
199 case 7:
case 25:
case 42:
case 52:
202 case 35:
case 19:
case 13:
case 37:
case 22:
case 28:
case 26:
203 case 14:
case 49:
case 50:
case 44:
case 41:
206 case 23:
case 29:
case 53:
case 60:
case 57:
case 58:
207 case 27:
case 15:
case 43:
case 39:
case 54:
case 46:
210 case 30:
case 45:
case 51:
213 case 62:
case 61:
case 59:
case 55:
case 47:
case 31:
225 while ( ++it < maxit );
229 for (i=0; i<6; i++) {
232 ps->
c[0] = o[i][0] + t*(p[i][0] - o[i][0]);
233 ps->
c[1] = o[i][1] + t*(p[i][1] - o[i][1]);
234 ps->
c[2] = o[i][2] + t*(p[i][2] - o[i][2]);
241 case 1:
case 2:
case 4:
case 8:
case 16:
case 32:
244 case 48:
case 24:
case 40:
case 6:
case 34:
case 36:
245 case 20:
case 5:
case 17:
case 9:
case 3:
case 10:
248 case 33:
case 18:
case 12:
251 case 11:
case 21:
case 38:
case 56:
254 case 7:
case 25:
case 42:
case 52:
257 case 35:
case 19:
case 13:
case 37:
case 22:
case 28:
case 26:
258 case 14:
case 49:
case 50:
case 44:
case 41:
261 case 23:
case 29:
case 53:
case 60:
case 57:
case 58:
262 case 27:
case 15:
case 43:
case 39:
case 54:
case 46:
265 case 30:
case 45:
case 51:
268 case 62:
case 61:
case 59:
case 55:
case 47:
case 31:
298 double m[3],o[3],tp,to,t;
317 m[0] = 0.5*(p0->
c[0] + p1->
c[0]);
318 m[1] = 0.5*(p0->
c[1] + p1->
c[1]);
319 m[2] = 0.5*(p0->
c[2] + p1->
c[2]);
327 ppt->
c[0] = m[0] + t*(o[0]-m[0]);
328 ppt->
c[1] = m[1] + t*(o[1]-m[1]);
329 ppt->
c[2] = m[2] + t*(o[2]-m[2]);
338 while ( ++it < maxit );
342 ppt->
c[0] = m[0] + t*(o[0]-m[0]);
343 ppt->
c[1] = m[1] + t*(o[1]-m[1]);
344 ppt->
c[2] = m[2] + t*(o[2]-m[2]);
364 double hausd,
int locPar) {
368 double n[3][3],t[3][3],nt[3],*n1,*n2,t1[3],t2[3];
369 double ps,ps2,ux,uy,uz,ll,il,alpha,dis,hma2;
372 static int8_t mmgWarn0 = 0, mmgWarn1 = 0;
385 for (i=0; i<3; i++) {
386 if (
MG_SIN(p[i]->tag) ) {
402 memcpy(&t[i],p[i]->n,3*
sizeof(
double));
407 if (
MG_EDG(p[i]->tag) ) {
408 memcpy(&t[i],p[i]->n,3*
sizeof(
double));
415 ps = pxp->
n1[0]*nt[0] + pxp->
n1[1]*nt[1] + pxp->
n1[2]*nt[2];
416 ps2 = pxp->
n2[0]*nt[0] + pxp->
n2[1]*nt[1] + pxp->
n2[2]*nt[2];
417 if ( fabs(ps) > fabs(ps2) )
418 memcpy(&n[i],pxp->
n1,3*
sizeof(
double));
420 memcpy(&n[i],pxp->
n2,3*
sizeof(
double));
423 memcpy(&n[i],pxp->
n1,3*
sizeof(
double));
428 for (i=0; i<3; i++) {
493 ux = p[i2]->
c[0] - p[i1]->
c[0];
494 uy = p[i2]->
c[1] - p[i1]->
c[1];
495 uz = p[i2]->
c[2] - p[i1]->
c[2];
496 ll = ux*ux + uy*uy + uz*uz;
498 else if ( ll > hma2 ) {
506 if (
MG_SIN(p[i1]->tag) ) {
514 fprintf(stderr,
"\n ## Warning: %s: a- at least 1 geometrical"
515 " problem: non consistency between point tag (%d) and"
516 " edge tag (%d).\n",__func__,p[i1]->tag,pt->
tag[i]);
521 memcpy(t1,t[i1],3*
sizeof(
double));
522 ps = t1[0]*ux + t1[1]*uy + t1[2]*uz;
529 if (
MG_SIN(p[i2]->tag) ) {
537 fprintf(stderr,
"\n ## Warning: %s: b- at least 1 geometrical"
538 " problem: non consistency between point tag (%d) and"
539 " edge tag (%d).\n",__func__,p[i2]->tag,pt->
tag[i]);
544 memcpy(t2,t[i2],3*
sizeof(
double));
545 ps = - ( t2[0]*ux + t2[1]*uy + t2[2]*uz );
567 ps = t1[0]*ux + t1[1]*uy + t1[2]*uz;
569 dis = alpha*alpha*fabs(1.0 - ps*ps);
570 if ( dis > hausd*hausd ) {
574 ps = -( t2[0]*ux + t2[1]*uy + t2[2]*uz );
576 dis = alpha*alpha*fabs(1.0 - ps*ps);
578 if ( dis > hausd*hausd ) {
601 int it,ilist,ret,maxit;
603 MMG5_int k,it1,it2,ns,nns;
610 for (k=1; k<=
mesh->
ne; k++) {
613 else if ( !pt->
xt )
continue;
616 for (i=0; i<4; i++) {
619 for (j=0; j<3; j++) {
630 if ( ret < 0 )
return -1;
632 if ( ilist <= 1 )
continue;
641 else if (
ier < 0 )
return -1;
650 while ( ++it < maxit && ns > 0 );
652 fprintf(stdout,
" %8" MMG5_PRId
" edge swapped\n",nns);
676 int ilist,it,maxit,
ier;
678 MMG5_int k,ns,nns,nconf;
686 for (k=1; k<=
mesh->
ne; k++) {
689 else if ( pt->
mark < testmark )
continue;
691 if ( pt->
qual > declic )
continue;
693 for (i=0; i<6; i++) {
697 if ( pxt->
edg[i] || pxt->
tag[i] )
continue;
701 if ( nconf<0 )
return -1;
705 else if (
ier < 0 )
return -1;
712 while ( ++it < maxit && ns > 0 );
714 fprintf(stdout,
" %8" MMG5_PRId
" edge swapped\n",nns);
737 double clickSurf,
double clickVol,
int moveVol,
int improveSurf,
738 int improveVolSurf,
int improveVol,
int maxit,MMG5_int testmark) {
744 int ier,ilists,ilistv,it,i;
745 MMG5_int k,lists[
MMG3D_LMAX+2],nm,nnm,ns,base;
750 fprintf(stdout,
" ** OPTIMIZING MESH\n");
753 for (k=1; k<=
mesh->
np; k++)
760 for (k=1; k<=
mesh->
ne; k++) {
763 else if ( pt->
mark < testmark )
continue;
766 for (i=0; i<4; i++) {
767 for (j=0; j<3; j++) {
775 if ( ppt->
flag == base )
continue;
782 assert( 0<=i && i<4 &&
"unexpected local face idx");
784 caltri = MMG5_caltri(
mesh,met,&tt);
786 if ( caltri >= clickSurf) {
801 assert( 0<=i0 && i0<4 &&
"unexpected local index for vertex");
803 if ( !ilistv )
continue;
808 if (
mesh->
adja[4*(k-1)+1+i] )
continue;
813 ier = MMG5_movbdynompt(
mesh,met,PROctree,listv,ilistv,lists,ilists,improveVolSurf);
820 if ( !
ier )
continue;
822 ier = MMG5_movbdyridpt(
mesh,met,PROctree,listv,ilistv,lists,ilists,improveVolSurf);
831 ier = MMG5_movbdyrefpt(
mesh,met,PROctree,listv,ilistv,lists,ilists,improveVolSurf);
851 ier = MMG5_movbdyregpt(
mesh,met,PROctree,listv,ilistv,
852 lists,ilists,improveSurf,improveVolSurf);
853 if (
ier < 0 )
return -1;
854 else if (
ier ) ns++;
857 else if ( moveVol && (pt->
qual < clickVol) ) {
858 assert( 0<=i0 && i0<4 &&
"unexpected local index for vertex");
860 if ( !ilistv )
continue;
861 ier = MMG5_movintpt(
mesh,met,PROctree,listv,ilistv,improveVol);
873 if (
mesh->
info.
ddebug ) fprintf(stdout,
" %8" MMG5_PRId
" moved, %" MMG5_PRId
" geometry\n",nm,ns);
875 while( ++it < maxit && nm > 0 );
878 fprintf(stdout,
" %8" MMG5_PRId
" vertices moved, %d iter.\n",nnm,it);
897 double ll,ux,uy,uz,hmi2;
899 MMG5_int base,k,nc,nnm,lists[
MMG3D_LMAX+2],refmin,refplus;
901 int l,kk,isloc,ifac1;
903 uint16_t tag,tag0,tag1,isnm;
912 for (k=1; k<=
mesh->
np; k++) {
917 for (k=1; k<=
mesh->
ne; k++) {
925 for (i=0; i<4; i++) {
928 for (j=0; j<3; j++) {
936 if ( p0->
flag == base ) {
944 uint16_t tag0 = p0->
tag, tag1 = p1->
tag;
945 tag0 &= ~MG_OLDPARBDY;
946 tag1 &= ~MG_OLDPARBDY;
947 if ( (tag0 > tag1) || (tag0 &
MG_REQ) ) {
958 refmin = refplus = -1;
967 tag0 = p0->
tag & ~MG_OLDPARBDY;
968 tag &= ~MG_OLDPARBDY;
970 if ( tag0 > tag )
continue;
975 assert( 0<=ip && ip<4 &&
"unexpected local index for vertex");
979 if (
mesh->
adja[4*(k-1)+1+i] )
continue;
982 list,&ilist,lists,&ilists,&refmin,&refplus,p0->
tag &
MG_NOM);
983 if(bsret==-1 || bsret==-3 || bsret==-4){
988 assert(bsret==1 &&
"unexpected return value from MMG5_boulesurfvolpNom");
993 list,&ilist,lists,&ilists,p0->
tag &
MG_NOM) < 0 )
998 assert( 0<=ip && ip<4 &&
"unexpected local index for vertex");
1004 if ( typchk == 1 ) {
1005 ux = p1->
c[0] - p0->
c[0];
1006 uy = p1->
c[1] - p0->
c[1];
1007 uz = p1->
c[2] - p0->
c[2];
1008 ll = ux*ux + uy*uy + uz*uz;
1027 for ( kk=0; kk<ilist; ++kk ) {
1029 if ( par->
ref == ptloc->
ref ) {
1041 for ( kk=0; kk<ilist; ++kk ) {
1043 if ( par->
ref == ptloc->
ref ) {
1061 for ( kk=0; kk<ilists; ++kk ) {
1063 ifac1 = lists[kk] % 4;
1078 for ( kk=0; kk<ilists; ++kk ) {
1080 ifac1 = lists[kk] % 4;
1094 else if ( typchk == 2 ) {
1097 if ( ll == 0 )
continue;
1109 tag0 = p0->
tag & ~MG_OLDPARBDY;
1110 tag &= ~MG_OLDPARBDY;
1112 if ( tag0 > tag )
continue;
1115 assert( 0<=ip && ip<4 &&
"unexpected local index for vertex");
1119 if (
mesh->
adja[4*(k-1)+1+i] )
continue;
1121 list,&ilist,lists,&ilists,&refmin,&refplus,p0->
tag &
MG_NOM);
1122 if(bsret==-1 || bsret==-3 || bsret==-4){
1124 }
else if(bsret==-2){
1127 assert(bsret==1 &&
"unexpected return value from MMG5_boulesurfvolpNom");
1132 list,&ilist,lists,&ilists,p0->
tag &
MG_NOM) < 0 )
1137 assert( 0<=ip && ip<4 &&
"unexpected local index for vertex");
1146 tag &= ~MG_OLDPARBDY;
1147 tag0 &= ~MG_OLDPARBDY;
1148 if ( tag0 > tag )
continue;
1152 if ( isnm && (!isnmint) ) {
1154 if (
mesh->
adja[4*(k-1)+1+i] )
continue;
1156 ilist =
MMG5_chkcol_bdy(
mesh,met,k,i,j,list,ilist,lists,ilists,refmin,refplus,typchk,isnm,isnmint);
1167 if (
ier < 0 )
return -5;
1173 else if (ilist < 0 )
return -6;
1184 fprintf(stdout,
" %8" MMG5_PRId
" vertices removed, %8" MMG5_PRId
" non manifold,\n",nc,nnm);
1212 int8_t imin,
double lmin,MMG5_int* nc) {
1235 MMG3D_find_bdyface_from_edge(
mesh,pt,imin,&i,&j,&i1,&i2,&ip1,&ip2,&p0,&p1);
1238 uint16_t tag0 = p0->
tag;
1239 tag0 &= ~MG_OLDPARBDY;
1240 if ( (tag0 > p1->
tag) || (tag0 &
MG_REQ) ) {
1254 tag &= ~MG_OLDPARBDY;
1267 ilist =
MMG5_chkcol_bdy(
mesh,met,k,i,j,list,ilist,lists,ilists,0,0,2,0,0);
1293 if ( PROctree && (*PROctree) ) {
1301 else if (ilist < 0 ) {
1326 for (k=1; k<=
mesh->
ne; k++) {
1330 memset(vx,0,6*
sizeof(MMG5_int));
1331 for (ia=0,i=0; i<3; i++) {
1332 for (j=i+1; j<4; j++,ia++) {
1338 fprintf(stderr,
"\n ## Error: %s: unable to delete point idx"
1339 " along edge %" MMG5_PRId
" %" MMG5_PRId
".\n", __func__,
1369 double ll,o[3],ux,uy,uz,hma2,mincal;
1371 MMG5_int src,vx[6],ip,ip1,ip2,k,ne,ns,nap;
1376 memlack = ns = nap = 0;
1379 for (k=1; k<=
mesh->
ne; k++) {
1381 if ( !
MG_EOK(pt) )
continue;
1385 for (i=0; i<6; i++) {
1394 if ( !pt->
xt )
continue;
1397 for (i=0; i<4; i++) {
1399 for (j=0; j<3; j++) {
1411 for (k=1; k<=
mesh->
ne; k++) {
1413 if ( !
MG_EOK(pt) )
continue;
1415 for (i=0; i<6; i++) {
1433 ux = p2->
c[0] - p1->
c[0];
1434 uy = p2->
c[1] - p1->
c[1];
1435 uz = p2->
c[2] - p1->
c[2];
1436 ll = ux*ux + uy*uy + uz*uz;
1449 if ( par->
ref != pt->
ref )
continue;
1461 else if ( typchk == 2 ) {
1462 ll = MMG5_lenedg(
mesh,met,i,pt);
1464 if ( ll == 0 )
continue;
1471 if ( ip < 0 )
continue;
1474 o[0] = 0.5 * (p1->
c[0]+p2->
c[0]);
1475 o[1] = 0.5 * (p1->
c[1]+p2->
c[1]);
1476 o[2] = 0.5 * (p1->
c[2]+p2->
c[2]);
1488 fprintf(stderr,
"\n ## Warning: %s: unable to"
1489 " allocate a new point\n",__func__);
1498 if ( typchk == 1 && (met->
size>1) )
1501 ier = MMG5_intmet(
mesh,met,k,i,ip,0.5);
1507 else if (
ier < 0 ) {
1532 fprintf(stderr,
"\n ## Warning: %s: too bad quality for the worst element."
1533 " Volumic patterns skipped.\n",__func__);
1542 for (k=1; k<=ne; k++) {
1545 memset(vx,0,6*
sizeof(MMG5_int));
1547 for (ia=0,i=0; i<3; i++) {
1548 for (j=i+1; j<4; j++,ia++) {
1556 case 1:
case 2:
case 4:
case 8:
case 16:
case 32:
1560 case 48:
case 24:
case 40:
case 6:
case 34:
case 36:
1561 case 20:
case 5:
case 17:
case 9:
case 3:
case 10:
1566 case 33:
case 18:
case 12:
1571 case 11:
case 21:
case 38:
case 56:
1576 case 7:
case 25:
case 42:
case 52:
1581 case 35:
case 19:
case 13:
case 37:
case 22:
case 28:
case 26:
1582 case 14:
case 49:
case 50:
case 44:
case 41:
1587 case 23:
case 29:
case 53:
case 60:
case 57:
case 58:
1588 case 27:
case 15:
case 43:
case 39:
case 54:
case 46:
1594 case 30:
case 45:
case 51:
1599 case 62:
case 61:
case 59:
case 55:
case 47:
case 31:
1612 fprintf(stdout,
" %7" MMG5_PRId
" splitted\n",nap);
1615 if ( memlack )
return -1;
1634 dd = no[0]*pxp->
n1[0]+no[1]*pxp->
n1[1]+no[2]*pxp->
n1[2];
1637 memcpy(pxp->
n2,no,3*
sizeof(
double));
1640 to[0] = pxp->
n1[1]*pxp->
n2[2] - pxp->
n1[2]*pxp->
n2[1];
1641 to[1] = pxp->
n1[2]*pxp->
n2[0] - pxp->
n1[0]*pxp->
n2[2];
1642 to[2] = pxp->
n1[0]*pxp->
n2[1] - pxp->
n1[1]*pxp->
n2[0];
1643 dd = to[0]*to[0] + to[1]*to[1] + to[2]*to[2];
1645 dd = 1.0 / sqrt(dd);
1649 memcpy(ppt->
n,to,3*
sizeof(
double));
1653 if ( to[0]*to[0]+to[1]*to[1]+to[2]*to[2] >
MMG5_EPSD2 ) {
1660 assert ( ppt->
n[0]*ppt->
n[0]+ppt->
n[1]*ppt->
n[1]+ppt->
n[2]*ppt->
n[2] >
MMG5_EPSD2 );
1685 double no1[3],
double no2[3],
double to[3] ) {
1689 static int8_t warn_n = 0;
1691 assert ( 0<=i && i<4 &&
"unexpected local idx for face" );
1692 assert ( 0<=j && j<3 &&
"unexpected local edg odx in face" );
1694 assert( 0<=i && i<4 &&
"unexpected local face idx");
1698 assert (
mesh->
tetra[k].
xt &&
"Tetra is not boundary" );
1701 assert ( (pxt->
ftag[i] &
MG_BDY) &&
"Face is not boundary" );
1702 assert (
MG_GET(pxt->
ori,i) &&
"Wrong face orientation" );
1717 fprintf(stderr,
" ## Warning: %s: %d: error in the computation of normal"
1718 " at triangle.\n",__func__,__LINE__);
1720 no2[0] = to[1]*no1[2] - to[2]*no1[1];
1721 no2[1] = to[2]*no1[0] - to[0]*no1[2];
1722 no2[2] = to[0]*no1[1] - to[1]*no1[0];
1724 dd = no2[0]*no2[0] + no2[1]*no2[1] + no2[2]*no2[2];
1726 dd = 1.0 / sqrt(dd);
1736 to[0] = no1[1]*no2[2] - no1[2]*no2[1];
1737 to[1] = no1[2]*no2[0] - no1[0]*no2[2];
1738 to[2] = no1[0]*no2[1] - no1[1]*no2[0];
1739 dd = to[0]*to[0] + to[1]*to[1] + to[2]*to[2];
1741 dd = 1.0 / sqrt(dd);
1781 int8_t imax,int8_t i, int8_t j,
1783 MMG5_int ip1,MMG5_int ip2,
1785 MMG5_int *ref,uint16_t *tag,
1786 double o[3],
double to[3],
double no1[3],
1787 double no2[3],int64_t *list,
int *ilist) {
1802 *ref = pxt->
edg[imax];
1803 *tag = pxt->
tag[imax];
1816 else if ( (*ilist) < 0 ) {
1829 assert( 0<=i && i<4 &&
"unexpected local face idx");
1834 else if ( (*tag) &
MG_GEO ) {
1847 else if ( (*tag) &
MG_REF ) {
1855 assert( 0<=i && i<4 &&
"unexpected local face idx");
1871 assert( 0<=i && i<4 &&
"unexpected local face idx");
1899 int8_t *i,int8_t *j,int8_t*i1,int8_t*i2,
1913 int16_t is_ifa0_bdy = (pxt->
ftag[ifa0] &
MG_BDY);
1914 int16_t is_ifa1_bdy = (pxt->
ftag[ifa1] &
MG_BDY);
1916 if ( is_ifa0_bdy && is_ifa1_bdy ) {
1918 int8_t ifa1_ori =
MG_GET(pxt->
ori,(*i));
1919 (*i) = ifa1_ori ? ifa1 : ifa0;
1921 else if ( is_ifa1_bdy ) {
1933 (*ip1) = pt->
v[*i1];
1934 (*ip2) = pt->
v[*i2];
1959 int8_t chkRidTet,
int *warn ) {
1961 double o[3],to[3],no1[3],no2[3];
1963 MMG5_int src,ip,ip1,ip2,ref;
1969 assert ( pxt == &
mesh->
xtetra[pt->
xt] &&
"suitable xtetra assignation" );
1972 &&
"Boundary edge has to be splitted from a boundary face" );
1979 MMG3D_find_bdyface_from_edge(
mesh,pt,imax,&i,&j,&i1,&i2,&ip1,&ip2,&p0,&p1);
1981 ier =
MMG3D_build_bezierEdge(
mesh,k,imax,i,j,pxt,ip1,ip2,p0,p1,&ref,&tag,
1982 o,to,no1,no2,list,&ilist);
2013 if ( met && met->
m ) {
2014 if ( typchk == 1 && (met->
size>1) ) {
2018 ier = MMG5_intmet(
mesh,met,k,imax,ip,0.5);
2040 assert ( (
ier != -1) &&
"simbulgept failure" );
2044 if (
ier < 0 ||
ier == 2 ) {
2048 else if (
ier == 0 ) {
2055 fprintf(stderr,
"\n ## Error: %s: unable to split.\n",__func__);
2058 else if (
ier == 0 ||
ier == 2 ) {
2086 double len,hmax,hausd;
2092 if ( typchk == 1 ) {
2104 if ( par->
ref != pt->
ref )
continue;
2118 if ( par->
ref != ptt->
ref )
continue;
2130 if ( par->
ref != ptt->
ref )
continue;
2144 }
else if (
ier == 0 ) {
2150 for (j=0; j<3; j++){
2155 else if ( typchk == 2 ) {
2156 for (j=0; j<3; j++) {
2163 len = MMG5_lenedg(
mesh,met,ia,pt);
2165 assert( isfinite(len) && (len!=-len) );
2168 if ( len == 0 )
continue;
2196 MMG5_int ns,k,ip1,ip2;
2198 int8_t imax,j,i,i1,i2;
2200 assert ( met->
m && met->
size==6 );
2203 fprintf(stderr,
"\n ## Hashing problem. Exit program.\n");
2210 for (k=1; k<=
mesh->
ne; k++) {
2219 for (i=0; i<4; i++){
2226 assert( 0<=i && i<4 &&
"unexpected local face idx");
2235 for ( j=0; j<6; ++j ) {
2247 len = ux*ux + uy*uy + uz*uz;
2248 if ( len <= lmax) {
continue; }
2256 if ( !pt->
flag )
continue;
2260 if (
ier==-1 ) {
return -1; }
2261 else if ( !
ier ) {
continue; }
2262 else if (
ier==2 ) {
2298 double o[3],no[3],to[3],dd;
2300 MMG5_int ip,vx[6],src,nc,ns,ni,ne,k,ip1,ip2,nap,ixp1,ixp2;
2301 int8_t i,j,j2,ia,i1,i2,ifac,intnom;
2302 static double uv[3][2] = { {0.5,0.5}, {0.,0.5}, {0.5,0.} };
2303 static int8_t mmgWarn = 0, mmgWarn2 = 0;
2309 for (k=1; k<=
mesh->
ne; k++) {
2317 for (i=0; i<4; i++){
2321 if ( typchk == 1 ) {
2322 if ( !
MG_GET(pxt->
ori,i) ) {
continue; }
2326 assert( 0<=i && i<4 &&
"unexpected local face idx");
2331 if ( !pt->
flag )
continue;
2339 for (j=0; j<3; j++) {
2374 fprintf(stderr,
"\n ## Error: %s: unable to"
2375 " allocate a new point.\n",__func__);
2393 if ( typchk == 1 && (met->
size>1) )
2396 ier = MMG5_intmet(
mesh,met,k,ia,ip,0.5);
2400 fprintf(stderr,
"\n ## Error: %s: unable to interpolate at least"
2401 " 1 metric.\n",__func__);
2406 else if (
ier < 0 ) {
2426 if ( intnom ) pxp->
nnor = 1;
2427 else memcpy(pxp->
n1,no,3*
sizeof(
double));
2429 memcpy(ppt->
n,to,3*
sizeof(
double));
2444 assert( 0<=ifac && ifac<4 &&
"unexpected local face idx");
2485 for (k=1; k<=
mesh->
ne; k++) {
2491 for (i=0; i<4; i++) {
2495 assert( 0<=i && i<4 &&
"unexpected local face idx");
2499 for (j=0; j<3; j++) {
2509 if ( pt->
xt && (pxt->
tag[ia] &
MG_REQ) )
continue;
2517 assert ( ifac2 > i &&
"lower face is already processed" );
2539 else ier = MMG5_bezierCP(
mesh,&ptt,&pb,1);
2545 dd = no[0]*pxp->
n1[0]+no[1]*pxp->
n1[1]+no[2]*pxp->
n1[2];
2548 memcpy(pxp->
n2,no,3*
sizeof(
double));
2554 fprintf(stdout,
" %" MMG5_PRId
" added\n",nc);
2559 for (k=1; k<=
mesh->
np; k++)
2566 for (k=1; k<=
mesh->
ne; k++) {
2569 memset(vx,0,6*
sizeof(MMG5_int));
2571 for (ia=0,i=0; i<3; i++) {
2572 for (j=i+1; j<4; j++,ia++) {
2581 if ( !pt->
flag )
continue;
2584 case 1:
case 2:
case 4:
case 8:
case 16:
case 32:
2587 case 48:
case 24:
case 40:
case 6:
case 34:
case 36:
2588 case 20:
case 5:
case 17:
case 9:
case 3:
case 10:
2591 case 33:
case 18:
case 12:
2594 case 11:
case 21:
case 38:
case 56:
2597 case 7:
case 25:
case 42:
case 52:
2600 case 35:
case 19:
case 13:
case 37:
case 22:
case 28:
case 26:
2601 case 14:
case 49:
case 50:
case 44:
case 41:
2604 case 23:
case 29:
case 53:
case 60:
case 57:
case 58:
2605 case 27:
case 15:
case 43:
case 39:
case 54:
case 46:
2608 case 30:
case 45:
case 51:
2611 case 62:
case 61:
case 59:
case 55:
case 47:
case 31:
2618 if (
ier )
continue;
2622 for (ia=0; ia<6; ia++)
2628 for (ia=0; ia<6; ++ia ) {
2634 fprintf(stderr,
"\n ## Warning: %s: surfacic pattern: unable to find"
2635 " a valid split for at least 1 point. Point(s) deletion.\n",
2646 while( ni > 0 && ++it < 40 );
2649 fprintf(stdout,
" %" MMG5_PRId
" corrected, %" MMG5_PRId
" invalid\n",nc,ni);
2657 for (k=1; k<=ne; k++) {
2659 if ( !
MG_EOK(pt) || !pt->flag || (pt->tag &
MG_REQ) )
continue;
2660 memset(vx,0,6*
sizeof(MMG5_int));
2661 for (ia=0,i=0; i<3; i++) {
2662 for (j=i+1; j<4; j++,ia++) {
2663 if (
MG_GET(pt->flag,ia) ) {
2670 case 1:
case 2:
case 4:
case 8:
case 16:
case 32:
2674 case 48:
case 24:
case 40:
case 6:
case 34:
case 36:
2675 case 20:
case 5:
case 17:
case 9:
case 3:
case 10:
2680 case 33:
case 18:
case 12:
2685 case 11:
case 21:
case 38:
case 56:
2690 case 7:
case 25:
case 42:
case 52:
2695 case 35:
case 19:
case 13:
case 37:
case 22:
case 28:
case 26:
2696 case 14:
case 49:
case 50:
case 44:
case 41:
2701 case 23:
case 29:
case 53:
case 60:
case 57:
case 58:
2702 case 27:
case 15:
case 43:
case 39:
case 54:
case 46:
2708 case 30:
case 45:
case 51:
2713 case 62:
case 61:
case 59:
case 55:
case 47:
case 31:
2725 fprintf(stdout,
" %7" MMG5_PRId
" elements splitted\n",nap);
2756 int *ifac,
int* conf0,MMG5_int *adj,
int *conf1) {
2760 double calold0,calold,calnew,calnew0,calnew1,calnew2,calnew3;
2761 double worst_split4bar_cal,worst_swap_cal,cb[4];
2762 int loc_conf0,loc_conf1;
2763 MMG5_int *adja,k1,np;
2765 uint8_t tau0[4],tau1[4];
2781 for (i=0; i<4; i++) {
2783 ppt0->
c[0] += ppt->
c[0];
2784 ppt0->
c[1] += ppt->
c[1];
2785 ppt0->
c[2] += ppt->
c[2];
2791 cb[0] = 0.25; cb[1] = 0.25; cb[2] = 0.25; cb[3] = 0.25;
2794 if ( !metRidTyp && met->
size > 1 )
2797 MMG5_interp4bar(
mesh,met,k,0,cb);
2802 if ( (!metRidTyp) && met->
m && met->
size>1 )
2807 ptnew->
v[0] = pt->
v[0];
2809 if ( (!metRidTyp) && met->
m && met->
size>1 )
2814 ptnew->
v[1] = pt->
v[1];
2816 if ( (!metRidTyp) && met->
m && met->
size>1 )
2821 ptnew->
v[2] = pt->
v[2];
2823 if ( (!metRidTyp) && met->
m && met->
size>1 )
2831 worst_split4bar_cal = 0.;
2837 worst_swap_cal = 0.;
2839 for (j0=0; j0<4; j0++) {
2870 tau0[0] = 1; tau0[1] = 0; tau0[2] = 3; tau0[3] = 2;
2873 tau0[0] = 2; tau0[1] = 0; tau0[2] = 1; tau0[3] = 3;
2876 tau0[0] = 3; tau0[1] = 0; tau0[2] = 2; tau0[3] = 1;
2879 tau0[0] = 0; tau0[1] = 1; tau0[2] = 2; tau0[3] = 3;
2887 assert(pt->
ref == pt1->
ref);
2888 for ( i=0; i<3; ++i )
2896 tau1[0] = 0; tau1[1] = 2; tau1[2] = 3; tau1[3] = 1;
2899 tau1[0] = 0; tau1[1] = 3; tau1[2] = 1; tau1[3] = 2;
2902 tau1[0] = 1; tau1[1] = 0; tau1[2] = 3; tau1[3] = 2;
2905 tau1[0] = 1; tau1[1] = 3; tau1[2] = 2; tau1[3] = 0;
2908 tau1[0] = 1; tau1[1] = 2; tau1[2] = 0; tau1[3] = 3;
2911 tau1[0] = 2; tau1[1] = 0; tau1[2] = 1; tau1[3] = 3;
2914 tau1[0] = 2; tau1[1] = 1; tau1[2] = 3; tau1[3] = 0;
2917 tau1[0] = 2; tau1[1] = 3; tau1[2] = 0; tau1[3] = 1;
2920 tau1[0] = 3; tau1[1] = 0; tau1[2] = 2; tau1[3] = 1;
2923 tau1[0] = 3; tau1[1] = 2; tau1[2] = 1; tau1[3] = 0;
2926 tau1[0] = 3; tau1[1] = 1; tau1[2] = 0; tau1[3] = 2;
2929 tau1[0] = 0; tau1[1] = 1; tau1[2] = 2; tau1[3] = 3;
2937 if ( pxt1->
ftag[tau1[1]] ) ++nbdy;
2938 if ( pxt0->
ftag[tau0[1]] ) ++nbdy;
2939 if ( nbdy > 1 )
continue;
2942 if ( pxt1->
ftag[tau1[3]] ) ++nbdy;
2943 if ( pxt0->
ftag[tau0[2]] ) ++nbdy;
2944 if ( nbdy > 1 )
continue;
2947 if ( pxt1->
ftag[tau1[2]] ) ++nbdy;
2948 if ( pxt0->
ftag[tau0[3]] ) ++nbdy;
2949 if ( nbdy > 1 )
continue;
2958 np = pt1->
v[tau1[0]];
2960 ptnew->
v[tau0[1]] = np;
2961 if ( (!metRidTyp) && met->
m && met->
size>1 )
2967 ptnew->
v[tau0[1]] = pt->
v[tau0[1]];
2968 ptnew->
v[tau0[2]] = np;
2969 if ( (!metRidTyp) && met->
m && met->
size>1 )
2975 ptnew->
v[tau0[2]] = pt->
v[tau0[2]];
2976 ptnew->
v[tau0[3]] = np;
2977 if ( (!metRidTyp) && met->
m && met->
size>1 )
2986 if ( calnew < calold )
continue;
2990 if ( calnew > worst_swap_cal ) {
2991 worst_swap_cal = calnew;
3000 worst_swap_cal = 0.;
3004 if ( worst_split4bar_cal <
MMG5_EPSOK )
return 0;
3008 assert ( *adj > 0 );
3009 if ( worst_swap_cal < worst_split4bar_cal ) {
3010 if ( worst_split4bar_cal <
MMG5_EPSOK )
return 0;
3033 int conf0,conf1,ifac,id_op;
3034 MMG5_int
ier,ns,k,adj;
3037 static int8_t mmgWarn=0;
3041 for (k=1; k<=
mesh->
ne; k++) {
3058 printf(
"\n ## Warning: %s: unable to swap or split at least 1 tetra"
3059 " with multiple boundary faces.\n",__func__);
3068 if ( !
ier )
return -1;
3072 assert ( id_op==2 );
3079 else if (
ier ) ++(*nf);
3085 for (j=0; j<4; j++) {
3092 if ( !
ier )
return -1;
3100 fprintf(stdout,
" boundary elements: %7" MMG5_PRId
" splitted %7" MMG5_PRId
" swapped\n",ns,*nf);
3122 for (k=1; k<=
mesh->
ne; k++) {
3127 for (j=0; j<4; j++) {
3137 if ( !
ier )
return -1;
3143 fprintf(stdout,
" boundary elements: %7" MMG5_PRId
" splitted\n",ns);
3160 int it,minit,maxit,lastit;
3161 MMG5_int nc,ns,nnc,nns,nnf,
ier,nf;
3164 if ( met->
m && met->
size==6 ) {
3174 nns = nnc = nnf = it = 0;
3187 if (
ier < 0 )
return 0;
3189 else if ( (met->
size==6) && (typchk == 1) && lastit ) {
3191 if (
ier < 0 )
return 0;
3205 fprintf(stderr,
"\n ## Unable to complete surface mesh. Exit program.\n");
3210 if ( patternMode ) {
3216 fprintf(stderr,
"\n ## Unable to complete volume mesh. Exit program.\n");
3224 fprintf(stderr,
"\n ## Hashing problem. Exit program.\n");
3232 fprintf(stderr,
"\n ## Unable to collapse mesh. Exiting.\n");
3242 fprintf(stderr,
"\n ## Unable to improve mesh. Exiting.\n");
3249 fprintf(stderr,
"\n ## Unable to improve mesh. Exiting.\n");
3261 fprintf(stdout,
" ");
3263 fprintf(stdout,
" %8" MMG5_PRId
" splitted, %8" MMG5_PRId
" collapsed, %8" MMG5_PRId
" swapped\n",ns,nc,nf);
3266 if ( it > minit-1 && ( !(ns+nc) || (MMG5_abs(nc-ns) < 0.1 *
MG_MAX(nc,ns)) ) ) {
3268 if ( it > minit && lastit>2 )
break;
3270 else if ( it+2 >= maxit ) {
3274 else if ( lastit ) {
3281 while ( ++it < maxit && (ns+nc+nf > 0 || lastit<3) );
3286 fprintf(stdout,
" ");
3288 fprintf(stdout,
" %8" MMG5_PRId
" splitted, %8" MMG5_PRId
" collapsed, %8" MMG5_PRId
" swapped, %d iter.\n",nns,nnc,nnf,it);
int MMG3D_delPROctree(MMG5_pMesh mesh, MMG3D_pPROctree q, const int no)
int MMG3D_bezierInt(MMG5_pBezier pb, double uv[2], double o[3], double no[3], double to[3])
int MMG5_BezierTgt(double c1[3], double c2[3], double n1[3], double n2[3], double t1[3], double t2[3])
double MMG5_BezierGeod(double c1[3], double c2[3], double t1[3], double t2[3])
int MMG5_boulevolp(MMG5_pMesh mesh, MMG5_int start, int ip, int64_t *list)
Given a vertex and a tetrahedron, find all tetrahedra in the ball of this vertex.
int MMG5_boulesurfvolp(MMG5_pMesh mesh, MMG5_int start, int ip, int iface, int64_t *listv, int *ilistv, MMG5_int *lists, int *ilists, int isnm)
int MMG5_boulesurfvolpNom(MMG5_pMesh mesh, MMG5_int start, int ip, int iface, int64_t *listv, int *ilistv, MMG5_int *lists, int *ilists, MMG5_int *refmin, MMG5_int *refplus, int isnm)
int MMG5_coquilface(MMG5_pMesh mesh, MMG5_int start, int8_t iface, int ia, int64_t *list, MMG5_int *it1, MMG5_int *it2, int silent)
int MMG5_coquil(MMG5_pMesh mesh, MMG5_int start, int ia, int64_t *list, int8_t *isbdy)
MMG5_int MMG5_colver(MMG5_pMesh mesh, MMG5_pSol met, int64_t *list, int ilist, int8_t indq, int8_t typchk)
int MMG5_chkcol_int(MMG5_pMesh mesh, MMG5_pSol met, MMG5_int k, int8_t iface, int8_t iedg, int64_t *list, int ilist, int8_t typchk)
int MMG5_chkcol_bdy(MMG5_pMesh mesh, MMG5_pSol met, MMG5_int k, int8_t iface, int8_t iedg, int64_t *listv, int ilistv, MMG5_int *lists, int ilists, MMG5_int refmin, MMG5_int refplus, int8_t typchk, int isnm, int8_t isnmint)
int MMG5_hashUpdate(MMG5_Hash *hash, MMG5_int a, MMG5_int b, MMG5_int k)
int MMG5_hashNew(MMG5_pMesh mesh, MMG5_Hash *hash, MMG5_int hsiz, MMG5_int hmax)
MMG5_int MMG5_hashGet(MMG5_Hash *hash, MMG5_int a, MMG5_int b)
int MMG5_hashEdge(MMG5_pMesh mesh, MMG5_Hash *hash, MMG5_int a, MMG5_int b, MMG5_int k)
int MMG3D_hashTetra(MMG5_pMesh mesh, int pack)
Create array of adjacency.
int MMG5_hashPop(MMG5_Hash *hash, MMG5_int a, MMG5_int b)
static double MMG5_orcal(MMG5_pMesh mesh, MMG5_pSol met, MMG5_int iel)
int MMG5_interp4bar33_ani(MMG5_pMesh mesh, MMG5_pSol met, MMG5_int k, MMG5_int ip, double cb[4])
int MMG3D_intmet33_ani(MMG5_pMesh mesh, MMG5_pSol met, MMG5_int k, int8_t i, MMG5_int ip, double s)
API headers and documentation for the mmg3d library, for volumetric meshes in 3D.
int MMG5_split4op(MMG5_pMesh mesh, MMG5_pSol met, MMG5_int k, MMG5_int vx[6], int8_t)
int MMG5_split3op(MMG5_pMesh mesh, MMG5_pSol met, MMG5_int k, MMG5_int vx[6], int8_t)
int MMG5_split1b(MMG5_pMesh, MMG5_pSol, int64_t *, int, MMG5_int, int, int8_t, int8_t)
int MMG3D_split6_sim(MMG5_pMesh mesh, MMG5_pSol met, MMG5_int k, MMG5_int vx[6])
MMG5_int MMG5_chkswpgen(MMG5_pMesh, MMG5_pSol, MMG5_int, int, int *, int64_t *, double, int8_t)
int MMG5_swpbdy(MMG5_pMesh, MMG5_pSol, int64_t *, int, MMG5_int, MMG3D_pPROctree, int8_t)
int MMG3D_split3_sim(MMG5_pMesh mesh, MMG5_pSol met, MMG5_int k, MMG5_int vx[6])
int MMG5_BezierReg(MMG5_pMesh mesh, MMG5_int ip0, MMG5_int ip1, double s, double v[3], double *o, double *no)
MMG5_int MMG5_split4bar(MMG5_pMesh mesh, MMG5_pSol met, MMG5_int k, int8_t)
int MMG5_split5(MMG5_pMesh mesh, MMG5_pSol met, MMG5_int k, MMG5_int vx[6], int8_t)
int MMG3D_split3cone_sim(MMG5_pMesh mesh, MMG5_pSol met, MMG5_int k, MMG5_int vx[6])
int MMG3D_normalAdjaTri(MMG5_pMesh, MMG5_int, int8_t, int, double n[3])
int MMG3D_simbulgept(MMG5_pMesh mesh, MMG5_pSol met, int64_t *list, int ilist, MMG5_int)
void MMG3D_delPt(MMG5_pMesh mesh, MMG5_int ip)
int MMG5_split1(MMG5_pMesh mesh, MMG5_pSol met, MMG5_int k, MMG5_int vx[6], int8_t metRidTyp)
MMG5_int MMG3D_indPt(MMG5_pMesh mesh, MMG5_int kp)
MMG5_int MMG3D_newPt(MMG5_pMesh mesh, double c[3], uint16_t tag, MMG5_int src)
int MMG5_split4sf(MMG5_pMesh mesh, MMG5_pSol met, MMG5_int k, MMG5_int vx[6], int8_t)
static const int8_t MMG5_iarfinv[4][6]
num of the j^th edge in the i^th face
int MMG5_chkswpbdy(MMG5_pMesh, MMG5_pSol, int64_t *, int, MMG5_int, MMG5_int, int8_t)
int MMG3D_swap23(MMG5_pMesh, MMG5_pSol, MMG5_int, int8_t, int, int, MMG5_int, int)
int MMG5_split6(MMG5_pMesh mesh, MMG5_pSol met, MMG5_int k, MMG5_int vx[6], int8_t)
int MMG3D_split2sf_sim(MMG5_pMesh mesh, MMG5_pSol met, MMG5_int k, MMG5_int vx[6])
int MMG5_BezierRidge(MMG5_pMesh mesh, MMG5_int ip0, MMG5_int ip1, double s, double *o, double *no1, double *no2, double *to)
int MMG3D_split4op_sim(MMG5_pMesh mesh, MMG5_pSol met, MMG5_int k, MMG5_int vx[6])
static const int8_t MMG5_iarf[4][3]
iarf[i]: edges of face opposite to vertex i
double MMG5_caltet33_ani(MMG5_pMesh mesh, MMG5_pSol met, MMG5_pTetra pt)
int MMG5_swpgen(MMG5_pMesh, MMG5_pSol, MMG5_int, int, int64_t *, MMG3D_pPROctree, int8_t)
static const uint8_t MMG5_iare[6][2]
vertices of extremities of the edges of the tetra
int MMG3D_split1_sim(MMG5_pMesh mesh, MMG5_pSol met, MMG5_int k, MMG5_int vx[6])
int MMG5_split2(MMG5_pMesh mesh, MMG5_pSol met, MMG5_int k, MMG5_int vx[6], int8_t)
static const uint8_t MMG5_ifar[6][2]
ifar[i][]: faces sharing the ith edge of the tetra
int MMG5_BezierRef(MMG5_pMesh mesh, MMG5_int ip0, MMG5_int ip1, double s, double *o, double *no, double *to)
int MMG3D_split4sf_sim(MMG5_pMesh mesh, MMG5_pSol met, MMG5_int k, MMG5_int vx[6])
int MMG5_split2sf(MMG5_pMesh mesh, MMG5_pSol met, MMG5_int k, MMG5_int vx[6], int8_t)
#define MMG3D_POINT_REALLOC(mesh, sol, ip, wantedGap, law, o, tag, src)
int MMG5_split3cone(MMG5_pMesh mesh, MMG5_pSol met, MMG5_int k, MMG5_int vx[6], int8_t)
int MMG5_movbdynomintpt_iso(MMG5_pMesh, MMG5_pSol, MMG3D_pPROctree, int64_t *, int, int)
int MMG3D_split5_sim(MMG5_pMesh mesh, MMG5_pSol met, MMG5_int k, MMG5_int vx[6])
#define MMG3D_LSWAPIMPROVE
int MMG5_norface(MMG5_pMesh mesh, MMG5_int k, int iface, double v[3])
int MMG5_split3(MMG5_pMesh mesh, MMG5_pSol met, MMG5_int k, MMG5_int vx[6], int8_t)
int MMG5_directsurfball(MMG5_pMesh mesh, MMG5_int ip, MMG5_int *list, int ilist, double n[3])
int MMG5_BezierNom(MMG5_pMesh mesh, MMG5_int ip0, MMG5_int ip1, double s, double *o, double *no, double *to)
int MMG3D_split3op_sim(MMG5_pMesh mesh, MMG5_pSol met, MMG5_int k, MMG5_int vx[6])
static const uint8_t MMG5_idir[4][3]
idir[i]: vertices of face opposite to vertex i
int MMG3D_split2_sim(MMG5_pMesh mesh, MMG5_pSol met, MMG5_int k, MMG5_int vx[6])
static int MMG3D_delPatternPts(MMG5_pMesh mesh, MMG5_Hash hash)
int MMG3D_normalAndTangent_at_sinRidge(MMG5_pMesh mesh, MMG5_int k, int i, int j, double no1[3], double no2[3], double to[3])
static MMG5_int MMG5_anatet4(MMG5_pMesh mesh, MMG5_pSol met, MMG5_int *nf, int8_t typchk)
MMG5_int MMG5_movtet(MMG5_pMesh mesh, MMG5_pSol met, MMG3D_pPROctree PROctree, double clickSurf, double clickVol, int moveVol, int improveSurf, int improveVolSurf, int improveVol, int maxit, MMG5_int testmark)
static int MMG3D_anatet4_sim(MMG5_pMesh mesh, MMG5_pSol met, MMG5_int k, int8_t metRidTyp, int *ifac, int *conf0, MMG5_int *adj, int *conf1)
int MMG3D_dichoto1b(MMG5_pMesh mesh, MMG5_pSol met, int64_t *list, int ret, MMG5_int ip)
MMG5_int MMG5_swpmsh(MMG5_pMesh mesh, MMG5_pSol met, MMG3D_pPROctree PROctree, int typchk)
static int MMG3D_update_rid_geom(MMG5_pPoint ppt, MMG5_pxPoint pxp, double no[3])
int MMG5_anatet(MMG5_pMesh mesh, MMG5_pSol met, int8_t typchk, int patternMode)
static MMG5_int MMG5_anatet4rid(MMG5_pMesh mesh, MMG5_pSol met, MMG5_int *nf, int8_t typchk)
static MMG5_int MMG3D_anatets_ani(MMG5_pMesh mesh, MMG5_pSol met, int8_t typchk)
int8_t MMG5_chkedg(MMG5_pMesh mesh, MMG5_Tria *pt, int8_t ori, double hmax, double hausd, int locPar)
static MMG5_int(* MMG3D_anatets)(MMG5_pMesh mesh, MMG5_pSol met, int8_t typchk)
static int MMG3D_chkbdyface(MMG5_pMesh mesh, MMG5_pSol met, MMG5_int k, MMG5_pTetra pt, MMG5_pxTetra pxt, int8_t i, MMG5_pTria ptt, int8_t typchk)
int MMG3D_splsurfedge(MMG5_pMesh mesh, MMG5_pSol met, MMG5_int k, MMG5_pTetra pt, MMG5_pxTetra pxt, int8_t imax, int8_t typchk, int8_t chkRidTet, int *warn)
int MMG3D_dichoto(MMG5_pMesh mesh, MMG5_pSol met, MMG5_int k, MMG5_int *vx)
static MMG5_int MMG3D_anatets_iso(MMG5_pMesh mesh, MMG5_pSol met, int8_t typchk)
void MMG3D_set_geom(MMG5_pMesh mesh, MMG5_pPoint ppt, uint16_t tag, MMG5_int nmref, MMG5_int edgref, double no1[3], double no2[3], double to[3])
int MMG3D_adpcoledg(MMG5_pMesh mesh, MMG5_pSol met, MMG3D_pPROctree *PROctree, MMG5_int k, int8_t imin, double lmin, MMG5_int *nc)
void MMG5_tet2tri(MMG5_pMesh mesh, MMG5_int k, int8_t ie, MMG5_Tria *ptt)
static MMG5_int MMG5_anatetv(MMG5_pMesh mesh, MMG5_pSol met, int8_t typchk)
MMG5_int MMG5_swptet(MMG5_pMesh mesh, MMG5_pSol met, double crit, double declic, MMG3D_pPROctree PROctree, int typchk, MMG5_int testmark)
int8_t MMG3D_build_bezierEdge(MMG5_pMesh mesh, MMG5_int k, int8_t imax, int8_t i, int8_t j, MMG5_pxTetra pxt, MMG5_int ip1, MMG5_int ip2, MMG5_pPoint p0, MMG5_pPoint p1, MMG5_int *ref, uint16_t *tag, double o[3], double to[3], double no1[3], double no2[3], int64_t *list, int *ilist)
static MMG5_int MMG5_coltet(MMG5_pMesh mesh, MMG5_pSol met, int8_t typchk)
void MMG3D_find_bdyface_from_edge(MMG5_pMesh mesh, MMG5_pTetra pt, int8_t ied, int8_t *i, int8_t *j, int8_t *i1, int8_t *i2, MMG5_int *ip1, MMG5_int *ip2, MMG5_pPoint *p0, MMG5_pPoint *p1)
#define MMG5_INCREASE_MEM_MESSAGE()
static const uint8_t MMG5_iprv2[3]
#define MG_EDG_OR_NOM(tag)
#define MG_GET(flag, bit)
static const uint8_t MMG5_inxt2[6]
int MMG5_nortri(MMG5_pMesh mesh, MMG5_pTria pt, double *n)
#define MMG5_DEL_MEM(mesh, ptr)
#define MG_SET(flag, bit)
Identic as MMG5_HGeom but use MMG5_hedge to store edges instead of MMG5_hgeom (memory economy).
Local parameters for a specific entity and reference.
Structure to store vertices of an MMG mesh.
Structure to store tetrahedra of an MMG mesh.
Structure to store triangles of a MMG mesh.
Structure to store surface vertices of an MMG mesh.
Structure to store additional information for the surface tetrahedra of an MMG mesh.