68 double abx,aby,abz,acx,acy,acz,adx,ady,adz,v1,v2,v3,vol;
69 double bcx,bcy,bcz,bdx,bdy,bdz,cdx,cdy,cdz,h[6],volchk,ssmall;
70 double s[4],dd,rapmin,rapmax,surmin,surmax;
71 int i,k,isur,isurmax,isurmin,iarmax,iarmin;
75 double EPSVOL = 0.001;
79 if ( !pt->
v[0] )
return -1;
91 abx = pb->
c[0] - pa->
c[0];
92 aby = pb->
c[1] - pa->
c[1];
93 abz = pb->
c[2] - pa->
c[2];
95 acx = pc->
c[0] - pa->
c[0];
96 acy = pc->
c[1] - pa->
c[1];
97 acz = pc->
c[2] - pa->
c[2];
99 adx = pd->
c[0] - pa->
c[0];
100 ady = pd->
c[1] - pa->
c[1];
101 adz = pd->
c[2] - pa->
c[2];
103 v1 = acy*adz - acz*ady;
104 v2 = acz*adx - acx*adz;
105 v3 = acx*ady - acy*adx;
106 vol = abx * v1 + aby * v2 + abz * v3;
109 h[0] = abx*abx + aby*aby + abz*abz;
110 h[1] = acx*acx + acy*acy + acz*acz;
111 h[2] = adx*adx + ady*ady + adz*adz;
113 bcx = pc->
c[0] - pb->
c[0];
114 bcy = pc->
c[1] - pb->
c[1];
115 bcz = pc->
c[2] - pb->
c[2];
117 bdx = pd->
c[0] - pb->
c[0];
118 bdy = pd->
c[1] - pb->
c[1];
119 bdz = pd->
c[2] - pb->
c[2];
121 cdx = pd->
c[0] - pc->
c[0];
122 cdy = pd->
c[1] - pc->
c[1];
123 cdz = pd->
c[2] - pc->
c[2];
125 h[3] = bcx*bcx + bcy*bcy + bcz*bcz;
126 h[4] = bdx*bdx + bdy*bdy + bdz*bdz;
127 h[5] = cdx*cdx + cdy*cdy + cdz*cdz;
130 dd = cdy*bdz - cdz*bdy;
132 dd = cdz*bdx - cdx*bdz;
133 s[0] = s[0] + dd * dd;
134 dd = cdx*bdy - cdy*bdx;
135 s[0] = s[0] + dd * dd;
138 s[1] = sqrt(v1*v1 + v2*v2 + v3*v3);
140 dd = bdy*adz - bdz*ady;
142 dd = bdz*adx - bdx*adz;
143 s[2] = s[2] + dd * dd;
144 dd = bdx*ady - bdy*adx;
145 s[2] = s[2] + dd * dd;
148 dd = aby*acz - abz*acy;
150 dd = abz*acx - abx*acz;
151 s[3] = s[3] + dd * dd;
152 dd = abx*acy - aby*acx;
153 s[3] = s[3] + dd * dd;
161 for (i=1; i<6; i++) {
162 if ( h[i] < rapmin ) {
166 else if ( h[i] > rapmax ) {
171 rapmin = sqrt(rapmin);
172 rapmax = sqrt(rapmax);
173 volchk = EPSVOL * rapmin*rapmin*rapmin;
176 item[0] = item[1] = -1;
177 if ( vol < volchk ) {
179 ssmall = 0.4 * (s[0]+s[1]+s[2]+s[3]);
182 isur += s[i] > ssmall;
192 for (i=1; i<4; i++) {
193 if ( s[i] < surmin ) {
197 else if ( s[i] > surmax ) {
202 dd = surmin / surmax;
216 if ( s[0]+s[1] > ssmall ) isur = 1;
217 if ( s[0]+s[2] > ssmall ) isur++;
218 if ( s[0]+s[3] > ssmall ) isur++;
221 dd = rapmin / rapmax;
225 if ( dd < 0.01 )
return 4;
226 if ( s[0]+s[1] > ssmall ) {
230 if ( s[0]+s[2] > ssmall ) {
234 if ( s[0]+s[3] > ssmall ) {
245 dd = rapmin / rapmax;
250 for (i=0; i<6; i++) h[i] = sqrt(h[i]);
253 for (k=0; k<4; k++) {
254 for (i=0; i<3; i++) {
258 if ( h[i0]+h[i1] < 1.2*h[i2] ) {
286 else if ( dd < 0.7*RAPMAX ) {
288 for (k=0; k<4; k++) {
289 for (i=0; i<3; i++) {
293 if ( h[i0]+h[i1] > 1.5*h[i2] ) naigu++;
341 if ( pxt->
edg[iar] || pxt->
tag[iar] )
return 0;
347 if (
ier < 0 )
return -1;
368 MMG5_int k,
int iar) {
372 for(i=0 ; i<6 ; i++) {
375 if (
ier < 0 )
return -1;
395 MMG5_int k,
int iar,
double OCRIT) {
407 len = MMG5_lenedg(
mesh,met,iar,pt);
415 for(j=0 ; j<4 ; j++) {
416 if(pt->
v[j] ==
ier)
break;
441 MMG5_int k,
int iar) {
452 for(i=0 ; i<6 ; i++) {
477 MMG5_int k,ntot,ne,nd,cs[10],ds[10];
481 MMG5_int nbdy,nbdy2,base ;
493 memset(cs,0,10*
sizeof(MMG5_int));
494 memset(ds,0,10*
sizeof(MMG5_int));
496 for (k=1 ; k<=ne ; k++) {
499 else if ( pt->
mark < base )
continue;
501 if(pt->
qual > crit)
continue;
512 for(i=0 ; i<4 ; i++) {
519 }
else if ( npeau ) {
582 for(i=0 ; i<4 ; i++) {
599 for(i=0 ; i<4 ; i++) {
600 if(item[0]==i)
continue;
621 }
while (nd && it++<maxit);
API headers and documentation for the mmg3d library, for volumetric meshes in 3D.
int MMG3D_movv_ani(MMG5_pMesh, MMG5_pSol, MMG5_int, int)
MMG5_int MMG5_chkswpgen(MMG5_pMesh, MMG5_pSol, MMG5_int, int, int *, int64_t *, double, int8_t)
MMG5_int MMG5_splitedg(MMG5_pMesh mesh, MMG5_pSol met, MMG5_int iel, int iar, double crit)
static const uint8_t MMG5_isar[6][2]
isar[i][]: vertices of extremities of the edge opposite to the ith edge
int MMG3D_movv_iso(MMG5_pMesh, MMG5_pSol, MMG5_int, int)
int MMG3D_optbdry(MMG5_pMesh, MMG5_pSol, MMG3D_pPROctree, MMG5_int)
int MMG5_swpgen(MMG5_pMesh, MMG5_pSol, MMG5_int, int, int64_t *, MMG3D_pPROctree, int8_t)
static const uint8_t MMG5_idir[4][3]
idir[i]: vertices of face opposite to vertex i
static const uint8_t MMG5_inxt2[6]
MMG5_int MMG3D_opttyp(MMG5_pMesh mesh, MMG5_pSol met, MMG3D_pPROctree PROctree, MMG5_int testmark)
static int MMG3D_swpalmostall(MMG5_pMesh mesh, MMG5_pSol met, MMG3D_pPROctree PROctree, MMG5_int k, int iar)
static int MMG3D_typelt(MMG5_pMesh mesh, MMG5_int iel, int *item)
int MMG3D_swpItem(MMG5_pMesh mesh, MMG5_pSol met, MMG3D_pPROctree PROctree, MMG5_int k, int iar)
static int MMG3D_splitalmostall(MMG5_pMesh mesh, MMG5_pSol met, MMG3D_pPROctree PROctree, MMG5_int k, int iar)
int MMG3D_splitItem(MMG5_pMesh mesh, MMG5_pSol met, MMG3D_pPROctree PROctree, MMG5_int k, int iar, double OCRIT)
Structure to store vertices of an MMG mesh.
Structure to store tetrahedra of an MMG mesh.
Structure to store additional information for the surface tetrahedra of an MMG mesh.