59 int64_t *list,
int ilist,
int improve) {
76 for (k=0; k<ilist; k++) {
86 ppt0->
c[0] += 0.25 * vol*(p0->
c[0] + p1->
c[0] + p2->
c[0] + p3->
c[0]);
87 ppt0->
c[1] += 0.25 * vol*(p0->
c[1] + p1->
c[1] + p2->
c[1] + p3->
c[1]);
88 ppt0->
c[2] += 0.25 * vol*(p0->
c[2] + p1->
c[2] + p2->
c[2] + p3->
c[2]);
95 totvol = 1.0 / totvol;
104 for (k=0; k<ilist; k++) {
114 calnew =
MG_MIN(calnew,callist[k]);
117 for ( iloc = 0; iloc < 3; ++iloc ) {
120 if ( (len1 < MMG3D_LOPTL && len2 >=
MMG3D_LOPTL) ||
133 if (calold <
MMG5_EPSOK && calnew <= calold) {
139 else if ( improve && calnew < 1.02 * calold ) {
142 else if ( calnew < 0.3 * calold ) {
152 p0->
c[0] = ppt0->
c[0];
153 p0->
c[1] = ppt0->
c[1];
154 p0->
c[2] = ppt0->
c[2];
155 for (k=0; k<ilist; k++) {
156 (&
mesh->
tetra[list[k]/4])->qual=callist[k];
186 MMG5_int *list,
int ilist,
int improve) {
191 double x21,y21,z21,x31,y31,z31,nx,ny,nz,bary[3],dd,len;
192 double u10[3],u20[3],u30[3],oldc[3],coe;
193 int k,ifac,iter,maxtou;
204 for (k=0; k<ilist; k++) {
211 memcpy(oldc,p0->
c,3*
sizeof(
double));
221 x21 = p2->
c[0]-p1->
c[0];
222 y21 = p2->
c[1]-p1->
c[1];
223 z21 = p2->
c[2]-p1->
c[2];
225 x31 = p3->
c[0]-p1->
c[0];
226 y31 = p3->
c[1]-p1->
c[1];
227 z31 = p3->
c[2]-p1->
c[2];
229 nx = (y31*z21 - z31*y21);
230 ny = (z31*x21 - x31*z21);
231 nz = (x31*y21 - y31*x21);
233 dd = sqrt(nx*nx+ny*ny+nz*nz);
234 assert ( dd > 0. &&
"degenerated element");
240 u10[0] = p1->
c[0]-p0->
c[0];
241 u10[1] = p1->
c[1]-p0->
c[1];
242 u10[2] = p1->
c[2]-p0->
c[2];
244 u20[0] = p2->
c[0]-p0->
c[0];
245 u20[1] = p2->
c[1]-p0->
c[1];
246 u20[2] = p2->
c[2]-p0->
c[2];
248 u30[0] = p3->
c[0]-p0->
c[0];
249 u30[1] = p3->
c[1]-p0->
c[1];
250 u30[2] = p3->
c[2]-p0->
c[2];
252 assert ( met->
m[pt->
v[
MMG5_idir[ifac][0]]] > 0. &&
"null metric at vertex 0" );
253 assert ( met->
m[pt->
v[
MMG5_idir[ifac][1]]] > 0. &&
"null metric at vertex 1" );
254 assert ( met->
m[pt->
v[
MMG5_idir[ifac][2]]] > 0. &&
"null metric at vertex 2" );
256 len = sqrt(u10[0]*u10[0]+u10[1]*u10[1]+u10[2]*u10[2])/met->
m[pt->
v[
MMG5_idir[ifac][0]]]
257 + sqrt(u20[0]*u20[0]+u20[1]*u20[1]+u20[2]*u20[2])/met->
m[pt->
v[
MMG5_idir[ifac][1]]]
258 + sqrt(u30[0]*u30[0]+u30[1]*u30[1]+u30[2]*u30[2])/met->
m[pt->
v[
MMG5_idir[ifac][2]]];
262 assert ( len>0. &&
"degenerated element" );
267 bary[0] = (p1->
c[0]+p2->
c[0]+p3->
c[0])/3.;
268 bary[1] = (p1->
c[1]+p2->
c[1]+p3->
c[1])/3.;
269 bary[2] = (p1->
c[2]+p2->
c[2]+p3->
c[2])/3.;
273 ppt0->
c[0] += vol* ( bary[0] + nx * len );
274 ppt0->
c[1] += vol* ( bary[1] + ny * len );
275 ppt0->
c[2] += vol* ( bary[2] + nz * len );
282 ppt0->
c[0] *= 1./(double) ilist;
283 ppt0->
c[1] *= 1./(double) ilist;
284 ppt0->
c[2] *= 1./(double) ilist;
290 p0->
c[0] = (1. - coe) *oldc[0] + coe * ppt0->
c[0];
291 p0->
c[1] = (1. - coe) *oldc[1] + coe * ppt0->
c[1];
292 p0->
c[2] = (1. - coe) *oldc[2] + coe * ppt0->
c[2];
296 for (k=0; k<ilist; k++) {
300 callist[k] = MMG5_caltet(
mesh,met,pt0);
301 if (calold <
MMG5_EPSOK && callist[k] <= calold) {
305 }
else if( callist[k] < 0.1) {
306 if (callist[k] < 1.01*calold)
break;
308 if (callist[k] < 1.02*calold)
break;
310 calnew =
MG_MIN(calnew,callist[k]);
317 }
while(++iter <= maxtou );
319 if ( iter > maxtou ) {
320 memcpy(p0->
c,oldc,3*
sizeof(
double));
328 for (k=0; k<ilist; k++) {
329 (&
mesh->
tetra[list[k]/4])->qual=callist[k];
351 double r[3][3],
double *lispoi) {
354 double ux,uy,uz,det2d;
355 MMG5_int k,na,nb,ntempa,ntempb;
360 iface = lists[0] % 4;
365 for (i=0; i<3; i++) {
374 for (l=1; l<ilists; l++) {
376 iface = lists[l] % 4;
379 for (i=0; i<3; i++) {
389 else if ( ntempa == nb )
391 else if ( ntempb == na )
394 assert(ntempb == nb);
397 ux = p1->
c[0] - p0->
c[0];
398 uy = p1->
c[1] - p0->
c[1];
399 uz = p1->
c[2] - p0->
c[2];
401 lispoi[3*l+1] = r[0][0]*ux + r[0][1]*uy + r[0][2]*uz;
402 lispoi[3*l+2] = r[1][0]*ux + r[1][1]*uy + r[1][2]*uz;
403 lispoi[3*l+3] = r[2][0]*ux + r[2][1]*uy + r[2][2]*uz;
411 iface = lists[0] % 4;
414 for (i=0; i<3; i++) {
424 else if ( ntempa == nb )
426 else if ( ntempb == na )
429 assert(ntempb == nb);
433 ux = p1->
c[0] - p0->
c[0];
434 uy = p1->
c[1] - p0->
c[1];
435 uz = p1->
c[2] - p0->
c[2];
437 lispoi[1] = r[0][0]*ux + r[0][1]*uy + r[0][2]*uz;
438 lispoi[2] = r[1][0]*ux + r[1][1]*uy + r[1][2]*uz;
439 lispoi[3] = r[2][0]*ux + r[2][1]*uy + r[2][2]*uz;
442 lispoi[3*ilists+1] = lispoi[1];
443 lispoi[3*ilists+2] = lispoi[2];
444 lispoi[3*ilists+3] = lispoi[3];
450 for (k=0; k<ilists-1; k++) {
451 det2d = lispoi[3*k+1]*lispoi[3*(k+1)+2] - lispoi[3*k+2]*lispoi[3*(k+1)+1];
456 det2d = lispoi[3*(ilists-1)+1]*lispoi[3*0+2] - lispoi[3*(ilists-1)+2]*lispoi[3*0+1];
484 const MMG5_int ip0,
double n[3],
double lambda[3],
double o[3],
492 double uv[2],to[3],detloc;
493 int iel,na,nb,ntempb,ntempc,nxp;
495 static int8_t mmgErr0=0,mmgErr1=0;
497 iel = lists[kel] / 4;
498 iface = lists[kel] % 4;
503 assert( 0<=iface && iface<4 &&
"unexpected local face idx");
509 fprintf(stderr,
"\n ## Error: %s: function MMG5_bezierCP return 0.\n",
521 for( i=0 ; i<4 ; i++ ){
522 if ( (pt->
v[i] != ip0) && (pt->
v[i] != pt->
v[iface]) ) {
538 if ( detloc > 0.0 ) {
541 else if (ntempb == nb )
544 assert(ntempb == ip0);
549 else if (ntempc == nb )
552 assert(ntempc == ip0);
560 else if (ntempb == nb )
563 assert(ntempb == ip0);
568 else if (ntempc == nb )
571 assert(ntempc == ip0);
578 fprintf(stderr,
" ## Error: %s: function MMG3D_bezierInt return 0.\n",
597 "larger xpoint table",
627 int ilistv,MMG5_int *lists,
int ilists,
628 int improveSurf,
int improveVol) {
633 double n[3],r[3][3],lispoi[3*
MMG3D_LMAX+1],ux,uy,det2d;
634 double detloc,oppt[2],step,lambda[3];
635 double ll,m[2],o[3],no[3];
636 double calold,calnew,caltmp,callist[
MMG3D_LMAX+2];
645 if ( ilists < 2 )
return 0;
671 for (k=0; k<ilists; k++) {
672 m[0] = 0.5*(lispoi[3*(k+1)+1] + lispoi[3*k+1]);
673 m[1] = 0.5*(lispoi[3*(k+1)+2] + lispoi[3*k+2]);
674 ux = lispoi[3*(k+1)+1] - lispoi[3*k+1];
675 uy = lispoi[3*(k+1)+2] - lispoi[3*k+2];
682 oppt[0] *= (1.0 / nut);
683 oppt[1] *= (1.0 / nut);
686 det2d = lispoi[1]*oppt[1] - lispoi[2]*oppt[0];
688 if ( det2d >= 0.0 ) {
689 for (k=0; k<ilists; k++) {
690 detloc = oppt[0]*lispoi[3*(k+1)+2] - oppt[1]*lispoi[3*(k+1)+1];
691 if ( detloc >= 0.0 ) {
696 if ( k == ilists )
return 0;
699 for (k=ilists-1; k>=0; k--) {
700 detloc = lispoi[3*k+1]*oppt[1] - lispoi[3*k+2]*oppt[0];
701 if ( detloc >= 0.0 ) {
706 if ( k == -1 )
return 0;
710 det2d = -oppt[1]*(lispoi[3*(kel+1)+1] - lispoi[3*(kel)+1]) + \
711 oppt[0]*(lispoi[3*(kel+1)+2] - lispoi[3*(kel)+2]);
717 det2d = lispoi[3*(kel)+1]*(lispoi[3*(kel+1)+2] - lispoi[3*(kel)+2]) - \
718 lispoi[3*(kel)+2 ]*(lispoi[3*(kel+1)+1] - lispoi[3*(kel)+1]);
725 det2d = lispoi[3*kel+1]*lispoi[3*(kel+1)+2] - lispoi[3*kel+2]*lispoi[3*(kel+1)+1];
728 lambda[1] = lispoi[3*(kel+1)+2]*oppt[0] - lispoi[3*(kel+1)+1]*oppt[1];
729 lambda[2] = -lispoi[3*(kel)+2]*oppt[0] + lispoi[3*(kel)+1]*oppt[1];
732 lambda[0] = 1.0 - lambda[1] - lambda[2];
748 calold = calnew = DBL_MAX;
749 for (l=0; l<ilists; l++) {
751 iface = lists[l] % 4;
753 assert( 0<=iface && iface<4 &&
"unexpected local face idx");
755 calold =
MG_MIN(calold,MMG5_caltri(
mesh,met,&tt));
757 for( i=0 ; i<3 ; i++ )
758 if ( tt.
v[i] == ip0 )
break;
760 if ( i==3 )
return 0;
764 caltmp = MMG5_caltri(
mesh,met,&tt);
770 calnew =
MG_MIN(calnew,caltmp);
772 if ( calold <
MMG5_EPSOK && calnew <= calold )
return 0;
774 else if (improveSurf && calnew < 1.02*calold)
return 0;
775 else if ( calnew < 0.3*calold )
return 0;
779 calold = calnew = DBL_MAX;
781 for (l=0; l<ilistv; l++) {
794 calnew =
MG_MIN(calnew,callist[l]);
799 if (calold <
MMG5_EPSOK && calnew <= calold) {
805 else if (improveVol && calnew < calold) {
808 else if (calnew < 0.3*calold) {
824 for(l=0; l<ilistv; l++){
825 (&
mesh->
tetra[listv[l]/4])->qual= callist[l];
854 MMG5_int *ipa,MMG5_int *ipb,
const uint16_t edgTag,MMG5_int *ip) {
857 MMG5_int iel,iptmpa,iptmpb;
859 uint8_t i,ie,iface,iea,ieb;
862 iface = lists[l] % 4;
866 assert ( pt->
xt &&
"tetra with boundary face has a xtetra");
870 for (i=0; i<3; i++) {
898 if ( (iptmpa == *ipa) || (iptmpa == *ipb) ) {
900 if ( edgTag & tag ) {
909 if ( (iptmpb == *ipa) || (iptmpb == *ipb) ) {
911 if ( edgTag & tag ) {
945 const uint16_t edgTag, MMG5_int ip0,MMG5_int *ip1,
948 MMG5_int iel,ipa,ipb;
966 for (i=0; i<3; i++) {
979 for (l=1; l<ilists; l++) {
1000 for (i=0; i<3; i++) {
1013 for (l=ilists-1; l>0; l--) {
1026 if ( (*ip1) == (*ip2) ) {
1059 MMG5_int ip0,uint8_t isrid,
double o[3],
1060 double no[3],
double no2[3],
double to[3]) {
1070 calold = calnew = DBL_MAX;
1072 for( l=0 ; l<ilistv ; l++ ){
1084 calnew =
MG_MIN(calnew,callist[l]);
1086 if ((calold <
MMG5_EPSOK && calnew <= calold) ||
1087 (calnew <
MMG5_EPSOK) || (calnew <= 0.3*calold)) {
1089 }
else if (improve && calnew < calold) {
1113 pxp->
n2[0] = no2[0];
1114 pxp->
n2[1] = no2[1];
1115 pxp->
n2[2] = no2[2];
1118 for( l=0 ; l<ilistv ; l++ ){
1119 (&
mesh->
tetra[listv[l]/4])->qual = callist[l];
1151 MMG5_int ip1,MMG5_int ip2,
double ll1old,
double ll2old,
1152 uint8_t isrid,
const double step,
1153 double o[3],
double no[3],
1154 double no2[3],
double to[3],
1155 const uint16_t edgTag) {
1160 if ( ll1old < ll2old ) {
1164 else if ( ll1old > ll2old ) {
1178 else if (
MG_GEO & edgTag ) {
1183 "BezierRidge don't work if both ip0 and ip are singular" );
1188 else if (
MG_REF & edgTag ) {
1194 assert ( 0 &&
"Unexpected edge tag in this function");
1207 MMG5_int nxp =
mesh->
xp + 1;
1210 "larger xpoint table",
1227 pxp->
n2[0] = no2[0];
1228 pxp->
n2[1] = no2[1];
1229 pxp->
n2[2] = no2[2];
1264 int ilistv, MMG5_int *lists,
int ilists,
int improve,
const int16_t edgTag){
1270 double ll1old,ll2old,o[3],no[3],no2[3],to[3];
1271 double calold,calnew,caltmp,hmax,hausd;
1272 MMG5_int iel,ip0,ip1,ip2,ip;
1275 uint8_t i,iface,isrid;
1279 ip0 = pt->
v[listv[0]%4];
1286 assert ( edgTag & p0->
tag );
1304 ll1old = (p1->
c[0] -p0->
c[0])* (p1->
c[0] -p0->
c[0]) \
1305 + (p1->
c[1] -p0->
c[1])* (p1->
c[1] -p0->
c[1]) \
1306 + (p1->
c[2] -p0->
c[2])* (p1->
c[2] -p0->
c[2]);
1307 ll2old = (p2->
c[0] -p0->
c[0])* (p2->
c[0] -p0->
c[0]) \
1308 + (p2->
c[1] -p0->
c[1])* (p2->
c[1] -p0->
c[1]) \
1309 + (p2->
c[2] -p0->
c[2])* (p2->
c[2] -p0->
c[2]);
1328 calold = calnew = DBL_MAX;
1329 for( l=0 ; l<ilists ; l++ ){
1331 iface = lists[l] % 4;
1333 assert( 0<=iface && iface<4 &&
"unexpected local face idx");
1335 caltmp = MMG5_caltri(
mesh,met,&tt);
1336 calold =
MG_MIN(calold,caltmp);
1338 for( i=0 ; i<3 ; i++ ) {
1339 if ( tt.
v[i] == ip0 ) {
1350 caltmp = MMG5_caltri(
mesh,met,&tt);
1356 calnew =
MG_MIN(calnew,caltmp);
1371 if ( par->
ref != pt->
ref )
continue;
1385 if ( par->
ref != tt.
ref )
continue;
1397 if ( par->
ref != tt.
ref )
continue;
1412 if ( calold <
MMG5_EPSOK && calnew <= calold ) {
1415 else if ( calnew < calold ) {
1424 improve,p0,ip0,isrid,o,no,no2,to);
1447 int ilistv, MMG5_int *lists,
int ilists,
int improve){
1471 int ilistv, MMG5_int *lists,
int ilists,
int improve){
1491 int ilistv,
int improve){
1495 double step,ll1old,ll2old,calold,calnew,callist[
MMG3D_LMAX+2];
1496 double o[3],no[3],to[3];
1498 MMG5_int ip0,ip1,ip2,ip,iel,ipa;
1504 ip0 = pt->
v[listv[0]%4];
1510 for (l=0; l<ilistv; l++) {
1514 if ( !pt->
xt )
continue;
1517 for (i=0; i<3; i++) {
1521 if ( !ip1 ) ip1 = ipa;
1522 else if ( !ip2 && ipa != ip1 ) ip2 = ipa;
1526 if ( !(ip1 && ip2 && (ip1 != ip2)) )
return 0;
1532 ll1old = (p1->
c[0] -p0->
c[0])* (p1->
c[0] -p0->
c[0]) \
1533 + (p1->
c[1] -p0->
c[1])* (p1->
c[1] -p0->
c[1]) \
1534 + (p1->
c[2] -p0->
c[2])* (p1->
c[2] -p0->
c[2]);
1535 ll2old = (p2->
c[0] -p0->
c[0])* (p2->
c[0] -p0->
c[0]) \
1536 + (p2->
c[1] -p0->
c[1])* (p2->
c[1] -p0->
c[1]) \
1537 + (p2->
c[2] -p0->
c[2])* (p2->
c[2] -p0->
c[2]);
1539 if ( ll1old < ll2old ) {
1557 calold = calnew = DBL_MAX;
1558 for( l=0 ; l<ilistv ; l++ ){
1570 calnew =
MG_MIN(calnew,callist[l]);
1572 if ((calold <
MMG5_EPSOK && calnew <= calold) ||
1573 (calnew <
MMG5_EPSOK) || (calnew <= 0.3*calold)) {
1575 }
else if (improve && calnew < calold) {
1591 for(l=0; l<ilistv; l++){
1592 (&
mesh->
tetra[listv[l]/4])->qual = callist[l];
1615 int ilistv,MMG5_int *lists,
int ilists,
int improve) {
1637 int j,iter,maxiter,l,lon;
1639 MMG5_int ipb,iadr,i1,i2,i3,iel;
1641 double ax,ay,az,bx,by,bz,nx,ny,nz,dd,len,qual,oldc[3];
1652 iadr = pt->
v[ib]*
sol->size + 0;
1663 ax = p3->
c[0] - p1->
c[0];
1664 ay = p3->
c[1] - p1->
c[1];
1665 az = p3->
c[2] - p1->
c[2];
1667 bx = p2->
c[0] - p1->
c[0];
1668 by = p2->
c[1] - p1->
c[1];
1669 bz = p2->
c[2] - p1->
c[2];
1671 nx = (ay*bz - az*by);
1672 ny = (az*bx - ax*bz);
1673 nz = (ax*by - ay*bx);
1675 dd = sqrt(nx*nx+ny*ny+nz*nz);
1681 for (j=0; j<3; j++) {
1685 ax = ppb->
c[0] - ppa->
c[0];
1686 ay = ppb->
c[1] - ppa->
c[1];
1687 az = ppb->
c[2] - ppa->
c[2];
1689 dd = mp[0]*ax*ax + mp[3]*ay*ay + mp[5]*az*az \
1690 + 2.0*(mp[1]*ax*ay + mp[2]*ax*az + mp[4]*ay*az);
1695 dd = 1.0 / (double)3.;
1698 memcpy(oldc,ppa->
c,3*
sizeof(
double));
1706 ppa->
c[0] = oldc[0] + coe * nx * len;
1707 ppa->
c[1] = oldc[1] + coe * ny * len;
1708 ppa->
c[2] = oldc[2] + coe * nz * len;
1710 for (l=0; l<lon; l++) {
1714 qual = MMG5_caltet(
mesh,
sol,pt1);
1716 if ( qual*1.01 <= pt1->
qual)
break;
1720 if ( l >= lon )
break;
1723 while ( ++iter <= maxiter );
1724 if ( iter > maxiter) {
1725 memcpy(ppa->
c,oldc,3*
sizeof(
double));
1729 for (l=0; l<lon; l++) {
1732 pt1->
qual = qualtet[l];
1757 int j,iter,maxiter,l,lon;
1759 MMG5_int ipb,iel,i1,i2,i3;
1761 double ax,ay,az,bx,by,bz,nx,ny,nz,dd,len,qual,oldc[3],oldp[3];
1781 ax = p3->
c[0] - p1->
c[0];
1782 ay = p3->
c[1] - p1->
c[1];
1783 az = p3->
c[2] - p1->
c[2];
1785 bx = p2->
c[0] - p1->
c[0];
1786 by = p2->
c[1] - p1->
c[1];
1787 bz = p2->
c[2] - p1->
c[2];
1789 nx = (ay*bz - az*by);
1790 ny = (az*bx - ax*bz);
1791 nz = (ax*by - ay*bx);
1793 dd = sqrt(nx*nx+ny*ny+nz*nz);
1799 for (j=0; j<3; j++) {
1803 ax = ppb->
c[0] - ppa->
c[0];
1804 ay = ppb->
c[1] - ppa->
c[1];
1805 az = ppb->
c[2] - ppa->
c[2];
1807 dd = sqrt(ax*ax +ay*ay +az*az);
1811 dd = 1.0 / (double)3.;
1815 memcpy(oldp,ppa->
c,3*
sizeof(
double));
1816 oldc[0] = 1./3.*(p1->
c[0]+p2->
c[0]+p3->
c[0]);
1817 oldc[1] = 1./3.*(p1->
c[1]+p2->
c[1]+p3->
c[1]);
1818 oldc[2] = 1./3.*(p1->
c[2]+p2->
c[2]+p3->
c[2]);
1822 if ( !lon )
return 0;
1826 for (l=1; l<lon; l++) {
1829 if ( pt1->
qual < crit) crit = pt1->
qual;
1835 ppa->
c[0] = oldc[0] + coe * nx * len;
1836 ppa->
c[1] = oldc[1] + coe * ny * len;
1837 ppa->
c[2] = oldc[2] + coe * nz * len;
1838 for (l=0; l<lon; l++) {
1841 qual = MMG5_caltet(
mesh,
sol,pt1);
1842 if ( qual < crit ) {
1848 if ( l >= lon )
break;
1851 while ( ++iter <= maxiter );
1852 if ( iter > maxiter) {
1853 memcpy(ppa->
c,oldp,3*
sizeof(
double));
1857 for (l=0; l<lon; l++) {
1860 pt1->
qual = qualtet[l];
1886 int j,iter,maxiter,l,lon;
1888 MMG5_int ipb,iadr,iel,i1,i2,i3;
1890 double ax,ay,az,bx,by,bz,nx,ny,nz,dd,len,qual,oldc[3];
1901 iadr = (pt->
v[ib])*
sol->size;
1912 ax = p3->
c[0] - p1->
c[0];
1913 ay = p3->
c[1] - p1->
c[1];
1914 az = p3->
c[2] - p1->
c[2];
1916 bx = p2->
c[0] - p1->
c[0];
1917 by = p2->
c[1] - p1->
c[1];
1918 bz = p2->
c[2] - p1->
c[2];
1920 nx = (ay*bz - az*by);
1921 ny = (az*bx - ax*bz);
1922 nz = (ax*by - ay*bx);
1924 dd = sqrt(nx*nx+ny*ny+nz*nz);
1930 for (j=0; j<3; j++) {
1934 ax = ppb->
c[0] - ppa->
c[0];
1935 ay = ppb->
c[1] - ppa->
c[1];
1936 az = ppb->
c[2] - ppa->
c[2];
1938 dd = sqrt(ax*ax +ay*ay +az*az);
1942 dd = 1.0 / (double)3.;
1944 if(len > 0.) len = 1.0 / len;
1946 memcpy(oldc,ppa->
c,3*
sizeof(
double));
1954 for (l=1; l<lon; l++) {
1957 if ( pt1->
qual < crit )
1967 ppa->
c[0] = oldc[0] + coe * nx * len;
1968 ppa->
c[1] = oldc[1] + coe * ny * len;
1969 ppa->
c[2] = oldc[2] + coe * nz * len;
1970 for (l=0; l<lon; l++) {
1973 qual = MMG5_caltet(
mesh,
sol,pt1);
1974 if ( qual < crit )
break;
1978 if ( l >= lon )
break;
1981 while ( ++iter <= maxiter );
1982 if ( iter > maxiter) {
1983 memcpy(ppa->
c,oldc,3*
sizeof(
double));
1987 for (l=0; l<lon; l++) {
1990 pt1->
qual = qualtet[l];
MMG5_pMesh MMG5_pSol * sol
if(!ier) exit(EXIT_FAILURE)
int MMG3D_movePROctree(MMG5_pMesh mesh, MMG3D_pPROctree q, MMG5_int no, double *newVer, double *oldVer)
int MMG3D_bezierInt(MMG5_pBezier pb, double uv[2], double o[3], double no[3], double to[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.
static double MMG5_lenedg_iso(MMG5_pMesh mesh, MMG5_pSol met, int ia, MMG5_pTetra pt)
static double MMG5_orcal(MMG5_pMesh mesh, MMG5_pSol met, MMG5_int iel)
API headers and documentation for the mmg3d library, for volumetric meshes in 3D.
static const uint8_t MMG5_arpt[4][3]
arpt[i]: edges passing through vertex i
int MMG5_BezierRidge(MMG5_pMesh mesh, MMG5_int ip0, MMG5_int ip1, double s, double *o, double *no1, double *no2, double *to)
int8_t MMG5_chkedg(MMG5_pMesh mesh, MMG5_Tria *pt, int8_t ori, double, double, int)
static const int8_t MMG5_iarf[4][3]
iarf[i]: edges of face opposite to vertex i
static const uint8_t MMG5_iare[6][2]
vertices of extremities of the edges of the tetra
int MMG5_BezierRef(MMG5_pMesh mesh, MMG5_int ip0, MMG5_int ip1, double s, double *o, double *no, double *to)
void MMG5_tet2tri(MMG5_pMesh mesh, MMG5_int k, int8_t ie, MMG5_Tria *ptt)
int MMG5_BezierNom(MMG5_pMesh mesh, MMG5_int ip0, MMG5_int ip1, double s, double *o, double *no, double *to)
static const uint8_t MMG5_idir[4][3]
idir[i]: vertices of face opposite to vertex i
double MMG5_det3pt1vec(double c0[3], double c1[3], double c2[3], double v[3])
double MMG5_det4pt(double c0[3], double c1[3], double c2[3], double c3[3])
#define MMG5_TAB_RECALLOC(mesh, ptr, initSize, wantedGap, type, message, law)
#define MG_GET(flag, bit)
double MMG5_orvol(MMG5_pPoint point, MMG5_int *v)
int MMG5_rotmatrix(double n[3], double r[3][3])
int MMG3D_curveEndingPts(MMG5_pMesh mesh, MMG5_int *lists, int ilists, const uint16_t edgTag, MMG5_int ip0, MMG5_int *ip1, MMG5_int *ip2)
int MMG5_movbdynomintpt_iso(MMG5_pMesh mesh, MMG5_pSol met, MMG3D_pPROctree PROctree, int64_t *listv, int ilistv, int improve)
int MMG5_movbdyridpt_iso(MMG5_pMesh mesh, MMG5_pSol met, MMG3D_pPROctree PROctree, int64_t *listv, int ilistv, MMG5_int *lists, int ilists, int improve)
int MMG3D_movnormal_iso(MMG5_pMesh mesh, MMG5_pSol sol, MMG5_int k, int ib)
int MMG3D_movbdycurvept_chckAndUpdate(MMG5_pMesh mesh, MMG5_pSol met, MMG3D_pPROctree PROctree, int64_t *listv, int ilistv, int improve, MMG5_pPoint p0, MMG5_int ip0, uint8_t isrid, double o[3], double no[3], double no2[3], double to[3])
int MMG3D_rotate_surfacicBall(MMG5_pMesh mesh, MMG5_int *lists, int ilists, MMG5_int ip0, double r[3][3], double *lispoi)
int MMG3D_movv_ani(MMG5_pMesh mesh, MMG5_pSol sol, MMG5_int k, int ib)
int MMG5_movbdyregpt_iso(MMG5_pMesh mesh, MMG5_pSol met, MMG3D_pPROctree PROctree, int64_t *listv, int ilistv, MMG5_int *lists, int ilists, int improveSurf, int improveVol)
int MMG5_movintpt_iso(MMG5_pMesh mesh, MMG5_pSol met, MMG3D_pPROctree PROctree, int64_t *list, int ilist, int improve)
static int MMG3D_movbdycurvept_iso(MMG5_pMesh mesh, MMG5_pSol met, MMG3D_pPROctree PROctree, int64_t *listv, int ilistv, MMG5_int *lists, int ilists, int improve, const int16_t edgTag)
static int MMG3D_curveEndingPts_chkEdg(MMG5_pMesh mesh, MMG5_int *lists, int l, MMG5_int ip0, MMG5_int *ipa, MMG5_int *ipb, const uint16_t edgTag, MMG5_int *ip)
int MMG3D_movbdycurvept_newPosForSimu(MMG5_pMesh mesh, MMG5_pPoint p0, MMG5_int ip0, MMG5_int ip1, MMG5_int ip2, double ll1old, double ll2old, uint8_t isrid, const double step, double o[3], double no[3], double no2[3], double to[3], const uint16_t edgTag)
int MMG3D_movv_iso(MMG5_pMesh mesh, MMG5_pSol sol, MMG5_int k, int ib)
int MMG5_movintptLES_iso(MMG5_pMesh mesh, MMG5_pSol met, MMG3D_pPROctree PROctree, MMG5_int *list, int ilist, int improve)
int MMG3D_movbdyregpt_geom(MMG5_pMesh mesh, MMG5_int *lists, const MMG5_int kel, const MMG5_int ip0, double n[3], double lambda[3], double o[3], double no[3])
int MMG5_movbdyrefpt_iso(MMG5_pMesh mesh, MMG5_pSol met, MMG3D_pPROctree PROctree, int64_t *listv, int ilistv, MMG5_int *lists, int ilists, int improve)
int MMG5_movbdynompt_iso(MMG5_pMesh mesh, MMG5_pSol met, MMG3D_pPROctree PROctree, int64_t *listv, int ilistv, MMG5_int *lists, int ilists, int improve)
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.