41 double cal1,cal2,area1,area2,arean1,arean2;
42 MMG5_int *adja,*adja1,k1,k2,k3,vo2,vo3,num1,numa1;
68 pt0->
v[1] = pt->
v[i1];
69 pt0->
v[2] = pt1->
v[j];
72 if ( cal1 > crit )
return 0;
75 pt0->
v[1] = pt1->
v[j];
76 pt0->
v[2] = pt->
v[i2];
79 if ( cal2 > crit )
return 0;
81 if ( arean1 < 0.0 || arean2 < 0.0 || fabs((area1+area2)-(arean1+arean2)) >
MMG2D_EPSD ) {
82 if(
mesh->
info.
ddebug) printf(
" ## Warning: non convex configuration\n");
93 pt->
v[i2] = pt1->
v[j];
96 pt1->
v[j2] = pt->
v[i];
102 MMG5_int num = pt->
edg[i];
106 numa1 = pt1->
edg[j1];
109 mesh->
adja[3*(k1-1)+1+j] = 3*k2+vo2;
112 mesh->
adja[3*(k2-1)+1+vo2] = 3*k1+j;
130 double cal1,cal2,calnat,calchg;
131 MMG5_int *adja,ip,ip1,ip2,iq,kk;
132 uint8_t i1,i2,ii,ii1,ii2;
145 if ( !adja[i] )
return 0;
172 if ( typchk == 2 && met->
m && met->
size == 3 ) {
174 pt0->
v[0]= ip; pt0->
v[1]= ip1; pt0->
v[2]= ip2;
176 pt0->
tag[1] = pt->
tag[i1];
177 pt0->
tag[2] = pt->
tag[i2];
180 pt0->
v[0]= ip1; pt0->
v[1]= iq; pt0->
v[2]= ip2;
181 pt0->
tag[0] = pt1->
tag[ii2];
182 pt0->
tag[1] = pt1->
tag[ii];
183 pt0->
tag[2] = pt1->
tag[ii1];
186 calnat =
MG_MIN(cal1,cal2);
190 pt0->
v[0]= ip; pt0->
v[1]= ip1; pt0->
v[2]= iq;
191 pt0->
tag[0] = pt1->
tag[ii1];
193 pt0->
tag[2] = pt->
tag[i2];
196 pt0->
v[0]= ip; pt0->
v[1]= iq; pt0->
v[2]= ip2;
197 pt0->
tag[0] = pt1->
tag[ii2];
198 pt0->
tag[1] = pt->
tag[i1];
202 calchg =
MG_MIN(cal1,cal2);
205 pt0->
v[0]= ip; pt0->
v[1]= ip1; pt0->
v[2]= ip2;
207 pt0->
v[0]= ip1; pt0->
v[1]= iq; pt0->
v[2]= ip2;
209 calnat =
MG_MIN(cal1,cal2);
210 pt0->
v[0]= ip; pt0->
v[1]= ip1; pt0->
v[2]= iq;
212 pt0->
v[0]= ip; pt0->
v[1]= iq; pt0->
v[2]= ip2;
214 calchg =
MG_MIN(cal1,cal2);
217 return calchg > 1.01 * calnat;
223 MMG5_int *adja,adj,k11,k21;
224 int8_t i1,i2,j,jj,j2,v11,v21;
248 pt->
v[i2] = pt1->
v[j];
249 pt1->
v[j2] = pt->
v[i];
252 pt->
tag[i] = pt1->
tag[jj];
253 pt->
edg[i] = pt1->
edg[jj];
255 pt1->
tag[j] = pt->
tag[i1];
256 pt1->
edg[j] = pt->
edg[i1];
264 mesh->
adja[3*(k-1)+1+i] = 3*k21+v21;
266 mesh->
adja[3*(k21-1)+1+v21] = 3*k+i;
267 mesh->
adja[3*(k-1)+1+i1] = 3*adj+jj;
268 mesh->
adja[3*(adj-1)+1+jj] = 3*k+i1;
270 mesh->
adja[3*(k11-1)+1+v11] = 3*adj+j;
271 mesh->
adja[3*(adj-1)+1+j] = 3*k11+v11;
MMG5_pMesh MMG5_pSol * sol
double MMG2D_caltri_ani(MMG5_pMesh mesh, MMG5_pSol sol, MMG5_pTria)
double MMG2D_caltri_iso(MMG5_pMesh mesh, MMG5_pSol sol, MMG5_pTria)
double MMG2D_quickarea(double a[2], double b[2], double c[2])
static const uint8_t MMG5_iprv2[3]
static const uint8_t MMG5_inxt2[6]
Structure to store triangles of a MMG mesh.
int MMG2D_swapdelone(MMG5_pMesh mesh, MMG5_pSol sol, MMG5_int k, int8_t i, double crit, MMG5_int *list)
int MMG2D_swapar(MMG5_pMesh mesh, MMG5_int k, int8_t i)
int MMG2D_chkswp(MMG5_pMesh mesh, MMG5_pSol met, MMG5_int k, int8_t i, int8_t typchk)