56 tau[0] = 0 ; tau[1] = 1 ; tau[2] = 2 ; tau[3] = 3;
60 tau[0] = 2 ; tau[1] = 0 ; tau[2] = 1 ; tau[3] = 3;
64 tau[0] = 0 ; tau[1] = 3 ; tau[2] = 1 ; tau[3] = 2;
68 tau[0] = 1 ; tau[1] = 2 ; tau[2] = 0 ; tau[3] = 3;
72 tau[0] = 3 ; tau[1] = 1 ; tau[2] = 0 ; tau[3] = 2;
76 tau[0] = 3 ; tau[1] = 2 ; tau[2] = 1 ; tau[3] = 0;
112 pt0->
v[tau[1]] = vx[taued[0]];
117 pt0->
v[tau[0]] = vx[taued[0]];
142 const uint8_t *taued;
149 fprintf(stderr,
"\n ## Error: %s: unable to allocate"
150 " a new element.\n",__func__);
152 fprintf(stderr,
" Exit program.\n");
173 for (i=0; i<4; i++) {
174 ftag[i] = (xt.
ftag[i] & ~MG_REF);
178 pt->
v[tau[1]] = pt1->
v[tau[0]] = vx[taued[0]];
182 xt.
tag [taued[3]] = ftag[tau[3]]; xt.
tag [taued[4]] = ftag[tau[2]];
183 xt1.
tag[taued[1]] = ftag[tau[3]]; xt1.
tag[taued[2]] = ftag[tau[2]];
184 xt.
edg [taued[3]] = 0; xt.
edg [taued[4]] = 0;
185 xt1.
edg[taued[1]] = 0; xt1.
edg[taued[2]] = 0;
193 for (i=0; i<4; i++) {
194 if ( xt.
ref[i] || xt.
ftag[i] ) isxt = 1;
195 if ( xt1.
ref[i] || xt1.
ftag[i] ) isxt1 = 1;
196 if ( isxt && isxt1 )
goto nextstep1;
201 if ( isxt && !isxt1 ) {
205 else if ( !isxt && isxt1 ) {
211 else if ( isxt && isxt1 ) {
216 "larger xtetra table",
218 fprintf(stderr,
" Exit program.\n");
236 if ( (!metRidTyp) && met->
m && met->
size>1 ) {
240 else if ( (!met) || (!met->
m) ) {
273 MMG5_int idx , MMG5_int ip ,
double n0[3])
281 assert(iface >=0 && iface < 4 &&
"local face idx");
307 if (
ier<0 )
return -1;
308 else if ( !
ier )
return 0;
334 double calold,calnew,caltmp;
336 int j,k,ilist,idx,iface,
ier;
337 MMG5_int iel,sum1,sum2,mins1,mins2,maxs1,maxs2;
338 MMG5_int is0,is1,is2;
339 int8_t ie,ia,ib,complete,wrongOri;
344 memcpy(ppt0->
c ,&
mesh->
point[ip].
c , 3*
sizeof(
double));
347 memcpy(&met->
m[0],&met->
m[met->
size*ip], met->
size*
sizeof(
double));
349 calold = calnew = DBL_MAX;
350 for (k=0; k<ilist; k++) {
362 calnew =
MG_MIN(calnew,caltmp);
368 calnew =
MG_MIN(calnew,caltmp);
378 wrongOri = complete = idx = 0;
379 maxs1 = mins1 = sum1 = 0;
380 for (k=0; k<ilist; k++) {
385 if(!pt->
xt)
continue;
389 for ( j=0; j<2; ++j ) {
399 if (
ier < 0 )
return -1;
400 else if (
ier == 0 )
return 2;
403 if (
ier < 0 )
return -1;
404 else if (
ier == 0 )
return 2;
412 sum1 = is0 + is1 + is2;
425 sum2 = is0 + is1 + is2;
429 if ( (sum2 == sum1 && mins2 == mins1 && maxs2 == maxs1) ) {
436 else if ( wrongOri ) {
487 if ( it1/4 != start || it1%4 != iface ) {
489 if ( it2/4!=start || it2%4!=iface )
return 0;
496 assert ( it/4>0 && 0<=it%4 && it%4<4 &&
"unexpected idx for tetra or local face idx" );
526 int8_t ie,isxt,isxt1,i;
527 const uint8_t *taued;
532 jel = MMG5_abs(newtet[k]);
551 for (i=0; i<4; i++) {
552 ftag[i] = (xt.
ftag[i] & ~MG_REF);
556 pt->
v[tau[1]] = pt1->
v[tau[0]] = ip;
559 xt.
tag [taued[3]] = ftag[tau[3]]; xt.
tag [taued[4]] = ftag[tau[2]];
560 xt1.
tag[taued[1]] = ftag[tau[3]]; xt1.
tag[taued[2]] = ftag[tau[2]];
561 xt.
edg [taued[3]] = 0; xt.
edg [taued[4]] = 0;
562 xt1.
edg[taued[1]] = 0; xt1.
edg[taued[2]] = 0;
572 for (i=0; i<4; i++) {
573 if ( xt.
ref[i] || xt.
ftag[i] ) isxt = 1;
574 if ( xt1.
ref[i] || xt1.
ftag[i] ) isxt1 = 1;
578 if ( (isxt)&&(!isxt1) ) {
583 else if ((!isxt)&&(isxt1) ) {
589 else if (isxt && isxt1 ) {
594 "larger xtetra table",
630 int cas,int8_t metRidTyp,int8_t chkRidTet){
632 double lmin,lmax,len;
634 MMG5_int iel,jel,newtet[
MMG3D_LMAX+2],nump,*adja;
635 MMG5_int *adjan,nei2,nei3,mel;
638 const uint8_t *taued;
644 if ( cas && met->
m ) {
647 for (j=0; j<ilist; j++) {
648 for (i=0; i<6; i++) {
650 if ( (!metRidTyp) && met->
m && met->
size>1 )
659 len = MMG5_lenedg(
mesh,met,i,pt);
663 else if ( len > lmax) {
675 for (j=0; j<ilist; j++) {
692 if ( (!metRidTyp) && met->
m && met->
size>1 )
702 len = MMG5_lenedgspl(
mesh,met,taued[5],pt0);
704 if ( len < lmin )
break;
714 if ( (!metRidTyp) && met->
m && met->
size>1 )
724 len = MMG5_lenedgspl(
mesh,met,taued[5],pt0);
725 if ( len < lmin )
break;
727 if ( j < ilist )
return 0;
738 for (k=0; k<ilist; k++) {
750 fprintf(stderr,
"\n ## Error: %s: unable to allocate"
751 " a new element.\n",__func__);
754 for ( ; k>=0 ; --k ) {
763 if ( pt->
v[tau[0]] == nump )
780 jel = MMG5_abs(newtet[0]);
791 mel = adja[tau[0]] / 4;
792 voy = adja[tau[0]] % 4;
793 adja[tau[0]] = 4*jel + tau[1];
794 adjan[tau[0]] = 4*mel + voy;
795 adjan[tau[1]] = 4*iel + tau[0];
799 adjan[voy] = 4*jel + tau[0];
802 if ( (!metRidTyp) && met->
m && met->
size>1 ) {
817 for (k=0; k<ilist; k++) {
825 jel = MMG5_abs(newtet[k]);
836 if ( (list[1] / 6) == (nei2 / 4) ) {
837 if (
MG_SMSGN(newtet[0],newtet[1]) ) {
839 adjan[tau[2]] = 4*MMG5_abs(newtet[1])+(nei2 %4);
842 adja[tau[2]] = 4*MMG5_abs(newtet[1])+(nei2 %4);
843 adjan[tau[2]] = nei2;
852 assert((list[ilist-1] / 6) == (nei3 / 4));
853 if (
MG_SMSGN(newtet[0],newtet[ilist-1]) ) {
855 adjan[tau[3]] = 4*MMG5_abs(newtet[ilist-1])+(nei3 %4);
858 adja[tau[3]] = 4*MMG5_abs(newtet[ilist-1])+(nei3 %4);
859 adjan[tau[3]] = nei3;
865 assert((list[1] / 6) == (nei3 / 4));
866 if (
MG_SMSGN(newtet[0],newtet[1]) ) {
868 adjan[tau[3]] = 4*MMG5_abs(newtet[1])+(nei3 %4);
871 adja[tau[3]] = 4*MMG5_abs(newtet[1])+(nei3 %4);
872 adjan[tau[3]] = nei3;
881 assert((list[ilist-1]) / 6 == (nei2 / 4));
882 if (
MG_SMSGN(newtet[0],newtet[ilist-1]) ) {
884 adjan[tau[2]] = 4*MMG5_abs(newtet[ilist-1])+(nei2 %4);
887 adja[tau[2]] = 4*MMG5_abs(newtet[ilist-1])+(nei2 %4);
888 adjan[tau[2]] = nei2;
894 else if ( k==ilist-1 ) {
895 if ( (list[ilist-2] / 6) == (nei2 / 4) ) {
896 if (
MG_SMSGN(newtet[ilist-1],newtet[ilist-2]) ) {
898 adjan[tau[2]] = 4*MMG5_abs(newtet[ilist-2])+(nei2 %4);
901 adja[tau[2]] = 4*MMG5_abs(newtet[ilist-2])+(nei2 %4);
902 adjan[tau[2]] = nei2;
911 assert((list[0]) / 6 == (nei3 / 4));
912 if (
MG_SMSGN(newtet[ilist-1],newtet[0]) ) {
914 adjan[tau[3]] = 4*MMG5_abs(newtet[0])+(nei3 %4);
917 adja[tau[3]] = 4*MMG5_abs(newtet[0])+(nei3 %4);
918 adjan[tau[3]] = nei3;
924 assert((list[ilist-2] / 6) == (nei3 / 4));
925 if (
MG_SMSGN(newtet[ilist-1],newtet[ilist-2]) ) {
927 adjan[tau[3]] = 4*MMG5_abs(newtet[ilist-2])+(nei3 %4);
930 adja[tau[3]] = 4*MMG5_abs(newtet[ilist-2])+(nei3 %4);
931 adjan[tau[3]] = nei3;
940 assert((list[0]) / 6 == (nei2 / 4));
941 if (
MG_SMSGN(newtet[ilist-1],newtet[0]) ) {
943 adjan[tau[2]] = 4*MMG5_abs(newtet[0])+(nei2 %4);
946 adja[tau[2]] = 4*MMG5_abs(newtet[0])+(nei2 %4);
947 adjan[tau[2]] = nei2;
954 if ( (list[k-1] / 6) == (nei2 / 4) ) {
955 if (
MG_SMSGN(newtet[k],newtet[k-1]) ) {
957 adjan[tau[2]] = 4*MMG5_abs(newtet[k-1])+(nei2 %4);
960 adja[tau[2]] = 4*MMG5_abs(newtet[k-1])+(nei2 %4);
961 adjan[tau[2]] = nei2;
964 assert((list[k+1]) / 6 == (nei3 / 4));
965 if (
MG_SMSGN(newtet[k],newtet[k+1]) ) {
967 adjan[tau[3]] = 4*MMG5_abs(newtet[k+1])+(nei3 %4);
970 adja[tau[3]] = 4*MMG5_abs(newtet[k+1])+(nei3 %4);
971 adjan[tau[3]] = nei3;
976 assert((list[k-1] / 6) == (nei3 / 4));
977 if (
MG_SMSGN(newtet[k],newtet[k-1]) ) {
979 adjan[tau[3]] = 4*MMG5_abs(newtet[k-1])+(nei3 %4);
982 adja[tau[3]] = 4*MMG5_abs(newtet[k-1])+(nei3 %4);
983 adjan[tau[3]] = nei3;
986 assert((list[k+1]) / 6 == (nei2 / 4));
987 if (
MG_SMSGN(newtet[k],newtet[k+1]) ) {
989 adjan[tau[2]] = 4*MMG5_abs(newtet[k+1])+(nei2 %4);
992 adja[tau[2]] = 4*MMG5_abs(newtet[k+1])+(nei2 %4);
993 adjan[tau[2]] = nei2;
999 mel = adja[tau[0]] / 4;
1000 voy = adja[tau[0]] % 4;
1001 adja[tau[0]] = 4*jel + tau[1];
1002 adjan[tau[0]] = 4*mel + voy;
1003 adjan[tau[1]] = 4*iel + tau[0];
1006 adjan = &
mesh->
adja[4*(mel -1) +1];
1007 adjan[voy] = 4*jel + tau[0];
1010 if ( (!metRidTyp) && met->
m && met->
size>1 ) {
1040 tau[0] = 0 ; tau[1] = 1 ; tau[2] = 2 ; tau[3] = 3;
1044 tau[0] = 0 ; tau[1] = 2 ; tau[2] = 3 ; tau[3] = 1;
1048 tau[0] = 0 ; tau[1] = 3 ; tau[2] = 1 ; tau[3] = 2;
1052 tau[0] = 1 ; tau[1] = 3 ; tau[2] = 2 ; tau[3] = 0;
1056 tau[0] = 1 ; tau[1] = 0 ; tau[2] = 3 ; tau[3] = 2;
1060 tau[0] = 1 ; tau[1] = 2 ; tau[2] = 0 ; tau[3] = 3;
1064 tau[0] = 2 ; tau[1] = 0 ; tau[2] = 1 ; tau[3] = 3;
1068 tau[0] = 2 ; tau[1] = 1 ; tau[2] = 3 ; tau[3] = 0;
1072 tau[0] = 2 ; tau[1] = 3 ; tau[2] = 0 ; tau[3] = 1;
1076 tau[0] = 3 ; tau[1] = 0 ; tau[2] = 2 ; tau[3] = 1;
1080 tau[0] = 3 ; tau[1] = 2 ; tau[2] = 1 ; tau[3] = 0;
1084 tau[0] = 3 ; tau[1] = 1 ; tau[2] = 0 ; tau[3] = 2;
1089 (*imin) = (v[tau[1]] < v[tau[2]]) ? tau[1] : tau[2] ;
1106 uint8_t tau[4],imin;
1107 const uint8_t *taued;
1120 pt0->
v[tau[1]] = vx[taued[4]];
1121 pt0->
v[tau[2]] = vx[taued[5]];
1125 if ( imin == tau[1] ) {
1127 pt0->
v[tau[2]] = vx[taued[5]];
1128 pt0->
v[tau[3]] = vx[taued[4]];
1133 pt0->
v[tau[3]] = vx[taued[5]];
1139 pt0->
v[tau[3]] = vx[taued[4]];
1144 pt0->
v[tau[1]] = vx[taued[4]];
1145 pt0->
v[tau[3]] = vx[taued[5]];
1172 for ( i=1; i<ne; ++i ) {
1176 fprintf(stderr,
"\n ## Error: %s: unable to allocate"
1177 " a new element.\n",__func__);
1179 fprintf(stderr,
" Exit program.\n");
1182 for ( j=0; j<i; ++j ) {
1194 for ( i=0; i<ne; ++i ) {
1220 MMG5_int *newtet,
MMG5_pTetra *pt,int8_t metRidTyp) {
1223 if ( (!metRidTyp) && met->
m && met->
size>1 ) {
1224 for (i=0; i<ne; i++) {
1228 else if ( (!met) || (!met->
m) ) {
1230 for (i=0; i<ne; i++) {
1236 for (i=0; i<ne; i++) {
1282 int8_t firstxt,isxt[3];
1284 uint8_t tau[4],imin;
1285 const uint8_t *taued;
1306 for (i=0; i<4; i++) {
1307 ftag[i] = (xt[0].
ftag[i] & ~MG_REF);
1311 pt[0]->
v[tau[1]] = vx[taued[4]] ; pt[0]->
v[tau[2]] = vx[taued[5]];
1312 xt[0].
tag[taued[0]] = ftag[tau[2]]; xt[0].
tag[taued[1]] = ftag[tau[1]];
1313 xt[0].
tag[taued[3]] = ftag[tau[0]]; xt[0].
edg[taued[0]] = 0;
1314 xt[0].
edg[taued[1]] = 0; xt[0].
edg[taued[3]] = 0;
1315 xt[0].
ref[ tau[3]] = 0; xt[0].
ftag[ tau[3]] = 0;
MG_SET(xt[0].ori, tau[3]);
1317 if ( imin == tau[1] ) {
1318 pt[1]->
v[tau[2]] = vx[taued[5]]; pt[1]->
v[tau[3]] = vx[taued[4]];
1319 pt[2]->
v[tau[3]] = vx[taued[5]];
1321 xt[1].
tag[taued[1]] = ftag[tau[1]]; xt[1].
tag[taued[2]] = ftag[tau[2]];
1322 xt[1].
tag[taued[3]] = ftag[tau[0]]; xt[1].
tag[taued[5]] = ftag[tau[0]];
1323 xt[1].
edg[taued[1]] = 0; xt[1].
edg[taued[2]] = 0;
1324 xt[1].
edg[taued[3]] = 0; xt[1].
edg[taued[5]] = 0;
1325 xt[1].
ref [ tau[1]] = 0; xt[1].
ref [ tau[3]] = 0;
1326 xt[1].
ftag[ tau[1]] = 0; xt[1].
ftag[ tau[3]] = 0;
1329 xt[2].
tag[taued[2]] = ftag[tau[1]]; xt[2].
tag[taued[4]] = ftag[tau[0]];
1330 xt[2].
edg[taued[2]] = 0 ; xt[2].
edg[taued[4]] = 0;
1331 xt[2].
ref[ tau[2]] = 0; xt[2].
ftag[ tau[2]] = 0;
MG_SET(xt[2].ori, tau[2]);
1334 pt[1]->
v[tau[3]] = vx[taued[4]];
1335 pt[2]->
v[tau[1]] = vx[taued[4]]; pt[2]->
v[tau[3]] = vx[taued[5]];
1337 xt[1].
tag[taued[2]] = ftag[tau[2]]; xt[1].
tag[taued[5]] = ftag[tau[0]];
1338 xt[1].
edg[taued[2]] = 0 ; xt[1].
edg[taued[5]] = 0;
1339 xt[1].
ref[ tau[1]] = 0; xt[1].
ftag[ tau[1]] = 0;
MG_SET(xt[1].ori, tau[1]);
1341 xt[2].
tag[taued[0]] = ftag[tau[2]]; xt[2].
tag[taued[2]] = ftag[tau[1]];
1342 xt[2].
tag[taued[3]] = ftag[tau[0]]; xt[2].
tag[taued[4]] = ftag[tau[0]];
1343 xt[2].
edg[taued[0]] = 0; xt[2].
edg[taued[2]] = 0;
1344 xt[2].
edg[taued[3]] = 0; xt[2].
edg[taued[4]] = 0;
1345 xt[2].
ref [ tau[2]] = 0; xt[2].
ref [ tau[3]] = 0;
1346 xt[2].
ftag[ tau[2]] = 0; xt[2].
ftag[ tau[3]] = 0;
1351 isxt[0] = isxt[1] = isxt[2] = 0;
1352 for (i=0; i<4; i++) {
1353 if ( xt[0].ref[i] || xt[0].ftag[i] ) isxt[0] = 1;
1354 if ( xt[1].ref[i] || xt[1].ftag[i] ) isxt[1] = 1;
1355 if ( xt[2].ref[i] || xt[2].ftag[i] ) isxt[2] = 1;
1361 pt[1]->
xt = pt[2]->
xt = 0;
1362 for (i=1; i<3; i++) {
1368 "larger xtetra table",
1370 fprintf(stderr,
" Exit program.\n");
1381 pt[1]->
xt = pt[2]->
xt = 0;
1382 for (i=1; i<3; i++) {
1386 pt[i]->
xt = pt[0]->
xt;
1395 "larger xtetra table",
1397 fprintf(stderr,
" Exit program.\n");
1431 const uint8_t *taued;
1440 tau[0] = 0 ; tau[1] = 1 ; tau[2] = 2 ; tau[3] = 3;
1444 tau[0] = 3; tau[1] = 1; tau[2] = 0; tau[3] = 2;
1448 tau[0] = 0; tau[1] = 3; tau[2] = 1; tau[3] = 2;
1455 pt0->
v[tau[1]] = vx[taued[0]]; pt0->
v[tau[2]] = vx[taued[5]];
1460 pt0->
v[tau[1]] = vx[taued[0]]; pt0->
v[tau[3]] = vx[taued[5]];
1465 pt0->
v[tau[0]] = vx[taued[0]]; pt0->
v[tau[2]] = vx[taued[5]];
1470 pt0->
v[tau[0]] = vx[taued[0]]; pt0->
v[tau[3]] = vx[taued[5]];
1495 int8_t flg,firstxt,isxt[4];
1498 const uint8_t *taued;
1512 tau[0] = 0; tau[1] = 1; tau[2] = 2; tau[3] = 3;
1516 tau[0] = 3; tau[1] = 1; tau[2] = 0; tau[3] = 2;
1520 tau[0] = 0; tau[1] = 3; tau[2] = 1; tau[3] = 2;
1526 for (i=0; i<4; i++) {
1527 ftag[i] = (xt[0].
ftag[i] & ~MG_REF);
1531 pt[0]->
v[tau[1]] = vx[taued[0]]; pt[0]->
v[tau[2]] = vx[taued[5]];
1532 pt[1]->
v[tau[1]] = vx[taued[0]]; pt[1]->
v[tau[3]] = vx[taued[5]];
1533 pt[2]->
v[tau[0]] = vx[taued[0]]; pt[2]->
v[tau[2]] = vx[taued[5]];
1534 pt[3]->
v[tau[0]] = vx[taued[0]]; pt[3]->
v[tau[3]] = vx[taued[5]];
1536 xt[0].
tag[taued[1]] = ftag[tau[1]]; xt[0].
tag[taued[3]] = 0;
1537 xt[0].
tag[taued[4]] = ftag[tau[2]]; xt[0].
edg[taued[1]] = 0;
1538 xt[0].
edg[taued[3]] = 0; xt[0].
edg[taued[4]] = 0;
1539 xt[0].
ref [ tau[0]] = 0; xt[0].
ref [ tau[3]] = 0;
1540 xt[0].
ftag[ tau[0]] = 0; xt[0].
ftag[ tau[3]] = 0;
1543 xt[1].
tag[taued[2]] = ftag[tau[1]]; xt[1].
tag[taued[3]] = ftag[tau[3]];
1544 xt[1].
tag[taued[4]] = 0; xt[1].
edg[taued[2]] = 0;
1545 xt[1].
edg[taued[3]] = 0; xt[1].
edg[taued[4]] = 0;
1546 xt[1].
ref [ tau[0]] = 0; xt[1].
ref [ tau[2]] = 0;
1547 xt[1].
ftag[ tau[0]] = 0; xt[1].
ftag[ tau[2]] = 0;
1550 xt[2].
tag[taued[1]] = 0; xt[2].
tag[taued[2]] = ftag[tau[2]];
1551 xt[2].
tag[taued[3]] = ftag[tau[0]]; xt[2].
edg[taued[1]] = 0;
1552 xt[2].
edg[taued[2]] = 0; xt[2].
edg[taued[3]] = 0;
1553 xt[2].
ref [ tau[1]] = 0; xt[2].
ref [ tau[3]] = 0;
1554 xt[2].
ftag[ tau[1]] = 0; xt[2].
ftag[ tau[3]] = 0;
1557 xt[3].
tag[taued[1]] = ftag[tau[3]]; xt[3].
tag[taued[2]] = 0;
1558 xt[3].
tag[taued[4]] = ftag[tau[0]]; xt[3].
edg[taued[1]] = 0;
1559 xt[3].
edg[taued[2]] = 0; xt[3].
edg[taued[4]] = 0;
1560 xt[3].
ref [ tau[1]] = 0; xt[3].
ref [ tau[2]] = 0;
1561 xt[3].
ftag[ tau[1]] = 0; xt[3].
ftag[ tau[2]] = 0;
1565 memset(isxt,0,4*
sizeof(int8_t));
1566 for (i=0; i<4; i++) {
1568 for (j=0; j<ne; j++) {
1569 if ( xt[j].ref[i] || xt[j].ftag[i] ) isxt[j] = 1;
1576 for (i=1; i<4; i++) {
1582 "larger xtetra table",
1584 fprintf(stderr,
" Exit program.\n");
1598 for (i=1; i<4; i++) {
1602 pt[i]->
xt = pt[0]->
xt;
1611 "larger xtetra table",
1613 fprintf(stderr,
" Exit program.\n");
1640 const uint8_t *taued;
1649 tau[0] = 0 ; tau[1] = 1 ; tau[2] = 2 ; tau[3] = 3;
1653 tau[0] = 0 ; tau[1] = 3 ; tau[2] = 1 ; tau[3] = 2;
1657 tau[0] = 3 ; tau[1] = 0 ; tau[2] = 2 ; tau[3] = 1;
1661 tau[0] = 1 ; tau[1] = 3 ; tau[2] = 2 ; tau[3] = 0;
1668 pt0->
v[tau[1]] = vx[taued[0]];
1669 pt0->
v[tau[2]] = vx[taued[1]];
1674 pt0->
v[tau[0]] = vx[taued[0]];
1675 pt0->
v[tau[2]] = vx[taued[3]];
1680 pt0->
v[tau[0]] = vx[taued[1]];
1681 pt0->
v[tau[1]] = vx[taued[3]];
1686 pt0->
v[tau[0]] = vx[taued[0]];
1687 pt0->
v[tau[1]] = vx[taued[3]];
1688 pt0->
v[tau[2]] = vx[taued[1]];
1713 int8_t flg,firstxt,isxt[4];
1716 const uint8_t *taued;
1730 for (i=0; i<4; i++) {
1731 ftag[i] = (xt[0].
ftag[i] & ~MG_REF);
1735 tau[0] = 0; tau[1] = 1; tau[2] = 2; tau[3] = 3;
1739 tau[0] = 0 ; tau[1] = 3 ; tau[2] = 1 ; tau[3] = 2;
1743 tau[0] = 3 ; tau[1] = 0 ; tau[2] = 2 ; tau[3] = 1;
1747 tau[0] = 1 ; tau[1] = 3 ; tau[2] = 2 ; tau[3] = 0;
1753 pt[0]->
v[tau[1]] = vx[taued[0]]; pt[0]->
v[tau[2]] = vx[taued[1]];
1754 pt[1]->
v[tau[0]] = vx[taued[0]]; pt[1]->
v[tau[2]] = vx[taued[3]];
1755 pt[2]->
v[tau[0]] = vx[taued[1]]; pt[2]->
v[tau[1]] = vx[taued[3]];
1756 pt[3]->
v[tau[0]] = vx[taued[0]]; pt[3]->
v[tau[1]] = vx[taued[3]]; pt[3]->
v[tau[2]] = vx[taued[1]];
1758 xt[0].
tag[taued[3]] = ftag[tau[3]]; xt[0].
tag[taued[4]] = ftag[tau[2]];
1759 xt[0].
tag[taued[5]] = ftag[tau[1]]; xt[0].
edg[taued[3]] = 0;
1760 xt[0].
edg[taued[4]] = 0; xt[0].
edg[taued[5]] = 0;
1761 xt[0].
ref[ tau[0]] = 0; xt[0].
ftag[ tau[0]] = 0;
MG_SET(xt[0].ori, tau[0]);
1763 xt[1].
tag[taued[1]] = ftag[tau[3]]; xt[1].
tag[taued[2]] = ftag[tau[2]];
1764 xt[1].
tag[taued[5]] = ftag[tau[0]]; xt[1].
edg[taued[1]] = 0;
1765 xt[1].
edg[taued[2]] = 0; xt[1].
edg[taued[5]] = 0;
1766 xt[1].
ref[ tau[1]] = 0; xt[1].
ftag[ tau[1]] = 0;
MG_SET(xt[1].ori, tau[1]);
1768 xt[2].
tag[taued[0]] = ftag[tau[3]]; xt[2].
tag[taued[2]] = ftag[tau[1]];
1769 xt[2].
tag[taued[4]] = ftag[tau[0]]; xt[2].
edg[taued[0]] = 0;
1770 xt[2].
edg[taued[2]] = 0; xt[2].
edg[taued[4]] = 0;
1771 xt[2].
ref[ tau[2]] = 0; xt[2].
ftag[ tau[2]] = 0;
MG_SET(xt[2].ori, tau[2]);
1773 xt[3].
tag[taued[0]] = ftag[tau[3]]; xt[3].
tag[taued[1]] = ftag[tau[3]];
1774 xt[3].
tag[taued[2]] = ftag[tau[2]]; xt[3].
tag[taued[3]] = ftag[tau[3]];
1775 xt[3].
tag[taued[4]] = ftag[tau[0]]; xt[3].
tag[taued[5]] = ftag[tau[1]];
1776 xt[3].
edg[taued[0]] = 0; xt[3].
edg[taued[1]] = 0;
1777 xt[3].
edg[taued[2]] = 0; xt[3].
edg[taued[3]] = 0;
1778 xt[3].
edg[taued[4]] = 0; xt[3].
edg[taued[5]] = 0;
1779 xt[3].
ref [ tau[0]] = 0; xt[3].
ref [ tau[1]] = 0; xt[3].
ref [tau[2]] = 0;
1780 xt[3].
ftag[ tau[0]] = 0; xt[3].
ftag[ tau[1]] = 0; xt[3].
ftag[tau[2]] = 0;
1784 memset(isxt,0,4*
sizeof(int8_t));
1785 for (i=0; i<4; i++) {
1787 for (j=0; j<ne; j++) {
1788 if ( xt[j].ref[i] || xt[j].ftag[i] ) isxt[j] = 1;
1795 pt[1]->
xt = pt[2]->
xt = pt[3]->
xt = 0;
1796 for (i=1; i<4; i++) {
1802 "larger xtetra table",
1804 fprintf(stderr,
" Exit program.\n");
1815 pt[1]->
xt = pt[2]->
xt = pt[3]->
xt = 0;
1816 for (i=1; i<4; i++) {
1820 pt[i]->
xt = pt[0]->
xt;
1829 "larger xtetra table",
1831 fprintf(stderr,
" Exit program.\n");
1864 const uint8_t **taued,uint8_t *ia,uint8_t *ib) {
1868 tau[0] = 0 ; tau[1] = 1 ; tau[2] = 2 ; tau[3] = 3;
1873 tau[0] = 1 ; tau[1] = 2 ; tau[2] = 0 ; tau[3] = 3;
1878 tau[0] = 2 ; tau[1] = 0 ; tau[2] = 1 ; tau[3] = 3;
1883 tau[0] = 3 ; tau[1] = 1 ; tau[2] = 0 ; tau[3] = 2;
1890 if ( v[tau[1]] < v[tau[2]] ) {
1899 if ( v[tau[3]] < v[(*ia)] ) {
1904 if ( v[tau[3]] < v[(*ib)] ) {
1924 uint8_t tau[4],ia,ib;
1925 const uint8_t *taued;
1938 pt0->
v[tau[1]] = vx[taued[0]];
1939 pt0->
v[tau[2]] = vx[taued[1]];
1940 pt0->
v[tau[3]] = vx[taued[2]];
1945 if ( ia == tau[3] ) {
1946 pt0->
v[tau[0]] = vx[taued[2]];
1947 pt0->
v[tau[1]] = vx[taued[0]];
1948 pt0->
v[tau[2]] = vx[taued[1]];
1953 if ( ib == tau[1] ) {
1954 pt0->
v[tau[0]] = vx[taued[0]];
1955 pt0->
v[tau[2]] = vx[taued[1]];
1960 pt0->
v[tau[0]] = vx[taued[1]] ;
1965 assert(ib == tau[2]);
1966 pt0->
v[tau[0]] = vx[taued[1]];
1967 pt0->
v[tau[1]] = vx[taued[0]];
1972 pt0->
v[tau[0]] = vx[taued[0]] ;
1977 else if (ia == tau[2] ) {
1978 pt0->
v[tau[0]] = vx[taued[1]];
1979 pt0->
v[tau[1]] = vx[taued[0]];
1980 pt0->
v[tau[3]] = vx[taued[2]];
1985 if ( ib == tau[3] ) {
1986 pt0->
v[tau[0]] = vx[taued[2]];
1987 pt0->
v[tau[1]] = vx[taued[0]];
1992 pt0->
v[tau[0]] = vx[taued[0]];
1997 assert(ib == tau[1]);
1998 pt0->
v[tau[0]] = vx[taued[0]];
1999 pt0->
v[tau[3]] = vx[taued[2]];
2004 pt0->
v[tau[0]] = vx[taued[2]];
2010 assert(ia == tau[1]);
2012 pt0->
v[tau[0]] = vx[taued[0]];
2013 pt0->
v[tau[2]] = vx[taued[1]];
2014 pt0->
v[tau[3]] = vx[taued[2]];
2019 if ( ib == tau[2] ) {
2020 pt0->
v[tau[0]] = vx[taued[1]];
2021 pt0->
v[tau[3]] = vx[taued[2]] ;
2026 pt0->
v[tau[0]] = vx[taued[2]] ;
2032 assert(ib == tau[3]);
2034 pt0->
v[tau[0]] = vx[taued[2]];
2035 pt0->
v[tau[2]] = vx[taued[1]];
2040 pt0->
v[tau[0]] = vx[taued[1]];
2087 int8_t flg,firstxt,isxt[4];
2089 uint8_t tau[4],ia,ib;
2090 const uint8_t *taued;
2111 for (i=0; i<4; i++) {
2112 ftag[i] = (xt[0].
ftag[i] & ~MG_REF);
2116 pt[0]->
v[tau[1]] = vx[taued[0]] ; pt[0]->
v[tau[2]] = vx[taued[1]] ; pt[0]->
v[tau[3]] = vx[taued[2]];
2117 xt[0].
tag[taued[3]] = ftag[tau[3]]; xt[0].
tag[taued[4]] = ftag[tau[2]];
2118 xt[0].
tag[taued[5]] = ftag[tau[1]]; xt[0].
edg[taued[3]] = 0;
2119 xt[0].
edg[taued[4]] = 0; xt[0].
edg[taued[5]] = 0;
2120 xt[0].
ref [ tau[0]] = 0;
2121 xt[0].
ftag[ tau[0]] = 0;
2122 MG_SET(xt[0].ori, tau[0]);
2124 if ( ia == tau[3] ) {
2125 pt[1]->
v[tau[0]] = vx[taued[2]] ; pt[1]->
v[tau[1]] = vx[taued[0]] ; pt[1]->
v[tau[2]] = vx[taued[1]];
2126 xt[1].
tag[taued[0]] = ftag[tau[2]]; xt[1].
tag[taued[1]] = ftag[tau[1]];
2127 xt[1].
tag[taued[3]] = ftag[tau[3]]; xt[1].
tag[taued[4]] = ftag[tau[2]];
2128 xt[1].
tag[taued[5]] = ftag[tau[1]]; xt[1].
edg[taued[0]] = 0;
2129 xt[1].
edg[taued[1]] = 0; xt[1].
edg[taued[3]] = 0;
2130 xt[1].
edg[taued[4]] = 0; xt[1].
edg[taued[5]] = 0;
2131 xt[1].
ref [ tau[0]] = 0; xt[1].
ref [ tau[3]] = 0;
2132 xt[1].
ftag[ tau[0]] = 0; xt[1].
ftag[ tau[3]] = 0;
2135 if ( ib == tau[1] ) {
2136 pt[2]->
v[tau[0]] = vx[taued[0]] ; pt[2]->
v[tau[2]] = vx[taued[1]] ;
2137 xt[2].
tag[taued[1]] = ftag[tau[3]]; xt[2].
tag[taued[2]] = ftag[tau[2]];
2138 xt[2].
tag[taued[3]] = ftag[tau[3]]; xt[2].
tag[taued[5]] = ftag[tau[1]];
2139 xt[2].
edg[taued[1]] = 0; xt[2].
edg[taued[2]] = 0;
2140 xt[2].
edg[taued[3]] = 0; xt[2].
edg[taued[5]] = 0;
2141 xt[2].
ref [ tau[0]] = 0; xt[2].
ref [ tau[1]] = 0;
2142 xt[2].
ftag[ tau[0]] = 0; xt[2].
ftag[ tau[1]] = 0;
2145 pt[3]->
v[tau[0]] = vx[taued[1]] ;
2146 xt[3].
tag[taued[0]] = ftag[tau[3]]; xt[3].
tag[taued[2]] = ftag[tau[1]];
2147 xt[3].
edg[taued[0]] = 0; xt[3].
edg[taued[2]] = 0;
2148 xt[3].
ref [ tau[2]] = 0;
2149 xt[3].
ftag[ tau[2]] = 0;
2150 MG_SET(xt[3].ori, tau[2]);
2153 assert(ib == tau[2]);
2155 pt[2]->
v[tau[0]] = vx[taued[1]] ; pt[2]->
v[tau[1]] = vx[taued[0]] ;
2156 xt[2].
tag[taued[0]] = ftag[tau[3]]; xt[2].
tag[taued[2]] = ftag[tau[1]];
2157 xt[2].
tag[taued[3]] = ftag[tau[3]]; xt[2].
tag[taued[4]] = ftag[tau[2]];
2158 xt[2].
edg[taued[0]] = 0; xt[2].
edg[taued[2]] = 0;
2159 xt[2].
edg[taued[3]] = 0; xt[2].
edg[taued[4]] = 0;
2160 xt[2].
ref [ tau[0]] = 0; xt[2].
ref [ tau[2]] = 0;
2161 xt[2].
ftag[ tau[0]] = 0; xt[2].
ftag[ tau[2]] = 0;
2164 pt[3]->
v[tau[0]] = vx[taued[0]] ;
2165 xt[3].
tag[taued[1]] = ftag[tau[3]]; xt[3].
tag[taued[2]] = ftag[tau[2]];
2166 xt[3].
edg[taued[1]] = 0; xt[3].
edg[taued[2]] = 0;
2167 xt[3].
ref [ tau[1]] = 0;
2168 xt[3].
ftag[ tau[1]] = 0;
2169 MG_SET(xt[3].ori, tau[1]);
2173 else if (ia == tau[2] ) {
2174 pt[1]->
v[tau[0]] = vx[taued[1]] ; pt[1]->
v[tau[1]] = vx[taued[0]] ; pt[1]->
v[tau[3]] = vx[taued[2]];
2175 xt[1].
tag[taued[0]] = ftag[tau[3]]; xt[1].
tag[taued[2]] = ftag[tau[1]];
2176 xt[1].
tag[taued[3]] = ftag[tau[3]]; xt[1].
tag[taued[4]] = ftag[tau[2]];
2177 xt[1].
tag[taued[5]] = ftag[tau[1]]; xt[1].
edg[taued[0]] = 0;
2178 xt[1].
edg[taued[2]] = 0; xt[1].
edg[taued[3]] = 0;
2179 xt[1].
edg[taued[4]] = 0; xt[1].
edg[taued[5]] = 0;
2180 xt[1].
ref [ tau[0]] = 0; xt[1].
ref [ tau[2]] = 0;
2181 xt[1].
ftag[ tau[0]] = 0; xt[1].
ftag[ tau[2]] = 0;
2184 if ( ib == tau[3] ) {
2185 pt[2]->
v[tau[0]] = vx[taued[2]] ; pt[2]->
v[tau[1]] = vx[taued[0]] ;
2186 xt[2].
tag[taued[0]] = ftag[tau[2]]; xt[2].
tag[taued[1]] = ftag[tau[1]];
2187 xt[2].
tag[taued[3]] = ftag[tau[3]]; xt[2].
tag[taued[4]] = ftag[tau[2]];
2188 xt[2].
edg[taued[0]] = 0; xt[2].
edg[taued[1]] = 0;
2189 xt[2].
edg[taued[3]] = 0; xt[2].
edg[taued[4]] = 0;
2190 xt[2].
ref [ tau[0]] = 0; xt[2].
ref [ tau[3]] = 0;
2191 xt[2].
ftag[ tau[0]] = 0; xt[2].
ftag[ tau[3]] = 0;
2194 pt[3]->
v[tau[0]] = vx[taued[0]] ;
2195 xt[3].
tag[taued[1]] = ftag[tau[3]]; xt[3].
tag[taued[2]] = ftag[tau[2]];
2196 xt[3].
edg[taued[1]] = 0; xt[3].
edg[taued[2]] = 0;
2197 xt[3].
ref [ tau[1]] = 0;
2198 xt[3].
ftag[ tau[1]] = 0;
2199 MG_SET(xt[3].ori, tau[1]);
2202 assert(ib == tau[1]);
2204 pt[2]->
v[tau[0]] = vx[taued[0]] ; pt[2]->
v[tau[3]] = vx[taued[2]] ;
2205 xt[2].
tag[taued[1]] = ftag[tau[3]]; xt[2].
tag[taued[2]] = ftag[tau[2]];
2206 xt[2].
tag[taued[4]] = ftag[tau[2]]; xt[2].
tag[taued[5]] = ftag[tau[1]];
2207 xt[2].
edg[taued[1]] = 0; xt[2].
edg[taued[2]] = 0;
2208 xt[2].
edg[taued[4]] = 0; xt[2].
edg[taued[5]] = 0;
2209 xt[2].
ref [ tau[0]] = 0; xt[2].
ref [ tau[1]] = 0;
2210 xt[2].
ftag[ tau[0]] = 0; xt[2].
ftag[ tau[1]] = 0;
2213 pt[3]->
v[tau[0]] = vx[taued[2]] ;
2214 xt[3].
tag[taued[0]] = ftag[tau[2]]; xt[3].
tag[taued[1]] = ftag[tau[1]];
2215 xt[3].
edg[taued[0]] = 0; xt[3].
edg[taued[1]] = 0;
2216 xt[3].
ref [ tau[3]] = 0;
2217 xt[3].
ftag[ tau[3]] = 0;
2218 MG_SET(xt[3].ori, tau[3]);
2222 assert(ia == tau[1]);
2224 pt[1]->
v[tau[0]] = vx[taued[0]] ; pt[1]->
v[tau[2]] = vx[taued[1]] ; pt[1]->
v[tau[3]] = vx[taued[2]];
2225 xt[1].
tag[taued[1]] = ftag[tau[3]]; xt[1].
tag[taued[2]] = ftag[tau[2]];
2226 xt[1].
tag[taued[3]] = ftag[tau[3]]; xt[1].
tag[taued[4]] = ftag[tau[2]];
2227 xt[1].
tag[taued[5]] = ftag[tau[1]]; xt[1].
edg[taued[1]] = 0;
2228 xt[1].
edg[taued[2]] = 0; xt[1].
edg[taued[3]] = 0;
2229 xt[1].
edg[taued[4]] = 0; xt[1].
edg[taued[5]] = 0;
2230 xt[1].
ref [ tau[0]] = 0; xt[1].
ref [ tau[1]] = 0;
2231 xt[1].
ftag[ tau[0]] = 0; xt[1].
ftag[ tau[1]] = 0;
2234 if ( ib == tau[2] ) {
2235 pt[2]->
v[tau[0]] = vx[taued[1]] ; pt[2]->
v[tau[3]] = vx[taued[2]] ;
2236 xt[2].
tag[taued[0]] = ftag[tau[3]]; xt[2].
tag[taued[2]] = ftag[tau[1]];
2237 xt[2].
tag[taued[4]] = ftag[tau[2]]; xt[2].
tag[taued[5]] = ftag[tau[1]];
2238 xt[2].
edg[taued[0]] = 0; xt[2].
edg[taued[2]] = 0;
2239 xt[2].
edg[taued[4]] = 0; xt[2].
edg[taued[5]] = 0;
2240 xt[2].
ref [ tau[0]] = 0; xt[2].
ref [ tau[2]] = 0;
2241 xt[2].
ftag[ tau[0]] = 0; xt[2].
ftag[ tau[2]] = 0;
2244 pt[3]->
v[tau[0]] = vx[taued[2]] ;
2245 xt[3].
tag[taued[0]] = ftag[tau[2]]; xt[3].
tag[taued[1]] = ftag[tau[1]];
2246 xt[3].
edg[taued[0]] = 0; xt[3].
edg[taued[1]] = 0;
2247 xt[3].
ref [ tau[3]] = 0;
2248 xt[3].
ftag[ tau[3]] = 0;
2249 MG_SET(xt[3].ori, tau[3]);
2252 assert(ib == tau[3]);
2254 pt[2]->
v[tau[0]] = vx[taued[2]] ; pt[2]->
v[tau[2]] = vx[taued[1]] ;
2255 xt[2].
tag[taued[0]] = ftag[tau[2]]; xt[2].
tag[taued[1]] = ftag[tau[1]];
2256 xt[2].
tag[taued[3]] = ftag[tau[3]]; xt[2].
tag[taued[5]] = ftag[tau[1]];
2257 xt[2].
edg[taued[0]] = 0; xt[2].
edg[taued[1]] = 0;
2258 xt[2].
edg[taued[3]] = 0; xt[2].
edg[taued[5]] = 0;
2259 xt[2].
ref [ tau[0]] = 0; xt[2].
ref [ tau[3]] = 0;
2260 xt[2].
ftag[ tau[0]] = 0; xt[2].
ftag[ tau[3]] = 0;
2263 pt[3]->
v[tau[0]] = vx[taued[1]] ;
2264 xt[3].
tag[taued[0]] = ftag[tau[3]]; xt[3].
tag[taued[2]] = ftag[tau[1]];
2265 xt[3].
edg[taued[0]] = 0; xt[3].
edg[taued[2]] = 0;
2266 xt[3].
ref [ tau[2]] = 0;
2267 xt[3].
ftag[ tau[2]] = 0;
2268 MG_SET(xt[3].ori, tau[2]);
2273 isxt[0] = isxt[1] = isxt[2] = isxt[3] = 0;
2275 for (i=0; i<4; i++) {
2277 for (j=0; j<ne; j++) {
2278 if ( xt[j].ref[i] || xt[j].ftag[i] ) isxt[j] = 1;
2282 if ( (pt[0])->xt ) {
2285 pt[1]->
xt = pt[2]->
xt = pt[3]->
xt = 0;
2286 for (i=1; i<4; i++) {
2292 "larger xtetra table",
2294 fprintf(stderr,
" Exit program.\n");
2305 pt[1]->
xt = pt[2]->
xt = pt[3]->
xt = 0;
2306 for ( i=1; i<4; i++) {
2310 pt[i]->
xt = pt[0]->
xt;
2319 "larger xtetra table",
2321 fprintf(stderr,
" Exit program.\n");
2366 const uint8_t **taued,
2367 uint8_t sym[4],uint8_t symed[6],
2368 uint8_t *ip0,uint8_t *ip1,
2369 uint8_t *ip2,uint8_t *ip3,
2370 uint8_t *ie0,uint8_t *ie1,
2371 uint8_t *ie2,uint8_t *ie3,
2372 uint8_t *ie4,uint8_t *ie5,
2373 uint8_t *imin03,uint8_t *imin12) {
2376 tau[0] = 0 ; tau[1] = 1 ; tau[2] = 2 ; tau[3] = 3;
2379 sym[0] = 0; sym[1] = 1 ; sym[2] = 2 ; sym[3] = 3;
2380 symed[0] = 0 ; symed[1] = 1 ; symed[2] = 2;
2381 symed[3] = 3 ; symed[4] = 4 ; symed[5] = 5;
2385 tau[0] = 0 ; tau[1] = 1 ; tau[2] = 2 ; tau[3] = 3;
2388 sym[0] = 0; sym[1] = 2 ; sym[2] = 1 ; sym[3] = 3;
2389 symed[0] = 1 ; symed[1] = 0 ; symed[2] = 2;
2390 symed[3] = 3 ; symed[4] = 5 ; symed[5] = 4;
2394 tau[0] = 0 ; tau[1] = 3 ; tau[2] = 1 ; tau[3] = 2;
2397 sym[0] = 0; sym[1] = 1 ; sym[2] = 2 ; sym[3] = 3;
2398 symed[0] = 0 ; symed[1] = 1 ; symed[2] = 2;
2399 symed[3] = 3 ; symed[4] = 4 ; symed[5] = 5;
2403 tau[0] = 0 ; tau[1] = 3 ; tau[2] = 1 ; tau[3] = 2;
2406 sym[0] = 0; sym[1] = 2 ; sym[2] = 1 ; sym[3] = 3;
2407 symed[0] = 1 ; symed[1] = 0 ; symed[2] = 2;
2408 symed[3] = 3 ; symed[4] = 5 ; symed[5] = 4;
2412 tau[0] = 3 ; tau[1] = 1 ; tau[2] = 0 ; tau[3] = 2;
2415 sym[0] = 0; sym[1] = 1 ; sym[2] = 2 ; sym[3] = 3;
2416 symed[0] = 0 ; symed[1] = 1 ; symed[2] = 2;
2417 symed[3] = 3 ; symed[4] = 4 ; symed[5] = 5;
2421 tau[0] = 3 ; tau[1] = 1 ; tau[2] = 0 ; tau[3] = 2;
2424 sym[0] = 0; sym[1] = 2 ; sym[2] = 1 ; sym[3] = 3;
2425 symed[0] = 1 ; symed[1] = 0 ; symed[2] = 2;
2426 symed[3] = 3 ; symed[4] = 5 ; symed[5] = 4;
2430 tau[0] = 2 ; tau[1] = 0 ; tau[2] = 1 ; tau[3] = 3;
2433 sym[0] = 0; sym[1] = 1 ; sym[2] = 2 ; sym[3] = 3;
2434 symed[0] = 0 ; symed[1] = 1 ; symed[2] = 2;
2435 symed[3] = 3 ; symed[4] = 4 ; symed[5] = 5;
2439 tau[0] = 0 ; tau[1] = 2 ; tau[2] = 3 ; tau[3] = 1;
2442 sym[0] = 0; sym[1] = 2 ; sym[2] = 1 ; sym[3] = 3;
2443 symed[0] = 1 ; symed[1] = 0 ; symed[2] = 2;
2444 symed[3] = 3 ; symed[4] = 5 ; symed[5] = 4;
2448 tau[0] = 3 ; tau[1] = 2 ; tau[2] = 1 ; tau[3] = 0;
2451 sym[0] = 0; sym[1] = 1 ; sym[2] = 2 ; sym[3] = 3;
2452 symed[0] = 0 ; symed[1] = 1 ; symed[2] = 2;
2453 symed[3] = 3 ; symed[4] = 4 ; symed[5] = 5;
2457 tau[0] = 3 ; tau[1] = 2 ; tau[2] = 1 ; tau[3] = 0;
2460 sym[0] = 0; sym[1] = 2 ; sym[2] = 1 ; sym[3] = 3;
2461 symed[0] = 1 ; symed[1] = 0 ; symed[2] = 2;
2462 symed[3] = 3 ; symed[4] = 5 ; symed[5] = 4;
2466 tau[0] = 3 ; tau[1] = 0 ; tau[2] = 2 ; tau[3] = 1;
2469 sym[0] = 0; sym[1] = 1 ; sym[2] = 2 ; sym[3] = 3;
2470 symed[0] = 0 ; symed[1] = 1 ; symed[2] = 2;
2471 symed[3] = 3 ; symed[4] = 4 ; symed[5] = 5;
2475 tau[0] = 1 ; tau[1] = 2 ; tau[2] = 0 ; tau[3] = 3;
2478 sym[0] = 0; sym[1] = 2 ; sym[2] = 1 ; sym[3] = 3;
2479 symed[0] = 1 ; symed[1] = 0 ; symed[2] = 2;
2480 symed[3] = 3 ; symed[4] = 5 ; symed[5] = 4;
2484 (*ip0) = tau[sym[0]];
2485 (*ip1) = tau[sym[1]];
2486 (*ip2) = tau[sym[2]];
2487 (*ip3) = tau[sym[3]];
2489 (*ie0) = (*taued)[symed[0]];
2490 (*ie1) = (*taued)[symed[1]];
2491 (*ie2) = (*taued)[symed[2]];
2492 (*ie3) = (*taued)[symed[3]];
2493 (*ie4) = (*taued)[symed[4]];
2494 (*ie5) = (*taued)[symed[5]];
2497 assert(vx[(*ie0)] > 0);
2498 assert(vx[(*ie1)] > 0);
2499 assert(vx[(*ie5)] > 0);
2500 assert(vx[(*ie2)] <= 0);
2501 assert(vx[(*ie3)] <= 0);
2502 assert(vx[(*ie4)] <= 0);
2505 (*imin03) = (pt->
v[(*ip0)] < pt->
v[(*ip3)]) ? (*ip0) : (*ip3);
2506 (*imin12) = (pt->
v[(*ip1)] < pt->
v[(*ip2)]) ? (*ip1) : (*ip2);
2525 uint8_t tau[4],sym[4],symed[6],ip0,ip1,ip2,ip3,ie0,ie1,ie2,ie3;
2526 uint8_t ie4,ie5,imin03,imin12;
2527 const uint8_t *taued=NULL;
2536 MMG3D_split3op_cfg(pt,vx,tau,&taued,sym,symed,&ip0,&ip1,&ip2,&ip3,
2537 &ie0,&ie1,&ie2,&ie3,&ie4,&ie5,&imin03,&imin12);
2540 if ( (imin12 == ip2) && (imin03 == ip0) ) {
2541 pt0->
v[ip0] = vx[ie1] ; pt0->
v[ip1] = vx[ie0] ; pt0->
v[ip3] = vx[ie5] ;
2546 pt0->
v[ip0] = vx[ie0] ; pt0->
v[ip3] = vx[ie5] ;
2551 pt0->
v[ip0] = vx[ie0] ; pt0->
v[ip2] = vx[ie5] ;
2556 pt0->
v[ip1] = vx[ie0] ; pt0->
v[ip2] = vx[ie1] ; pt0->
v[ip3] = vx[ie5] ;
2561 pt0->
v[ip1] = vx[ie0] ; pt0->
v[ip2] = vx[ie5];
2566 else if ( (imin12 == ip1) && (imin03 == ip0) ) {
2567 pt0->
v[ip0] = vx[ie1] ; pt0->
v[ip3] = vx[ie5] ;
2572 pt0->
v[ip0] = vx[ie0] ; pt0->
v[ip2] = vx[ie1] ; pt0->
v[ip3] = vx[ie5];
2577 pt0->
v[ip0] = vx[ie0] ; pt0->
v[ip2] = vx[ie5] ;
2582 pt0->
v[ip1] = vx[ie0] ; pt0->
v[ip2] = vx[ie5];
2587 pt0->
v[ip1] = vx[ie0] ; pt0->
v[ip2] = vx[ie1]; pt0->
v[ip3] = vx[ie5];
2591 else if ( (imin12 == ip2) && (imin03 == ip3) ) {
2592 pt0->
v[ip1] = vx[ie0] ; pt0->
v[ip2] = vx[ie1] ;
2597 pt0->
v[ip0] = vx[ie1] ; pt0->
v[ip1] = vx[ie0] ; pt0->
v[ip2] = vx[ie5];
2602 pt0->
v[ip0] = vx[ie0] ; pt0->
v[ip2] = vx[ie5] ;
2607 pt0->
v[ip0] = vx[ie1] ; pt0->
v[ip1] = vx[ie0]; pt0->
v[ip3] = vx[ie5];
2612 pt0->
v[ip0] = vx[ie0] ; pt0->
v[ip3] = vx[ie5];
2617 assert((imin12 == ip1) && (imin03 == ip3)) ;
2619 pt0->
v[ip1] = vx[ie0] ; pt0->
v[ip2] = vx[ie1] ;
2624 pt0->
v[ip0] = vx[ie1] ; pt0->
v[ip3] = vx[ie5] ;
2629 pt0->
v[ip0] = vx[ie0] ; pt0->
v[ip2] = vx[ie1] ;
2634 pt0->
v[ip0] = vx[ie1] ; pt0->
v[ip2] = vx[ie5] ;
2659 MMG5_int newtet[5],ref[4];
2660 uint8_t imin12,imin03,tau[4],sym[4],symed[6],ip0,ip1,ip2,ip3,ie0,ie1;
2661 uint8_t ie2,ie3,ie4,ie5,isxt[5],firstxt,i;
2663 const uint8_t *taued=NULL;
2670 MMG3D_split3op_cfg(pt[0],vx,tau,&taued,sym,symed,&ip0,&ip1,&ip2,&ip3,
2671 &ie0,&ie1,&ie2,&ie3,&ie4,&ie5,&imin03,&imin12);
2681 for (i=0; i<4; i++) {
2682 ftag[i] = (xt[0].
ftag[i] & ~MG_REF);
2685 if ( !((imin12 == ip1) && (imin03 == ip3)) ) {
2689 fprintf(stderr,
"\n ## Error: %s: unable to allocate"
2690 " a new element.\n",__func__);
2692 fprintf(stderr,
" Exit program.\n");
2700 pt[4] = memcpy(pt[4],pt[0],
sizeof(
MMG5_Tetra));
2713 if ( (imin12 == ip2) && (imin03 == ip0) ) {
2714 pt[0]->
v[ip0] = vx[ie1] ; pt[0]->
v[ip1] = vx[ie0] ; pt[0]->
v[ip3] = vx[ie5] ;
2715 xt[0].
tag[ie0] = ftag[ip3]; xt[0].
tag[ie2] = ftag[ip1];
2716 xt[0].
tag[ie3] = ftag[ip3]; xt[0].
tag[ie4] = 0;
2717 xt[0].
edg[ie0] = 0; xt[0].
edg[ie2] = 0;
2718 xt[0].
edg[ie3] = 0; xt[0].
edg[ie4] = 0;
2719 xt[0].
ref [ip0] = 0 ; xt[0].
ref [ip2] = 0 ;
2720 xt[0].
ftag[ip0] = 0 ; xt[0].
ftag[ip2] = 0 ;
2723 pt[1]->
v[ip0] = vx[ie0] ; pt[1]->
v[ip3] = vx[ie5] ;
2724 xt[1].
tag[ie1] = ftag[ip3]; xt[1].
tag[ie2] = 0;
2725 xt[1].
tag[ie4] = ftag[ip0]; xt[1].
edg[ie1] = 0;
2726 xt[1].
edg[ie2] = 0; xt[1].
edg[ie4] = 0;
2727 xt[1].
ref [ip1] = 0 ; xt[1] .
ref[ip2] = 0 ;
2728 xt[1].
ftag[ip1] = 0 ; xt[1].
ftag[ip2] = 0 ;
2731 pt[2]->
v[ip0] = vx[ie0] ; pt[2]->
v[ip2] = vx[ie5] ;
2732 xt[2].
tag[ie1] = 0; xt[2].
tag[ie2] = ftag[ip2];
2733 xt[2].
tag[ie3] = ftag[ip0]; xt[2].
edg[ie1] = 0;
2734 xt[2].
edg[ie2] = 0; xt[2].
edg[ie3] = 0;
2735 xt[2].
ref [ip1] = 0 ; xt[2].
ref [ip3] = 0 ;
2736 xt[2].
ftag[ip1] = 0 ; xt[2].
ftag[ip3] = 0 ;
2739 pt[3]->
v[ip1] = vx[ie0] ; pt[3]->
v[ip2] = vx[ie1] ; pt[3]->
v[ip3] = vx[ie5] ;
2740 xt[3].
tag[ie2] = ftag[ip1]; xt[3].
tag[ie3] = ftag[ip3];
2741 xt[3].
tag[ie4] = 0; xt[3].
tag[ie5] = ftag[ip1];
2742 xt[3].
edg[ie2] = 0; xt[3].
edg[ie3] = 0;
2743 xt[3].
edg[ie4] = 0; xt[3].
edg[ie5] = 0;
2744 xt[3].
ref [ip0] = 0 ; xt[3].
ref [ip2] = 0 ;
2745 xt[3].
ftag[ip0] = 0 ; xt[3].
ftag[ip2] = 0 ;
2748 pt[4]->
v[ip1] = vx[ie0] ; pt[4]->
v[ip2] = vx[ie5];
2749 xt[4].
tag[ie1] = ftag[ip1]; xt[4].
tag[ie3] = 0;
2750 xt[4].
tag[ie4] = ftag[ip2]; xt[4].
edg[ie1] = 0;
2751 xt[4].
edg[ie3] = 0; xt[4].
edg[ie4] = 0;
2752 xt[4].
ref [ip0] = 0 ; xt[4].
ref [ip3] = 0 ;
2753 xt[4].
ftag[ip0] = 0 ; xt[4].
ftag[ip3] = 0 ;
2757 else if ( (imin12 == ip1) && (imin03 == ip0) ) {
2758 pt[0]->
v[ip0] = vx[ie1] ; pt[0]->
v[ip3] = vx[ie5] ;
2759 xt[0].
tag[ie0] = ftag[ip3]; xt[0].
tag[ie2] = ftag[ip1];
2760 xt[0].
tag[ie4] = ftag[ip0]; xt[0].
edg[ie0] = 0;
2761 xt[0].
edg[ie2] = 0; xt[0].
edg[ie4] = 0;
2762 xt[0].
ref[ip2] = 0 ;
2763 xt[0].
ftag[ip2] = 0 ;
2766 pt[1]->
v[ip0] = vx[ie0] ; pt[1]->
v[ip2] = vx[ie1] ; pt[1]->
v[ip3] = vx[ie5];
2767 xt[1].
tag[ie1] = ftag[ip3]; xt[1].
tag[ie2] = 0;
2768 xt[1].
tag[ie3] = ftag[ip3]; xt[1].
tag[ie4] = ftag[ip0];
2769 xt[1].
tag[ie5] = ftag[ip1]; xt[1].
edg[ie1] = 0;
2770 xt[1].
edg[ie2] = 0; xt[1].
edg[ie3] = 0;
2771 xt[1].
edg[ie4] = 0; xt[1].
edg[ie5] = 0;
2772 xt[1].
ref [ip0] = 0 ; xt[1].
ref [ip1] = 0 ; xt[1].
ref [ip2] = 0 ;
2773 xt[1].
ftag[ip0] = 0 ; xt[1].
ftag[ip1] = 0 ; xt[1].
ftag[ip2] = 0 ;
2776 pt[2]->
v[ip0] = vx[ie0] ; pt[2]->
v[ip2] = vx[ie5] ;
2777 xt[2].
tag[ie1] = 0; xt[2].
tag[ie2] = ftag[ip2];
2778 xt[2].
tag[ie3] = ftag[ip0]; xt[2].
edg[ie1] = 0;
2779 xt[2].
edg[ie2] = 0; xt[2].
edg[ie3] = 0;
2780 xt[2].
ref [ip1] = 0 ; xt[2].
ref [ip3] = 0 ;
2781 xt[2].
ftag[ip1] = 0 ; xt[2].
ftag[ip3] = 0 ;
2784 pt[3]->
v[ip1] = vx[ie0] ; pt[3]->
v[ip2] = vx[ie5];
2785 xt[3].
tag[ie1] = ftag[ip1]; xt[3].
tag[ie3] = 0;
2786 xt[3].
tag[ie4] = ftag[ip2]; xt[3].
edg[ie1] = 0;
2787 xt[3].
edg[ie3] = 0; xt[3].
edg[ie4] = 0;
2788 xt[3].
ref [ip0] = 0 ; xt[3].
ref [ip3] = 0 ;
2789 xt[3].
ftag[ip0] = 0 ; xt[3].
ftag[ip3] = 0 ;
2792 pt[4]->
v[ip1] = vx[ie0] ; pt[4]->
v[ip2] = vx[ie1]; pt[4]->
v[ip3] = vx[ie5];
2793 xt[4].
tag[ie2] = ftag[ip1]; xt[4].
tag[ie3] = ftag[ip3];
2794 xt[4].
tag[ie4] = 0; xt[4].
tag[ie5] = ftag[ip1];
2795 xt[4].
edg[ie2] = 0; xt[4].
edg[ie3] = 0;
2796 xt[4].
edg[ie4] = 0; xt[4].
edg[ie5] = 0;
2797 xt[4].
ref [ip0] = 0 ; xt[4].
ref [ip2] = 0 ;
2798 xt[4].
ftag[ip0] = 0 ; xt[4].
ftag[ip2] = 0 ;
2802 else if ( (imin12 == ip2) && (imin03 == ip3) ) {
2803 pt[0]->
v[ip1] = vx[ie0] ; pt[0]->
v[ip2] = vx[ie1] ;
2804 xt[0].
tag[ie3] = ftag[ip3]; xt[0].
tag[ie4] = ftag[ip2];
2805 xt[0].
tag[ie5] = ftag[ip1]; xt[0].
edg[ie3] = 0;
2806 xt[0].
edg[ie4] = 0; xt[0].
edg[ie5] = 0;
2807 xt[0].
ref[ip0] = 0 ;
2808 xt[0].
ftag[ip0] = 0 ;
2811 pt[1]->
v[ip0] = vx[ie1] ; pt[1]->
v[ip1] = vx[ie0] ; pt[1]->
v[ip2] = vx[ie5];
2812 xt[1].
tag[ie0] = ftag[ip3]; xt[1].
tag[ie1] = ftag[ip1];
2813 xt[1].
tag[ie2] = ftag[ip1]; xt[1].
tag[ie3] = 0;
2814 xt[1].
tag[ie4] = ftag[ip2]; xt[1].
edg[ie0] = 0;
2815 xt[1].
edg[ie1] = 0; xt[1].
edg[ie2] = 0;
2816 xt[1].
edg[ie3] = 0; xt[1].
edg[ie4] = 0;
2817 xt[1].
ref [ip0] = 0 ; xt[1].
ref [ip2] = 0 ; xt[1].
ref [ip3] = 0 ;
2818 xt[1].
ftag[ip0] = 0 ; xt[1].
ftag[ip2] = 0 ; xt[1].
ftag[ip3] = 0 ;
2821 pt[2]->
v[ip0] = vx[ie0] ; pt[2]->
v[ip2] = vx[ie5] ;
2822 xt[2].
tag[ie1] = 0; xt[2].
tag[ie2] = ftag[ip2];
2823 xt[2].
tag[ie3] = ftag[ip0]; xt[2].
edg[ie1] = 0;
2824 xt[2].
edg[ie2] = 0; xt[2].
edg[ie3] = 0;
2825 xt[2].
ref [ip1] = 0 ; xt[2].
ref [ip3] = 0 ;
2826 xt[2].
ftag[ip1] = 0 ; xt[2].
ftag[ip3] = 0 ;
2829 pt[3]->
v[ip0] = vx[ie1] ; pt[3]->
v[ip1] = vx[ie0]; pt[3]->
v[ip3] = vx[ie5];
2830 xt[3].
tag[ie0] = ftag[ip3]; xt[3].
tag[ie2] = ftag[ip1];
2831 xt[3].
tag[ie3] = ftag[ip3]; xt[3].
tag[ie4] = 0;
2832 xt[3].
edg[ie0] = 0; xt[3].
edg[ie2] = 0;
2833 xt[3].
edg[ie3] = 0; xt[3].
edg[ie4] = 0;
2834 xt[3].
ref [ip0] = 0 ; xt[3].
ref [ip2] = 0 ;
2835 xt[3].
ftag[ip0] = 0 ; xt[3].
ftag[ip2] = 0 ;
2838 pt[4]->
v[ip0] = vx[ie0] ; pt[4]->
v[ip3] = vx[ie5];
2839 xt[4].
tag[ie1] = ftag[ip3]; xt[4].
tag[ie2] = 0;
2840 xt[4].
tag[ie4] = ftag[ip0]; xt[4].
edg[ie1] = 0;
2841 xt[4].
edg[ie2] = 0; xt[4].
edg[ie4] = 0;
2842 xt[4].
ref [ip1] = 0 ; xt[4].
ref [ip2] = 0 ;
2843 xt[4].
ftag[ip1] = 0 ; xt[4].
ftag[ip2] = 0 ;
2847 assert((imin12 == ip1) && (imin03 == ip3)) ;
2849 pt[0]->
v[ip1] = vx[ie0] ; pt[0]->
v[ip2] = vx[ie1] ;
2850 xt[0].
tag[ie3] = ftag[ip3]; xt[0].
tag[ie4] = ftag[ip2];
2851 xt[0].
tag[ie5] = ftag[ip1]; xt[0].
edg[ie3] = 0;
2852 xt[0].
edg[ie4] = 0; xt[0].
edg[ie5] = 0;
2853 xt[0].
ref [ip0] = 0 ;
2854 xt[0].
ftag[ip0] = 0 ;
2857 pt[1]->
v[ip0] = vx[ie1] ; pt[1]->
v[ip3] = vx[ie5] ;
2858 xt[1].
tag[ie0] = ftag[ip3]; xt[1].
tag[ie2] = ftag[ip1];
2859 xt[1].
tag[ie4] = ftag[ip0]; xt[1].
edg[ie0] = 0;
2860 xt[1].
edg[ie2] = 0; xt[1].
edg[ie4] = 0;
2861 xt[1].
ref [ip2] = 0 ;
2862 xt[1].
ftag[ip2] = 0 ;
2865 pt[2]->
v[ip0] = vx[ie0] ; pt[2]->
v[ip2] = vx[ie1] ;
2866 xt[2].
tag[ie1] = ftag[ip3]; xt[2].
tag[ie2] = ftag[ip2];
2867 xt[2].
tag[ie3] = ftag[ip3]; xt[2].
tag[ie5] = ftag[ip1];
2868 xt[2].
edg[ie1] = 0; xt[2].
edg[ie2] = 0;
2869 xt[2].
edg[ie3] = 0; xt[2].
edg[ie5] = 0;
2870 xt[2].
ref [ip0] = 0 ; xt[2].
ref [ip1] = 0 ;
2871 xt[2].
ftag[ip0] = 0 ; xt[2].
ftag[ip1] = 0 ;
2874 pt[3]->
v[ip0] = vx[ie1] ; pt[3]->
v[ip2] = vx[ie5] ;
2875 xt[3].
tag[ie0] = ftag[ip3]; xt[3].
tag[ie1] = ftag[ip1];
2876 xt[3].
tag[ie2] = ftag[ip1]; xt[3].
tag[ie3] = ftag[ip0];
2877 xt[3].
edg[ie0] = 0; xt[3].
edg[ie1] = 0;
2878 xt[3].
edg[ie2] = 0; xt[3].
edg[ie3] = 0;
2879 xt[3].
ref [ip2] = 0 ; xt[3].
ref [ip3] = 0 ;
2880 xt[3].
ftag[ip2] = 0 ; xt[3].
ftag[ip3] = 0 ;
2885 if ( (imin12 == ip1) && (imin03 == ip3) ) {
2886 isxt[0] = isxt[1] = isxt[2] = isxt[3] = 0;
2888 for (i=0; i<4; i++) {
2890 for (j=0; j<ne; j++) {
2891 if ( xt[j].ref[i] || xt[j].ftag[i] ) isxt[j] = 1;
2898 pt[1]->
xt = pt[2]->
xt = pt[3]->
xt = 0;
2900 for (i=1; i<4; i++) {
2906 "larger xtetra table",
2908 fprintf(stderr,
" Exit program.\n");
2919 pt[1]->
xt = pt[2]->
xt = pt[3]->
xt = 0;
2921 for (i=1; i<4; i++) {
2925 pt[i]->
xt = pt[0]->
xt;
2934 "larger xtetra table",
2936 fprintf(stderr,
" Exit program.\n");
2951 isxt[0] = isxt[1] = isxt[2] = isxt[3] = isxt[4] = 0;
2953 for (i=0; i<4; i++) {
2955 for (j=0; j<=ne; j++) {
2956 if ( xt[j].ref[i] || xt[j].ftag[i] ) isxt[j] = 1;
2963 pt[1]->
xt = pt[2]->
xt = pt[3]->
xt = pt[4]->
xt = 0;
2965 for(i=1; i<5; i++) {
2971 "larger xtetra table",
2973 fprintf(stderr,
" Exit program.\n");
2984 pt[1]->
xt = pt[2]->
xt = pt[3]->
xt = pt[4]->
xt = 0;
2986 for (i=1; i<5; i++) {
2990 pt[i]->
xt = pt[0]->
xt;
2999 "larger xtetra table",
3001 fprintf(stderr,
" Exit program.\n");
3016 if ( (!metRidTyp) && met->
m && met->
size>1 ) {
3021 if ( !((imin12 == ip1) && (imin03 == ip3)) ) {
3030 if ( !((imin12 == ip1) && (imin03 == ip3)) ) {
3056 MMG5_int ib,iadr,*adja,adj1,adj2,adj3,newtet[4],src;
3058 uint8_t isxt[4],firstxt;
3065 o[0] = o[1] = o[2] = 0.0;
3066 for (i=0; i<4; i++) {
3077 cb[0] = 0.25; cb[1] = 0.25; cb[2] = 0.25; cb[3] = 0.25;
3086 fprintf(stderr,
"\n ## Error: %s: unable to allocate"
3087 " a new point\n",__func__);
3093 if ( !metRidTyp && met->
size > 1 )
3096 MMG5_interp4bar(
mesh,met,k,ib,cb);
3106 iadr = 4*(newtet[0]-1)+1;
3115 adja[1] = 4*newtet[1];
3116 adja[2] = 4*newtet[2];
3117 adja[3] = 4*newtet[3];
3119 iadr = 4*(newtet[1]-1)+1;
3121 adja[0] = 4*newtet[0] + 1;
3123 adja[2] = 4*newtet[2] + 1;
3124 adja[3] = 4*newtet[3] + 1;
3126 mesh->
adja[4*(adj1/4-1) + 1+adj1%4] = 4*newtet[1]+1;
3128 iadr = 4*(newtet[2]-1)+1;
3130 adja[0] = 4*newtet[0] + 2;
3131 adja[1] = 4*newtet[1] + 2;
3133 adja[3] = 4*newtet[3] + 2;
3135 mesh->
adja[4*(adj2/4-1) + 1+adj2%4] = 4*newtet[2]+2;
3137 iadr = 4*(newtet[3]-1)+1;
3139 adja[0] = 4*newtet[0] + 3;
3140 adja[1] = 4*newtet[1] + 3;
3141 adja[2] = 4*newtet[2] + 3;
3144 mesh->
adja[4*(adj3/4-1) + 1+adj3%4] = 4*newtet[3]+3;
3148 pt[0]->
v[0] = pt[1]->
v[1] = pt[2]->
v[2] = pt[3]->
v[3] = ib;
3150 xt[0].
tag[0] = 0; xt[0].
edg[0] = 0;
3151 xt[0].
tag[1] = 0; xt[0].
edg[1] = 0;
3152 xt[0].
tag[2] = 0; xt[0].
edg[2] = 0;
3153 xt[0].
ref [1] = 0; xt[0].
ref [2] = 0; xt[0].
ref [3] = 0;
3154 xt[0].
ftag[1] = 0; xt[0].
ftag[2] = 0; xt[0].
ftag[3] = 0;
3157 xt[1].
tag[0] = 0; xt[1].
edg[0] = 0;
3158 xt[1].
tag[3] = 0; xt[1].
edg[3] = 0;
3159 xt[1].
tag[4] = 0; xt[1].
edg[4] = 0;
3160 xt[1].
ref [0] = 0; xt[1].
ref [2] = 0; xt[1].
ref [3] = 0;
3161 xt[1].
ftag[0] = 0; xt[1].
ftag[2] = 0; xt[1].
ftag[3] = 0;
3164 xt[2].
tag[1] = 0; xt[2].
edg[1] = 0;
3165 xt[2].
tag[3] = 0; xt[2].
edg[3] = 0;
3166 xt[2].
tag[5] = 0; xt[2].
edg[5] = 0;
3167 xt[2].
ref [0] = 0; xt[2].
ref [1] = 0; xt[2].
ref [3] = 0;
3168 xt[2].
ftag[0] = 0; xt[2].
ftag[1] = 0; xt[2].
ftag[3] = 0;
3171 xt[3].
tag[2] = 0; xt[3].
edg[2] = 0;
3172 xt[3].
tag[4] = 0; xt[3].
edg[4] = 0;
3173 xt[3].
tag[5] = 0; xt[3].
edg[5] = 0;
3174 xt[3].
ref [0] = 0; xt[3].
ref [1] = 0; xt[3].
ref [2] = 0;
3175 xt[3].
ftag[0] = 0; xt[3].
ftag[1] = 0; xt[3].
ftag[2] = 0;
3179 memset(isxt,0,ne*
sizeof(int8_t));
3180 for (i=0; i<ne; i++) {
3182 for (j=0; j<ne; j++) {
3183 if ( xt[j].ref[i] || xt[j].ftag[i] ) isxt[j] = 1;
3190 for (i=1; i<4; i++) {
3196 "larger xtetra table",
3211 for (i=1; i<4; i++) {
3215 pt[i]->
xt = pt[0]->
xt;
3224 "larger xtetra table",
3261 const uint8_t **taued, uint8_t *imin23,uint8_t *imin12) {
3263 tau[0] = 0 ; tau[1] = 1 ; tau[2] = 2 ; tau[3] = 3;
3267 tau[0] = 1 ; tau[1] = 3 ; tau[2] = 2 ; tau[3] = 0;
3272 tau[0] = 3 ; tau[1] = 0 ; tau[2] = 2 ; tau[3] = 1;
3277 tau[0] = 3 ; tau[1] = 1 ; tau[2] = 0 ; tau[3] = 2;
3282 tau[0] = 1 ; tau[1] = 2 ; tau[2] = 0 ; tau[3] = 3;
3287 tau[0] = 2 ; tau[1] = 3 ; tau[2] = 0 ; tau[3] = 1;
3292 tau[0] = 1 ; tau[1] = 0 ; tau[2] = 3 ; tau[3] = 2;
3297 tau[0] = 0 ; tau[1] = 2 ; tau[2] = 3 ; tau[3] = 1;
3302 tau[0] = 2 ; tau[1] = 1 ; tau[2] = 3 ; tau[3] = 0;
3307 tau[0] = 0 ; tau[1] = 3 ; tau[2] = 1 ; tau[3] = 2;
3312 tau[0] = 3 ; tau[1] = 2 ; tau[2] = 1 ; tau[3] = 0;
3317 tau[0] = 2 ; tau[1] = 0 ; tau[2] = 1 ; tau[3] = 3;
3322 (*imin23) = (pt->
v[tau[2]] < pt->
v[tau[3]]) ? tau[2] : tau[3];
3323 (*imin12) = (pt->
v[tau[1]] < pt->
v[tau[2]]) ? tau[1] : tau[2];
3341 uint8_t imin23,imin12;
3342 const uint8_t *taued = NULL;
3355 pt0->
v[tau[1]] = vx[taued[0]];
3356 pt0->
v[tau[2]] = vx[taued[1]];
3357 pt0->
v[tau[3]] = vx[taued[2]];
3362 pt0->
v[tau[0]] = vx[taued[2]];
3363 pt0->
v[tau[1]] = vx[taued[0]];
3364 pt0->
v[tau[2]] = vx[taued[1]];
3365 pt0->
v[tau[3]] = vx[taued[4]] ;
3370 if ( imin12 == tau[1] ) {
3371 pt0->
v[tau[0]] = vx[taued[0]];
3372 pt0->
v[tau[2]] = vx[taued[1]];
3373 pt0->
v[tau[3]] = vx[taued[4]];
3378 pt0->
v[tau[0]] = vx[taued[1]];
3379 pt0->
v[tau[3]] = vx[taued[4]];
3384 pt0->
v[tau[0]] = vx[taued[1]];
3385 pt0->
v[tau[1]] = vx[taued[0]];
3386 pt0->
v[tau[3]] = vx[taued[4]] ;
3391 pt0->
v[tau[0]] = vx[taued[0]];
3392 pt0->
v[tau[3]] = vx[taued[4]] ;
3398 if ( imin23 == tau[2] ) {
3399 pt0->
v[tau[0]] = vx[taued[1]];
3400 pt0->
v[tau[1]] = vx[taued[4]];
3401 pt0->
v[tau[3]] = vx[taued[2]];
3406 pt0->
v[tau[0]] = vx[taued[2]];
3407 pt0->
v[tau[1]] = vx[taued[4]];
3412 pt0->
v[tau[0]] = vx[taued[2]];
3413 pt0->
v[tau[1]] = vx[taued[4]];
3414 pt0->
v[tau[2]] = vx[taued[1]];
3419 pt0->
v[tau[0]] = vx[taued[1]];
3420 pt0->
v[tau[1]] = vx[taued[4]];
3445 int8_t firstxt,isxt[6],j,i;
3447 uint8_t tau[4],imin23,imin12;
3448 const uint8_t *taued = NULL;
3464 for (i=0; i<4; i++) {
3465 ftag[i] = (xt[0].
ftag[i] & ~MG_REF);
3469 pt[0]->
v[tau[1]] = vx[taued[0]] ; pt[0]->
v[tau[2]] = vx[taued[1]] ; pt[0]->
v[tau[3]] = vx[taued[2]];
3470 xt[0].
tag[taued[3]] = ftag[tau[3]]; xt[0].
tag[taued[4]] = ftag[tau[2]];
3471 xt[0].
tag[taued[5]] = ftag[tau[1]]; xt[0].
edg[taued[3]] = 0;
3472 xt[0].
edg[taued[4]] = 0; xt[0].
edg[taued[5]] = 0;
3473 xt[0].
ref [ tau[0]] = 0 ;
3474 xt[0].
ftag[ tau[0]] = 0 ;
3475 MG_SET(xt[0].ori, tau[0]);
3477 pt[1]->
v[tau[0]] = vx[taued[2]] ; pt[1]->
v[tau[1]] = vx[taued[0]] ;
3478 pt[1]->
v[tau[2]] = vx[taued[1]] ; pt[1]->
v[tau[3]] = vx[taued[4]] ;
3479 xt[1].
tag[taued[0]] = ftag[tau[2]]; xt[1].
tag[taued[1]] = ftag[tau[1]];
3480 xt[1].
tag[taued[2]] = ftag[tau[2]]; xt[1].
tag[taued[3]] = ftag[tau[3]];
3481 xt[1].
tag[taued[4]] = ftag[tau[2]]; xt[1].
tag[taued[5]] = 0;
3482 xt[1].
edg[taued[0]] = 0; xt[1].
edg[taued[1]] = 0;
3483 xt[1].
edg[taued[2]] = 0; xt[1].
edg[taued[3]] = 0;
3484 xt[1].
edg[taued[4]] = 0; xt[1].
edg[taued[5]] = 0;
3485 xt[1].
ref [ tau[0]] = 0 ; xt[1].
ref [ tau[1]] = 0 ; xt[1].
ref [tau[3]] = 0 ;
3486 xt[1].
ftag[ tau[0]] = 0 ; xt[1].
ftag[ tau[1]] = 0 ; xt[1].
ftag[tau[3]] = 0 ;
3489 if ( imin12 == tau[1] ) {
3490 pt[2]->
v[tau[0]] = vx[taued[0]] ; pt[2]->
v[tau[2]] = vx[taued[1]] ; pt[2]->
v[tau[3]] = vx[taued[4]] ;
3491 xt[2].
tag[taued[1]] = ftag[tau[3]]; xt[2].
tag[taued[2]] = ftag[tau[2]];
3492 xt[2].
tag[taued[3]] = ftag[tau[3]]; xt[2].
tag[taued[5]] = 0;
3493 xt[2].
edg[taued[1]] = 0; xt[2].
edg[taued[2]] = 0;
3494 xt[2].
edg[taued[3]] = 0; xt[2].
edg[taued[5]] = 0;
3495 xt[2].
ref [ tau[0]] = 0 ; xt[2].
ref [ tau[1]] = 0 ;
3496 xt[2].
ftag[ tau[0]] = 0 ; xt[2].
ftag[ tau[1]] = 0 ;
3499 pt[3]->
v[tau[0]] = vx[taued[1]] ; pt[3]->
v[tau[3]] = vx[taued[4]] ;
3500 xt[3].
tag[taued[0]] = ftag[tau[3]]; xt[3].
tag[taued[2]] = 0;
3501 xt[3].
tag[taued[5]] = ftag[tau[0]]; xt[3].
edg[taued[0]] = 0;
3502 xt[3].
edg[taued[2]] = 0; xt[3].
edg[taued[5]] = 0;
3503 xt[3].
ref [ tau[1]] = 0 ; xt[3].
ref [ tau[2]] = 0 ;
3504 xt[3].
ftag[ tau[1]] = 0 ; xt[3].
ftag[ tau[2]] = 0 ;
3508 pt[2]->
v[tau[0]] = vx[taued[1]] ; pt[2]->
v[tau[1]] = vx[taued[0]] ; pt[2]->
v[tau[3]] = vx[taued[4]] ;
3509 xt[2].
tag[taued[0]] = ftag[tau[3]]; xt[2].
tag[taued[2]] = 0;
3510 xt[2].
tag[taued[3]] = ftag[tau[3]]; xt[2].
tag[taued[4]] = ftag[tau[2]];
3511 xt[2].
tag[taued[5]] = ftag[tau[0]]; xt[2].
edg[taued[0]] = 0;
3512 xt[2].
edg[taued[2]] = 0; xt[2].
edg[taued[3]] = 0;
3513 xt[2].
edg[taued[4]] = 0; xt[2].
edg[taued[5]] = 0;
3514 xt[2].
ref [ tau[0]] = 0 ; xt[2].
ref [ tau[1]] = 0 ; xt[2].
ref [tau[2]] = 0 ;
3515 xt[2].
ftag[ tau[0]] = 0 ; xt[2].
ftag[ tau[1]] = 0 ; xt[2].
ftag[tau[2]] = 0 ;
3518 pt[3]->
v[tau[0]] = vx[taued[0]] ; pt[3]->
v[tau[3]] = vx[taued[4]] ;
3519 xt[3].
tag[taued[1]] = ftag[tau[3]]; xt[3].
tag[taued[2]] = ftag[tau[2]];
3520 xt[3].
tag[taued[5]] = ftag[tau[0]]; xt[3].
edg[taued[1]] = 0;
3521 xt[3].
edg[taued[2]] = 0; xt[3].
edg[taued[5]] = 0;
3522 xt[3].
ref [ tau[1]] = 0 ;
3523 xt[3].
ftag[ tau[1]] = 0 ;
3524 MG_SET(xt[3].ori, tau[1]);
3527 if ( imin23 == tau[2] ) {
3528 pt[4]->
v[tau[0]] = vx[taued[1]] ; pt[4]->
v[tau[1]] = vx[taued[4]] ; pt[4]->
v[tau[3]] = vx[taued[2]] ;
3529 xt[4].
tag[taued[0]] = 0; xt[4].
tag[taued[2]] = ftag[tau[1]];
3530 xt[4].
tag[taued[3]] = ftag[tau[0]]; xt[4].
tag[taued[4]] = ftag[tau[2]];
3531 xt[4].
tag[taued[5]] = ftag[tau[1]];
3532 xt[4].
edg[taued[0]] = 0; xt[4].
edg[taued[2]] = 0;
3533 xt[4].
edg[taued[3]] = 0; xt[4].
edg[taued[4]] = 0;
3534 xt[4].
edg[taued[5]] = 0;
3535 xt[4].
ref [ tau[0]] = 0; xt[4].
ref [ tau[2]] = 0 ;
3536 xt[4].
ref [ tau[3]] = 0 ;
3537 xt[4].
ftag[ tau[0]] = 0; xt[4].
ftag[ tau[2]] = 0 ;
3538 xt[4].
ftag[ tau[3]] = 0 ;
3541 pt[5]->
v[tau[0]] = vx[taued[2]] ; pt[5]->
v[tau[1]] = vx[taued[4]] ;
3542 xt[5].
tag[taued[0]] = ftag[tau[2]]; xt[5].
tag[taued[1]] = ftag[tau[1]];
3543 xt[5].
tag[taued[3]] = ftag[tau[0]]; xt[5].
edg[taued[0]] = 0;
3544 xt[5].
edg[taued[1]] = 0; xt[5].
edg[taued[3]] = 0;
3545 xt[5].
ref [ tau[3]] = 0 ;
3546 xt[5].
ftag[ tau[3]] = 0 ;
3547 MG_SET(xt[5].ori, tau[3]);
3550 pt[4]->
v[tau[0]] = vx[taued[2]] ; pt[4]->
v[tau[1]] = vx[taued[4]] ; pt[4]->
v[tau[2]] = vx[taued[1]] ;
3551 xt[4].
tag[taued[0]] = ftag[tau[2]]; xt[4].
tag[taued[1]] = ftag[tau[1]];
3552 xt[4].
tag[taued[3]] = 0; xt[4].
tag[taued[5]] = ftag[tau[1]];
3553 xt[4].
edg[taued[0]] = 0; xt[4].
edg[taued[1]] = 0;
3554 xt[4].
edg[taued[3]] = 0; xt[4].
edg[taued[5]] = 0;
3555 xt[4].
ref [ tau[0]] = 0; xt[4].
ref [ tau[3]] = 0 ;
3556 xt[4].
ftag[ tau[0]] = 0; xt[4].
ftag[ tau[3]] = 0 ;
3559 pt[5]->
v[tau[0]] = vx[taued[1]] ; pt[5]->
v[tau[1]] = vx[taued[4]] ;
3560 xt[5].
tag[taued[0]] = 0; xt[5].
tag[taued[2]] = ftag[tau[1]];
3561 xt[5].
tag[taued[3]] = ftag[tau[0]]; xt[5].
edg[taued[0]] = 0;
3562 xt[5].
edg[taued[2]] = 0; xt[5].
edg[taued[3]] = 0;
3563 xt[5].
ref [ tau[2]] = 0; xt[5].
ref [ tau[3]] = 0 ;
3564 xt[5].
ftag[ tau[2]] = 0; xt[5].
ftag[ tau[3]] = 0 ;
3569 memset(isxt,0,ne*
sizeof(int8_t));
3570 for (i=0; i<4; i++) {
3571 for (j=0; j<ne; j++) {
3572 if ( (xt[j]).ref[i] || xt[j].ftag[i] ) isxt[j] = 1;
3579 pt[1]->
xt = pt[2]->
xt = pt[3]->
xt = pt[4]->
xt = pt[5]->
xt = 0;
3581 for (i=1; i<6; i++) {
3587 "larger xtetra table",
3589 fprintf(stderr,
" Exit program.\n");
3600 pt[1]->
xt = pt[2]->
xt = pt[3]->
xt = pt[4]->
xt = pt[5]->
xt = 0;
3602 for (i=1; i<6; i++) {
3606 pt[i]->
xt = pt[0]->
xt;
3615 "larger xtetra table",
3617 fprintf(stderr,
" Exit program.\n");
3650 const uint8_t **taued, uint8_t *imin01,uint8_t *imin23) {
3654 tau[0] = 0 ; tau[1] = 1 ; tau[2] = 2 ; tau[3] = 3;
3659 tau[0] = 1 ; tau[1] = 3 ; tau[2] = 2 ; tau[3] = 0;
3664 tau[0] = 1 ; tau[1] = 2 ; tau[2] = 0 ; tau[3] = 3;
3670 (*imin01) = (v[tau[0]] < v[tau[1]]) ? tau[0] : tau[1];
3671 (*imin23) = (v[tau[2]] < v[tau[3]]) ? tau[2] : tau[3];
3689 uint8_t imin01,imin23;
3690 const uint8_t *taued;
3699 tau[0] = 0 ; tau[1] = 1 ; tau[2] = 2 ; tau[3] = 3;
3704 tau[0] = 1 ; tau[1] = 3 ; tau[2] = 2 ; tau[3] = 0;
3709 tau[0] = 1 ; tau[1] = 2 ; tau[2] = 0 ; tau[3] = 3;
3714 imin01 = (pt->
v[tau[0]] < pt->
v[tau[1]]) ? tau[0] : tau[1];
3715 imin23 = (pt->
v[tau[2]] < pt->
v[tau[3]]) ? tau[2] : tau[3];
3720 if ( imin01 == tau[0] ) {
3721 pt0->
v[tau[2]] = vx[taued[3]]; pt0->
v[tau[3]] = vx[taued[4]];
3726 pt0->
v[tau[1]] = vx[taued[4]]; pt0->
v[tau[2]] = vx[taued[3]];
3727 pt0->
v[tau[3]] = vx[taued[2]];
3732 pt0->
v[tau[1]] = vx[taued[3]]; pt0->
v[tau[2]] = vx[taued[1]];
3733 pt0->
v[tau[3]] = vx[taued[2]];
3738 pt0->
v[tau[2]] = vx[taued[1]]; pt0->
v[tau[3]] = vx[taued[2]];
3743 pt0->
v[tau[0]] = vx[taued[1]]; pt0->
v[tau[2]] = vx[taued[3]];
3744 pt0->
v[tau[3]] = vx[taued[2]];
3749 pt0->
v[tau[0]] = vx[taued[2]]; pt0->
v[tau[2]] = vx[taued[3]];
3750 pt0->
v[tau[3]] = vx[taued[4]];
3756 if ( imin23 == tau[2] ) {
3757 pt0->
v[tau[0]] = vx[taued[2]]; pt0->
v[tau[1]] = vx[taued[4]];
3762 pt0->
v[tau[0]] = vx[taued[2]]; pt0->
v[tau[1]] = vx[taued[3]];
3763 pt0->
v[tau[3]] = vx[taued[4]];
3768 pt0->
v[tau[0]] = vx[taued[1]]; pt0->
v[tau[1]] = vx[taued[3]];
3769 pt0->
v[tau[3]] = vx[taued[2]];
3774 pt0->
v[tau[0]] = vx[taued[1]]; pt0->
v[tau[1]] = vx[taued[3]];
3779 pt0->
v[tau[0]] = vx[taued[2]]; pt0->
v[tau[1]] = vx[taued[3]];
3780 pt0->
v[tau[2]] = vx[taued[1]];
3785 pt0->
v[tau[0]] = vx[taued[2]]; pt0->
v[tau[1]] = vx[taued[4]];
3786 pt0->
v[tau[2]] = vx[taued[3]];
3831 int8_t flg,firstxt,isxt[6],i,j;
3833 uint8_t tau[4],imin01,imin23;
3834 const uint8_t *taued;
3860 for (i=0; i<4; i++) {
3861 ftag[i] = (xt[0].
ftag[i] & ~MG_REF);
3865 if ( imin01 == tau[0] ) {
3866 pt[0]->
v[tau[2]] = vx[taued[3]] ; pt[0]->
v[tau[3]] = vx[taued[4]];
3867 xt[0].
tag[taued[1]] = ftag[tau[3]]; xt[0].
tag[taued[5]] = ftag[tau[0]];
3868 xt[0].
tag[taued[2]] = ftag[tau[2]]; xt[0].
edg[taued[1]] = 0;
3869 xt[0].
edg[taued[5]] = 0; xt[0].
edg[taued[2]] = 0;
3870 xt[0].
ref [ tau[1]] = 0;
3871 xt[0].
ftag[ tau[1]] = 0;
3872 MG_SET(xt[0].ori, tau[1]);
3874 pt[1]->
v[tau[1]] = vx[taued[4]] ; pt[1]->
v[tau[2]] = vx[taued[3]] ; pt[1]->
v[tau[3]] = vx[taued[2]];
3875 xt[1].
tag[taued[0]] = ftag[tau[2]]; xt[1].
tag[taued[1]] = ftag[tau[3]];
3876 xt[1].
tag[taued[3]] = ftag[tau[0]]; xt[1].
tag[taued[4]] = ftag[tau[2]];
3877 xt[1].
tag[taued[5]] = 0; xt[1].
edg[taued[0]] = 0;
3878 xt[1].
edg[taued[1]] = 0; xt[1].
edg[taued[3]] = 0;
3879 xt[1].
edg[taued[4]] = 0; xt[1].
edg[taued[5]] = 0;
3880 xt[1].
ref [ tau[0]] = 0; xt[1].
ref [ tau[1]] = 0; xt[1].
ref [tau[3]] = 0;
3881 xt[1].
ftag[ tau[0]] = 0; xt[1].
ftag[ tau[1]] = 0; xt[1].
ftag[tau[3]] = 0;
3884 pt[2]->
v[tau[1]] = vx[taued[3]] ; pt[2]->
v[tau[2]] = vx[taued[1]] ; pt[2]->
v[tau[3]] = vx[taued[2]];
3885 xt[2].
tag[taued[0]] = ftag[tau[3]]; xt[2].
tag[taued[3]] = ftag[tau[3]];
3886 xt[2].
tag[taued[4]] = 0; xt[2].
tag[taued[5]] = ftag[tau[1]];
3887 xt[2].
edg[taued[0]] = 0; xt[2].
edg[taued[3]] = 0;
3888 xt[2].
edg[taued[4]] = 0; xt[2].
edg[taued[5]] = 0;
3889 xt[2].
ref [ tau[0]] = 0; xt[2].
ref [ tau[2]] = 0;
3890 xt[2].
ftag[ tau[0]] = 0; xt[2].
ftag[ tau[2]] = 0;
3894 pt[0]->
v[tau[2]] = vx[taued[1]] ; pt[0]->
v[tau[3]] = vx[taued[2]];
3895 xt[0].
tag[taued[3]] = ftag[tau[3]]; xt[0].
tag[taued[4]] = ftag[tau[2]];
3896 xt[0].
tag[taued[5]] = ftag[tau[1]]; xt[0].
edg[taued[3]] = 0;
3897 xt[0].
edg[taued[4]] = 0; xt[0].
edg[taued[5]] = 0;
3898 xt[0].
ref [ tau[0]] = 0;
3899 xt[0].
ftag[ tau[0]] = 0;
3900 MG_SET(xt[0].ori, tau[0]);
3902 pt[1]->
v[tau[0]] = vx[taued[1]] ; pt[1]->
v[tau[2]] = vx[taued[3]] ; pt[1]->
v[tau[3]] = vx[taued[2]];
3903 xt[1].
tag[taued[0]] = ftag[tau[3]]; xt[1].
tag[taued[1]] = ftag[tau[3]];
3904 xt[1].
tag[taued[2]] = ftag[tau[1]]; xt[1].
tag[taued[4]] = ftag[tau[2]];
3905 xt[1].
tag[taued[5]] = 0; xt[1].
edg[taued[0]] = 0;
3906 xt[1].
edg[taued[1]] = 0; xt[1].
edg[taued[2]] = 0;
3907 xt[1].
edg[taued[4]] = 0; xt[1].
edg[taued[5]] = 0;
3908 xt[1].
ref [ tau[0]] = 0; xt[1].
ref [ tau[1]] = 0; xt[1].
ref [tau[2]] = 0;
3909 xt[1].
ftag[ tau[0]] = 0; xt[1].
ftag[ tau[1]] = 0; xt[1].
ftag[tau[2]] = 0;
3912 pt[2]->
v[tau[0]] = vx[taued[2]] ; pt[2]->
v[tau[2]] = vx[taued[3]] ; pt[2]->
v[tau[3]] = vx[taued[4]];
3913 xt[2].
tag[taued[0]] = ftag[tau[2]]; xt[2].
tag[taued[1]] = 0;
3914 xt[2].
tag[taued[2]] = ftag[tau[2]]; xt[2].
tag[taued[5]] = ftag[tau[0]];
3915 xt[2].
edg[taued[0]] = 0; xt[2].
edg[taued[1]] = 0;
3916 xt[2].
edg[taued[2]] = 0; xt[2].
edg[taued[5]] = 0;
3917 xt[2].
ref [ tau[1]] = 0; xt[2].
ref [ tau[3]] = 0;
3918 xt[2].
ftag[ tau[1]] = 0; xt[2].
ftag[ tau[3]] = 0;
3922 if ( imin23 == tau[2] ) {
3923 pt[3]->
v[tau[0]] = vx[taued[2]] ; pt[3]->
v[tau[1]] = vx[taued[4]];
3924 xt[3].
tag[taued[0]] = ftag[tau[2]]; xt[3].
tag[taued[1]] = ftag[tau[1]];
3925 xt[3].
tag[taued[3]] = ftag[tau[0]]; xt[3].
edg[taued[0]] = 0;
3926 xt[3].
edg[taued[1]] = 0; xt[3].
edg[taued[3]] = 0;
3927 xt[3].
ref [ tau[3]] = 0;
3928 xt[3].
ftag[ tau[3]] = 0;
3929 MG_SET(xt[3].ori, tau[3]);
3931 pt[4]->
v[tau[0]] = vx[taued[2]] ; pt[4]->
v[tau[1]] = vx[taued[3]] ; pt[4]->
v[tau[3]] = vx[taued[4]];
3932 xt[4].
tag[taued[0]] = 0; xt[4].
tag[taued[1]] = ftag[tau[1]];
3933 xt[4].
tag[taued[2]] = ftag[tau[2]]; xt[4].
tag[taued[4]] = ftag[tau[0]];
3934 xt[4].
tag[taued[5]] = ftag[tau[0]]; xt[4].
edg[taued[0]] = 0;
3935 xt[4].
edg[taued[1]] = 0; xt[4].
edg[taued[2]] = 0;
3936 xt[4].
edg[taued[4]] = 0; xt[4].
edg[taued[5]] = 0;
3937 xt[4].
ref [ tau[1]] = 0; xt[4].
ref [ tau[2]] = 0; xt[4].
ref [tau[3]] = 0;
3938 xt[4].
ftag[ tau[1]] = 0; xt[4].
ftag[ tau[2]] = 0; xt[4].
ftag[tau[3]] = 0;
3941 pt[5]->
v[tau[0]] = vx[taued[1]] ; pt[5]->
v[tau[1]] = vx[taued[3]] ; pt[5]->
v[tau[3]] = vx[taued[2]];
3942 xt[5].
tag[taued[0]] = ftag[tau[3]]; xt[5].
tag[taued[2]] = ftag[tau[1]];
3943 xt[5].
tag[taued[4]] = 0; xt[5].
tag[taued[5]] = ftag[tau[1]];
3944 xt[5].
edg[taued[0]] = 0; xt[5].
edg[taued[2]] = 0;
3945 xt[5].
edg[taued[4]] = 0; xt[5].
edg[taued[5]] = 0;
3946 xt[5].
ref [ tau[0]] = 0; xt[5].
ref [ tau[2]] = 0;
3947 xt[5].
ftag[ tau[0]] = 0; xt[5].
ftag[ tau[2]] = 0;
3951 pt[3]->
v[tau[0]] = vx[taued[1]] ; pt[3]->
v[tau[1]] = vx[taued[3]];
3952 xt[3].
tag[taued[0]] = ftag[tau[3]]; xt[3].
tag[taued[2]] = ftag[tau[1]];
3953 xt[3].
tag[taued[4]] = ftag[tau[0]]; xt[3].
edg[taued[0]] = 0;
3954 xt[3].
edg[taued[2]] = 0; xt[3].
edg[taued[4]] = 0;
3955 xt[3].
ref [ tau[2]] = 0;
3956 xt[3].
ftag[ tau[2]] = 0;
3957 MG_SET(xt[3].ori, tau[2]);
3959 pt[4]->
v[tau[0]] = vx[taued[2]] ; pt[4]->
v[tau[1]] = vx[taued[3]] ; pt[4]->
v[tau[2]] = vx[taued[1]];
3960 xt[4].
tag[taued[0]] = 0; xt[4].
tag[taued[1]] = ftag[tau[1]];
3961 xt[4].
tag[taued[3]] = ftag[tau[3]]; xt[4].
tag[taued[4]] = ftag[tau[0]];
3962 xt[4].
tag[taued[5]] = ftag[tau[1]]; xt[4].
edg[taued[0]] = 0;
3963 xt[4].
edg[taued[1]] = 0; xt[4].
edg[taued[3]] = 0;
3964 xt[4].
edg[taued[4]] = 0; xt[4].
edg[taued[5]] = 0;
3965 xt[4].
ref [ tau[0]] = 0; xt[4].
ref [ tau[2]] = 0; xt[4].
ref [tau[3]] = 0;
3966 xt[4].
ftag[ tau[0]] = 0; xt[4].
ftag[ tau[2]] = 0; xt[4].
ftag[tau[3]] = 0;
3969 pt[5]->
v[tau[0]] = vx[taued[2]] ; pt[5]->
v[tau[1]] = vx[taued[4]] ; pt[5]->
v[tau[2]] = vx[taued[3]];
3970 xt[5].
tag[taued[0]] = ftag[tau[2]]; xt[5].
tag[taued[1]] = 0;
3971 xt[5].
tag[taued[3]] = ftag[tau[0]]; xt[5].
tag[taued[5]] = ftag[tau[0]];
3972 xt[5].
edg[taued[0]] = 0; xt[5].
edg[taued[1]] = 0;
3973 xt[5].
edg[taued[3]] = 0; xt[5].
edg[taued[5]] = 0;
3974 xt[5].
ref [ tau[1]] = 0; xt[5].
ref [ tau[3]] = 0;
3975 xt[5].
ftag[ tau[1]] = 0; xt[5].
ftag[ tau[3]] = 0;
3980 memset(isxt,0,ne*
sizeof(int8_t));
3982 for (i=0; i<4; i++) {
3983 for(j=0;j<ne;j++ ) {
3984 if ( (xt[j]).ref[i] || xt[j].ftag[i] ) isxt[j] = 1;
3992 pt[1]->
xt = pt[2]->
xt = pt[3]->
xt = pt[4]->
xt = pt[5]->
xt = 0;
3994 for (i=1; i<6; i++) {
4000 "larger xtetra table",
4002 fprintf(stderr,
" Exit program.\n");
4013 pt[1]->
xt = pt[2]->
xt = pt[3]->
xt = pt[4]->
xt = pt[5]->
xt = 0;
4015 for (i=1; i<6; i++) {
4019 pt[i]->
xt = pt[0]->
xt;
4028 "larger xtetra table",
4030 fprintf(stderr,
" Exit program.\n");
4063 const uint8_t **taued,uint8_t *imin) {
4066 tau[0] = 0 ; tau[1] = 1 ; tau[2] = 2 ; tau[3] = 3;
4071 tau[0] = 2 ; tau[1] = 0 ; tau[2] = 1 ; tau[3] = 3;
4076 tau[0] = 0 ; tau[1] = 3 ; tau[2] = 1 ; tau[3] = 2;
4081 tau[0] = 1 ; tau[1] = 2 ; tau[2] = 0 ; tau[3] = 3;
4086 tau[0] = 3 ; tau[1] = 1 ; tau[2] = 0 ; tau[3] = 2;
4091 tau[0] = 3 ; tau[1] = 2 ; tau[2] = 1 ; tau[3] = 0;
4097 (*imin) = (pt->
v[tau[0]] < pt->
v[tau[1]]) ? tau[0] : tau[1];
4116 const uint8_t *taued=NULL;
4129 pt0->
v[tau[0]] = vx[taued[2]]; pt0->
v[tau[1]] = vx[taued[4]];
4130 pt0->
v[tau[2]] = vx[taued[5]];
4135 pt0->
v[tau[0]] = vx[taued[1]]; pt0->
v[tau[1]] = vx[taued[3]];
4136 pt0->
v[tau[3]] = vx[taued[5]];
4141 pt0->
v[tau[0]] = vx[taued[2]]; pt0->
v[tau[1]] = vx[taued[4]];
4142 pt0->
v[tau[2]] = vx[taued[3]]; pt0->
v[tau[3]] = vx[taued[5]];
4147 pt0->
v[tau[0]] = vx[taued[2]]; pt0->
v[tau[1]] = vx[taued[3]];
4148 pt0->
v[tau[2]] = vx[taued[1]]; pt0->
v[tau[3]] = vx[taued[5]];
4153 if ( imin == tau[0] ) {
4154 pt0->
v[tau[2]] = vx[taued[3]]; pt0->
v[tau[3]] = vx[taued[4]];
4159 pt0->
v[tau[1]] = vx[taued[4]]; pt0->
v[tau[2]] = vx[taued[3]];
4160 pt0->
v[tau[3]] = vx[taued[2]];
4165 pt0->
v[tau[1]] = vx[taued[3]]; pt0->
v[tau[2]] = vx[taued[1]];
4166 pt0->
v[tau[3]] = vx[taued[2]];
4171 pt0->
v[tau[2]] = vx[taued[1]]; pt0->
v[tau[3]] = vx[taued[2]];
4176 pt0->
v[tau[0]] = vx[taued[2]]; pt0->
v[tau[2]] = vx[taued[3]];
4177 pt0->
v[tau[3]] = vx[taued[4]];
4182 pt0->
v[tau[0]] = vx[taued[1]]; pt0->
v[tau[2]] = vx[taued[3]];
4183 pt0->
v[tau[3]] = vx[taued[2]];
4209 int8_t firstxt,isxt[7];
4211 uint8_t tau[4],imin;
4212 const uint8_t *taued=NULL;
4228 for (i=0; i<4; i++) {
4229 ftag[i] = (xt[0].
ftag[i] & ~MG_REF);
4233 pt[0]->
v[tau[0]] = vx[taued[2]] ; pt[0]->
v[tau[1]] = vx[taued[4]] ; pt[0]->
v[tau[2]] = vx[taued[5]];
4234 xt[0].
tag[taued[0]] = ftag[tau[2]]; xt[0].
tag[taued[1]] = ftag[tau[1]];
4235 xt[0].
tag[taued[3]] = ftag[tau[0]]; xt[0].
edg[taued[0]] = 0;
4236 xt[0].
edg[taued[1]] = 0; xt[0].
edg[taued[3]] = 0;
4237 xt[0].
ref [ tau[3]] = 0;
4238 xt[0].
ftag[ tau[3]] = 0;
4239 MG_SET(xt[0].ori, tau[3]);
4241 pt[1]->
v[tau[0]] = vx[taued[1]] ; pt[1]->
v[tau[1]] = vx[taued[3]] ; pt[1]->
v[tau[3]] = vx[taued[5]];
4242 xt[1].
tag[taued[0]] = ftag[tau[3]]; xt[1].
tag[taued[2]] = ftag[tau[1]];
4243 xt[1].
tag[taued[4]] = ftag[tau[0]]; xt[1].
edg[taued[0]] = 0;
4244 xt[1].
edg[taued[2]] = 0; xt[1].
edg[taued[4]] = 0;
4245 xt[1].
ref [ tau[2]] = 0;
4246 xt[1].
ftag[ tau[2]] = 0;
4247 MG_SET(xt[1].ori, tau[2]);
4249 pt[2]->
v[tau[0]] = vx[taued[2]] ; pt[2]->
v[tau[1]] = vx[taued[4]];
4250 pt[2]->
v[tau[2]] = vx[taued[3]] ; pt[2]->
v[tau[3]] = vx[taued[5]];
4251 xt[2].
tag[taued[0]] = ftag[tau[2]]; xt[2].
tag[taued[1]] = 0;
4252 xt[2].
tag[taued[2]] = ftag[tau[1]]; xt[2].
tag[taued[3]] = ftag[tau[0]];
4253 xt[2].
tag[taued[4]] = ftag[tau[0]]; xt[2].
tag[taued[5]] = ftag[tau[0]];
4254 xt[2].
edg[taued[0]] = 0; xt[2].
edg[taued[1]] = 0;
4255 xt[2].
edg[taued[2]] = 0; xt[2].
edg[taued[3]] = 0;
4256 xt[2].
edg[taued[4]] = 0; xt[2].
edg[taued[5]] = 0;
4257 xt[2].
ref [tau[1]] = 0 ; xt[2].
ref [ tau[2]] = 0; xt[2].
ref [tau[3]] = 0 ;
4258 xt[2].
ftag[tau[1]] = 0 ; xt[2].
ftag[ tau[2]] = 0; xt[2].
ftag[tau[3]] = 0 ;
4261 pt[3]->
v[tau[0]] = vx[taued[2]] ; pt[3]->
v[tau[1]] = vx[taued[3]];
4262 pt[3]->
v[tau[2]] = vx[taued[1]] ; pt[3]->
v[tau[3]] = vx[taued[5]];
4263 xt[3].
tag[taued[0]] = 0; xt[3].
tag[taued[1]] = ftag[tau[1]];
4264 xt[3].
tag[taued[2]] = ftag[tau[1]]; xt[3].
tag[taued[3]] = ftag[tau[3]];
4265 xt[3].
tag[taued[4]] = ftag[tau[0]]; xt[3].
tag[taued[5]] = ftag[tau[1]];
4266 xt[3].
edg[taued[0]] = 0; xt[3].
edg[taued[1]] = 0;
4267 xt[3].
edg[taued[2]] = 0; xt[3].
edg[taued[3]] = 0;
4268 xt[3].
edg[taued[4]] = 0; xt[3].
edg[taued[5]] = 0;
4269 xt[3].
ref [ tau[0]] = 0; xt[3].
ref [ tau[2]] = 0; xt[3].
ref [tau[3]] = 0 ;
4270 xt[3].
ftag[ tau[0]] = 0; xt[3].
ftag[ tau[2]] = 0; xt[3].
ftag[tau[3]] = 0 ;
4273 if ( imin == tau[0] ) {
4274 pt[4]->
v[tau[2]] = vx[taued[3]] ; pt[4]->
v[tau[3]] = vx[taued[4]];
4275 xt[4].
tag[taued[1]] = ftag[tau[3]]; xt[4].
tag[taued[2]] = ftag[tau[2]];
4276 xt[4].
tag[taued[5]] = ftag[tau[0]]; xt[4].
edg[taued[1]] = 0;
4277 xt[4].
edg[taued[2]] = 0; xt[4].
edg[taued[5]] = 0;
4278 xt[4].
ref [ tau[1]] = 0;
4279 xt[4].
ftag[ tau[1]] = 0;
4280 MG_SET(xt[4].ori, tau[1]);
4282 pt[5]->
v[tau[1]] = vx[taued[4]] ; pt[5]->
v[tau[2]] = vx[taued[3]]; pt[5]->
v[tau[3]] = vx[taued[2]];
4283 xt[5].
tag[taued[0]] = ftag[tau[2]];
4284 xt[5].
tag[taued[1]] = ftag[tau[3]]; xt[5].
tag[taued[3]] = ftag[tau[0]];
4285 xt[5].
tag[taued[4]] = ftag[tau[2]]; xt[5].
tag[taued[5]] = 0;
4286 xt[5].
edg[taued[0]] = 0;
4287 xt[5].
edg[taued[1]] = 0; xt[5].
edg[taued[3]] = 0;
4288 xt[5].
edg[taued[4]] = 0; xt[5].
edg[taued[5]] = 0;
4289 xt[5].
ref [ tau[0]] = 0; xt[5].
ref [ tau[1]] = 0; xt[5].
ref [tau[3]] = 0 ;
4290 xt[5].
ftag[ tau[0]] = 0; xt[5].
ftag[ tau[1]] = 0; xt[5].
ftag[tau[3]] = 0 ;
4293 pt[6]->
v[tau[1]] = vx[taued[3]] ; pt[6]->
v[tau[2]] = vx[taued[1]]; pt[6]->
v[tau[3]] = vx[taued[2]];
4294 xt[6].
tag[taued[0]] = ftag[tau[3]];
4295 xt[6].
tag[taued[3]] = ftag[tau[3]]; xt[6].
tag[taued[4]] = 0;
4296 xt[6].
tag[taued[5]] = ftag[tau[1]]; xt[6].
edg[taued[0]] = 0;
4297 xt[6].
edg[taued[3]] = 0;
4298 xt[6].
edg[taued[4]] = 0; xt[6].
edg[taued[5]] = 0;
4299 xt[6].
ref [ tau[0]] = 0; xt[6].
ref [ tau[2]] = 0;
4300 xt[6].
ftag[ tau[0]] = 0; xt[6].
ftag[ tau[2]] = 0;
4305 pt[4]->
v[tau[2]] = vx[taued[1]] ; pt[4]->
v[tau[3]] = vx[taued[2]];
4306 xt[4].
tag[taued[3]] = ftag[tau[3]]; xt[4].
tag[taued[4]] = ftag[tau[2]];
4307 xt[4].
tag[taued[5]] = ftag[tau[1]]; xt[4].
edg[taued[3]] = 0;
4308 xt[4].
edg[taued[4]] = 0; xt[4].
edg[taued[5]] = 0;
4309 xt[4].
ref [ tau[0]] = 0;
4310 xt[4].
ftag[ tau[0]] = 0;
4311 MG_SET(xt[4].ori, tau[0]);
4313 pt[5]->
v[tau[0]] = vx[taued[2]] ; pt[5]->
v[tau[2]] = vx[taued[3]]; pt[5]->
v[tau[3]] = vx[taued[4]];
4314 xt[5].
tag[taued[0]] = ftag[tau[2]]; xt[5].
tag[taued[1]] = 0;
4315 xt[5].
tag[taued[2]] = ftag[tau[2]]; xt[5].
tag[taued[5]] = ftag[tau[0]];
4316 xt[5].
edg[taued[0]] = 0; xt[5].
edg[taued[1]] = 0;
4317 xt[5].
edg[taued[2]] = 0; xt[5].
edg[taued[5]] = 0;
4318 xt[5].
ref [ tau[1]] = 0; xt[5].
ref [ tau[3]] = 0;
4319 xt[5].
ftag[ tau[1]] = 0; xt[5].
ftag[ tau[3]] = 0;
4322 pt[6]->
v[tau[0]] = vx[taued[1]] ; pt[6]->
v[tau[2]] = vx[taued[3]]; pt[6]->
v[tau[3]] = vx[taued[2]];
4323 xt[6].
tag[taued[0]] = ftag[tau[3]]; xt[6].
tag[taued[1]] = ftag[tau[3]];
4324 xt[6].
tag[taued[2]] = ftag[tau[1]]; xt[6].
tag[taued[4]] = ftag[tau[2]];
4325 xt[6].
tag[taued[5]] = 0; xt[6].
edg[taued[0]] = 0;
4326 xt[6].
edg[taued[1]] = 0; xt[6].
edg[taued[2]] = 0;
4327 xt[6].
edg[taued[4]] = 0; xt[6].
edg[taued[5]] = 0;
4328 xt[6].
ref [ tau[0]] = 0; xt[6].
ref [ tau[1]] = 0; xt[6].
ref [tau[2]] = 0 ;
4329 xt[6].
ftag[ tau[0]] = 0; xt[6].
ftag[ tau[1]] = 0; xt[6].
ftag[tau[2]] = 0 ;
4334 memset(isxt,0,ne*
sizeof(int8_t));
4336 for (i=0; i<4; i++) {
4337 for (j=0; j<ne; j++) {
4338 if ( (xt[j]).ref[i] || xt[j].ftag[i] ) isxt[j] = 1;
4345 pt[1]->
xt = pt[2]->
xt = pt[3]->
xt = pt[4]->
xt = pt[5]->
xt = pt[6]->
xt = 0;
4347 for (i=1; i<7; i++) {
4353 "larger xtetra table",
4355 fprintf(stderr,
" Exit program.\n");
4366 pt[1]->
xt = pt[2]->
xt = pt[3]->
xt = pt[4]->
xt = pt[5]->
xt = pt[6]->
xt = 0;
4368 for (i=1; i<7; i++) {
4372 pt[i]->
xt = pt[0]->
xt;
4381 "larger xtetra table",
4383 fprintf(stderr,
" Exit program.\n");
4425 pt0->
v[0] = pt->
v[0]; pt0->
v[1] = vx[0]; pt0->
v[2] = vx[1]; pt0->
v[3] = vx[2];
4430 pt0->
v[0] = vx[0]; pt0->
v[1] = pt->
v[1]; pt0->
v[2] = vx[3]; pt0->
v[3] = vx[4];
4435 pt0->
v[0] = vx[1]; pt0->
v[1] = vx[3]; pt0->
v[2] = pt->
v[2]; pt0->
v[3] = vx[5];
4440 pt0->
v[0] = vx[2]; pt0->
v[1] = vx[4]; pt0->
v[2] = vx[5]; pt0->
v[3] = pt->
v[3];
4445 pt0->
v[0] = vx[0]; pt0->
v[1] = vx[3]; pt0->
v[2] = vx[1];
4451 pt0->
v[0] = vx[2]; pt0->
v[1] = vx[0]; pt0->
v[2] = vx[3];
4457 pt0->
v[0] = vx[2]; pt0->
v[1] = vx[3]; pt0->
v[2] = vx[1];
4463 pt0->
v[0] = vx[2]; pt0->
v[1] = vx[3]; pt0->
v[2] = vx[5];
4488 MMG5_int iel,newtet[8],nxt0;
4502 for (i=1; i<ne; i++) {
4506 fprintf(stderr,
"\n ## Error: %s: unable to allocate"
4507 " a new element.\n",__func__);
4509 fprintf(stderr,
" Exit program.\n");
4511 for ( j=0; j<i; j++ )
4515 pt[i] = memcpy(pt[i],pt[0],
sizeof(
MMG5_Tetra));
4520 for (i=0; i<4; i++) {
4521 ftag[i] = (xt.
ftag[i] & ~MG_REF);
4525 pt[0]->
v[1] = vx[0] ; pt[0]->
v[2] = vx[1]; pt[0]->
v[3] = vx[2];
4528 xt.
tag[3] = ftag[3]; xt.
tag[4] = ftag[2];
4529 xt.
tag[5] = ftag[1]; xt.
edg[3] = 0;
4530 xt.
edg[4] = 0; xt.
edg[5] = 0;
4534 if ( (xt.
ref[i]) || xt.
ftag[i] ) isxt0 = 1;
4546 pt[1]->
v[0] = vx[0] ; pt[1]->
v[2] = vx[3]; pt[1]->
v[3] = vx[4];
4550 xt.
tag[1] = ftag[3]; xt.
tag[2] = ftag[2];
4551 xt.
tag[5] = ftag[0]; xt.
edg[1] = 0;
4552 xt.
edg[2] = 0; xt.
edg[5] = 0;
4557 for (i=0; i<4; i++) {
4558 if ( (xt.
ref[i]) || xt.
ftag[i]) isxt = 1;
4574 "larger xtetra table",
4576 fprintf(stderr,
" Exit program.\n");
4587 pt[2]->
v[0] = vx[1] ; pt[2]->
v[1] = vx[3]; pt[2]->
v[3] = vx[5];
4591 xt.
tag[0] = ftag[3]; xt.
tag[2] = ftag[1];
4592 xt.
tag[4] = ftag[0]; xt.
edg[0] = 0;
4593 xt.
edg[2] = 0; xt.
edg[4] = 0;
4597 for (i=0; i<4;i++) {
4598 if ( (xt.
ref[i]) || xt.
ftag[i]) isxt = 1;
4614 "larger xtetra table",
4616 fprintf(stderr,
" Exit program.\n");
4627 pt[3]->
v[0] = vx[2] ; pt[3]->
v[1] = vx[4]; pt[3]->
v[2] = vx[5];
4631 xt.
tag[0] = ftag[2]; xt.
tag[1] = ftag[1];
4632 xt.
tag[3] = ftag[0]; xt.
edg[0] = 0;
4633 xt.
edg[1] = 0; xt.
edg[3] = 0;
4638 for (i=0; i<4; i++) {
4639 if ( (xt.
ref[i]) || xt.
ftag[i]) isxt = 1;
4655 "larger xtetra table",
4657 fprintf(stderr,
" Exit program.\n");
4668 pt[4]->
v[0] = vx[0] ; pt[4]->
v[1] = vx[3]; pt[4]->
v[2] = vx[1] ; pt[4]->
v[3] = vx[2];
4672 xt.
tag[0] = ftag[3]; xt.
tag[1] = ftag[3];
4673 xt.
tag[2] = ftag[2]; xt.
tag[3] = ftag[3];
4674 xt.
edg[0] = 0; xt.
edg[1] = 0;
4675 xt.
edg[2] = 0; xt.
edg[3] = 0;
4676 xt.
tag[4] = 0; xt.
edg[4] = 0;
4677 xt.
tag[5] = ftag[1]; xt.
edg[5] = 0;
4678 xt.
ref [0] = 0 ; xt.
ref [1] = 0 ; xt.
ref [2] = 0;
4684 if ( (xt.
ref[3]) || xt.
ftag[3]) isxt = 1;
4699 "larger xtetra table",
4701 fprintf(stderr,
" Exit program.\n");
4712 pt[5]->
v[0] = vx[2] ; pt[5]->
v[1] = vx[0]; pt[5]->
v[2] = vx[3] ; pt[5]->
v[3] = vx[4];
4716 xt.
tag[0] = ftag[2]; xt.
tag[1] = 0;
4717 xt.
tag[2] = ftag[2]; xt.
tag[3] = ftag[3];
4718 xt.
tag[4] = ftag[2]; xt.
tag[5] = ftag[0];
4719 xt.
edg[0] = 0; xt.
edg[1] = 0;
4720 xt.
edg[2] = 0; xt.
edg[3] = 0;
4721 xt.
edg[4] = 0; xt.
edg[5] = 0;
4722 xt.
ref [0] = 0 ; xt.
ref [1] = 0 ; xt.
ref [3] = 0;
4728 if ( (xt.
ref[2]) || xt.
ftag[2]) isxt = 1;
4743 "larger xtetra table",
4745 fprintf(stderr,
" Exit program.\n");
4756 pt[6]->
v[0] = vx[2] ; pt[6]->
v[1] = vx[3]; pt[6]->
v[2] = vx[1] ; pt[6]->
v[3] = vx[5];
4760 xt.
tag[0] = 0; xt.
edg[0] = 0;
4761 xt.
tag[1] = ftag[1]; xt.
tag[2] = ftag[1];
4762 xt.
tag[3] = ftag[3]; xt.
tag[4] = ftag[0];
4763 xt.
edg[1] = 0; xt.
edg[2] = 0;
4764 xt.
edg[3] = 0; xt.
edg[4] = 0;
4765 xt.
tag[5] = ftag[3]; xt.
edg[5] = 0;
4766 xt.
ref [0] = 0 ; xt.
ref [2] = 0 ; xt.
ref [3] = 0;
4772 if ( (xt.
ref[1]) || xt.
ftag[1]) isxt = 1;
4787 "larger xtetra table",
4789 fprintf(stderr,
" Exit program.\n");
4800 pt[7]->
v[0] = vx[2] ; pt[7]->
v[1] = vx[3]; pt[7]->
v[2] = vx[5] ; pt[7]->
v[3] = vx[4];
4804 xt.
tag[0] = 0; xt.
tag[1] = ftag[1];
4805 xt.
tag[2] = ftag[2]; xt.
tag[3] = ftag[0];
4806 xt.
tag[4] = ftag[0]; xt.
tag[5] = ftag[0];
4807 xt.
edg[0] = 0; xt.
edg[1] = 0;
4808 xt.
edg[2] = 0; xt.
edg[3] = 0;
4809 xt.
edg[4] = 0; xt.
edg[5] = 0;
4810 xt.
ref [1] = 0 ; xt.
ref [2] = 0 ; xt.
ref [3] = 0;
4816 if ( (xt.
ref[0]) || xt.
ftag[0]) isxt = 1;
4830 "larger xtetra table",
4832 fprintf(stderr,
" Exit program.\n");
4863 int64_t* list,
int ret,
double crit) {
4871 for (l=0; l<lon; l++) {
4874 if(pt1->
qual < critloc) critloc = pt1->
qual;
4879 for (l=0; l<lon; l++) {
4884 memcpy(pt0->
v,pt1->
v,4*
sizeof(MMG5_int));
4887 cal = MMG5_caltet(
mesh,met,pt0);
4888 if ( cal < critloc ) {
4893 memcpy(pt0->
v,pt1->
v,4*
sizeof(MMG5_int));
4896 cal = MMG5_caltet(
mesh,met,pt0);
4897 if ( cal < critloc ) {
4923 MMG5_int src,i0,i1,ip;
4931 if ( (!lon || lon<0) )
4947 tag = pxt->
tag[iar];
4962 o[0] = 0.5*(p0->
c[0] + p1->
c[0]);
4963 o[1] = 0.5*(p0->
c[1] + p1->
c[1]);
4964 o[2] = 0.5*(p0->
c[2] + p1->
c[2]);
4983 fprintf(stderr,
"\n ## Warning: %s:",__func__);
4984 fprintf(stderr,
" unable to allocate a new point in last call"
4985 " of MMG5_adpspl.\n");
4989 ier = MMG5_intmet(
mesh,met,iel,iar,ip,0.5);
4994 else if (
ier < 0 ) {
5001 if (
ier <= 0 ||
ier == 2 )
return 0;
5007 fprintf(stderr,
"\n ## Error: %s: unable to split.\n",__func__);
int MMG3D_chk4ridVertices(MMG5_pMesh mesh, MMG5_pTetra pt)
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)
static double MMG5_caltet_iso(MMG5_pMesh mesh, MMG5_pSol met, MMG5_pTetra pt)
static double MMG5_lenedg33_ani(MMG5_pMesh mesh, MMG5_pSol met, int ia, MMG5_pTetra pt)
static double MMG5_lenedgspl33_ani(MMG5_pMesh mesh, MMG5_pSol met, int ia, MMG5_pTetra pt)
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])
API headers and documentation for the mmg3d library, for volumetric meshes in 3D.
MMG5_int MMG3D_newElt(MMG5_pMesh mesh)
static const uint8_t MMG5_isar[6][2]
isar[i][]: vertices of extremities of the edge opposite to the ith edge
void MMG3D_delPt(MMG5_pMesh mesh, MMG5_int ip)
static const uint8_t MMG5_permedge[12][6]
MMG5_int MMG3D_newPt(MMG5_pMesh mesh, double c[3], uint16_t tag, MMG5_int src)
static const int8_t MMG5_iarfinv[4][6]
num of the j^th edge in the i^th face
int MMG3D_delElt(MMG5_pMesh mesh, MMG5_int iel)
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)
static const uint8_t MMG5_iare[6][2]
vertices of extremities of the edges of the tetra
static const uint8_t MMG5_ifar[6][2]
ifar[i][]: faces sharing the ith edge of the tetra
#define MMG3D_POINT_REALLOC(mesh, sol, ip, wantedGap, law, o, tag, src)
void MMG5_tet2tri(MMG5_pMesh mesh, MMG5_int k, int8_t ie, MMG5_Tria *ptt)
#define MMG3D_TETRA_REALLOC(mesh, jel, wantedGap, law)
static const uint8_t MMG5_idir[4][3]
idir[i]: vertices of face opposite to vertex i
#define MMG5_INCREASE_MEM_MESSAGE()
static const uint8_t MMG5_iprv2[3]
#define MMG5_TAB_RECALLOC(mesh, ptr, initSize, wantedGap, type, message, law)
#define MG_GEO_OR_NOM(tag)
static const uint8_t MMG5_inxt2[6]
int MMG5_devangle(double *n1, double *n2, double crit)
int MMG5_nortri(MMG5_pMesh mesh, MMG5_pTria pt, double *n)
double MMG5_orvol(MMG5_pPoint point, MMG5_int *v)
#define MG_SET(flag, bit)
void MMG3D_split4op_cfg(MMG5_int flag, MMG5_int v[4], uint8_t tau[4], const uint8_t **taued, uint8_t *imin01, uint8_t *imin23)
static int MMG3D_crea_newTetra(MMG5_pMesh mesh, const int ne, MMG5_int *newtet, MMG5_pTetra *pt, MMG5_xTetra *xt, MMG5_pxTetra *pxt0)
int MMG3D_split6_sim(MMG5_pMesh mesh, MMG5_pSol met, MMG5_int k, MMG5_int vx[6])
MMG5_int MMG5_splitedg(MMG5_pMesh mesh, MMG5_pSol met, MMG5_int iel, int iar, double crit)
int MMG3D_split3_sim(MMG5_pMesh mesh, MMG5_pSol met, MMG5_int k, MMG5_int vx[6])
int MMG5_split2sf_globNum(MMG5_pMesh mesh, MMG5_pSol met, MMG5_int k, MMG5_int vx[6], MMG5_int vGlobNum[4], int8_t metRidTyp)
int MMG3D_split3cone_sim(MMG5_pMesh mesh, MMG5_pSol met, MMG5_int k, MMG5_int vx[6])
int MMG5_split6(MMG5_pMesh mesh, MMG5_pSol met, MMG5_int k, MMG5_int vx[6], int8_t metRidTyp)
int MMG5_split4op(MMG5_pMesh mesh, MMG5_pSol met, MMG5_int k, MMG5_int vx[6], int8_t metRidTyp)
int MMG3D_simbulgept(MMG5_pMesh mesh, MMG5_pSol met, int64_t *list, int ret, MMG5_int ip)
void MMG3D_split3cone_cfg(MMG5_int flag, MMG5_int v[4], uint8_t tau[4], const uint8_t **taued, uint8_t *ia, uint8_t *ib)
static int MMG3D_chksplit(MMG5_pMesh mesh, MMG5_pSol met, MMG5_int ip, int64_t *list, int ret, double crit)
int MMG5_split1(MMG5_pMesh mesh, MMG5_pSol met, MMG5_int k, MMG5_int vx[6], int8_t metRidTyp)
static int MMG3D_normalDeviation(MMG5_pMesh mesh, MMG5_int start, int8_t iface, int8_t ia, MMG5_int idx, MMG5_int ip, double n0[3])
int MMG3D_normalAdjaTri(MMG5_pMesh mesh, MMG5_int start, int8_t iface, int ia, double n[3])
int MMG3D_split2sf_sim(MMG5_pMesh mesh, MMG5_pSol met, MMG5_int k, MMG5_int vx[6])
int MMG3D_split4op_sim(MMG5_pMesh mesh, MMG5_pSol met, MMG5_int k, MMG5_int vx[6])
static void MMG3D_split3op_cfg(MMG5_pTetra pt, MMG5_int vx[6], uint8_t tau[4], const uint8_t **taued, uint8_t sym[4], uint8_t symed[6], uint8_t *ip0, uint8_t *ip1, uint8_t *ip2, uint8_t *ip3, uint8_t *ie0, uint8_t *ie1, uint8_t *ie2, uint8_t *ie3, uint8_t *ie4, uint8_t *ie5, uint8_t *imin03, uint8_t *imin12)
int MMG5_split2(MMG5_pMesh mesh, MMG5_pSol met, MMG5_int k, MMG5_int vx[6], int8_t metRidTyp)
int MMG5_split4op_globNum(MMG5_pMesh mesh, MMG5_pSol met, MMG5_int k, MMG5_int vx[6], MMG5_int vGlobNum[4], int8_t metRidTyp)
MMG5_int MMG5_split4bar(MMG5_pMesh mesh, MMG5_pSol met, MMG5_int k, int8_t metRidTyp)
int MMG3D_split1_sim(MMG5_pMesh mesh, MMG5_pSol met, MMG5_int k, MMG5_int vx[6])
int MMG5_split1b(MMG5_pMesh mesh, MMG5_pSol met, int64_t *list, int ret, MMG5_int ip, int cas, int8_t metRidTyp, int8_t chkRidTet)
static void MMG3D_split4sf_cfg(MMG5_pTetra pt, MMG5_int vx[6], uint8_t tau[4], const uint8_t **taued, uint8_t *imin23, uint8_t *imin12)
int MMG5_split2sf(MMG5_pMesh mesh, MMG5_pSol met, MMG5_int k, MMG5_int vx[6], int8_t metRidTyp)
void MMG3D_split1_cfg(MMG5_int flag, uint8_t *tau, const uint8_t **taued)
static void MMG3D_split5_cfg(MMG5_pTetra pt, MMG5_int vx[6], uint8_t tau[4], const uint8_t **taued, uint8_t *imin)
int MMG3D_split4sf_sim(MMG5_pMesh mesh, MMG5_pSol met, MMG5_int k, MMG5_int vx[6])
static void MMG3D_update_qual(MMG5_pMesh mesh, MMG5_pSol met, const int ne, MMG5_int *newtet, MMG5_pTetra *pt, int8_t metRidTyp)
void MMG3D_split2sf_cfg(MMG5_int flag, MMG5_int v[4], uint8_t *tau, const uint8_t **taued, uint8_t *imin)
int MMG3D_split5_sim(MMG5_pMesh mesh, MMG5_pSol met, MMG5_int k, MMG5_int vx[6])
int MMG5_split5(MMG5_pMesh mesh, MMG5_pSol met, MMG5_int k, MMG5_int vx[6], int8_t metRidTyp)
int MMG5_split3op(MMG5_pMesh mesh, MMG5_pSol met, MMG5_int k, MMG5_int vx[6], int8_t metRidTyp)
static int MMG5_split1b_eltspl(MMG5_pMesh mesh, MMG5_int ip, MMG5_int k, int64_t *list, MMG5_int *newtet, uint8_t tau[4])
int MMG3D_split3op_sim(MMG5_pMesh mesh, MMG5_pSol met, MMG5_int k, MMG5_int vx[6])
int MMG5_split3cone(MMG5_pMesh mesh, MMG5_pSol met, MMG5_int k, MMG5_int vx[6], int8_t metRidTyp)
int MMG5_split3(MMG5_pMesh mesh, MMG5_pSol met, MMG5_int k, MMG5_int vx[6], int8_t metRidTyp)
int MMG3D_split2_sim(MMG5_pMesh mesh, MMG5_pSol met, MMG5_int k, MMG5_int vx[6])
int MMG5_split3cone_globNum(MMG5_pMesh mesh, MMG5_pSol met, MMG5_int k, MMG5_int vx[6], MMG5_int vGlobNum[4], int8_t metRidTyp)
int MMG5_split4sf(MMG5_pMesh mesh, MMG5_pSol met, MMG5_int k, MMG5_int vx[6], int8_t metRidTyp)
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 additional information for the surface tetrahedra of an MMG mesh.