69 double abx,aby,acx,acy,bcx,bcy,area,h1,h2,h3,hm;
79 area = abx*acy - aby*acx;
80 if ( area <= 0.0 )
return 0.0;
83 h1 = abx*abx + aby*aby;
84 h2 = acx*acx + acy*acy;
85 h3 = bcx*bcx + bcy*bcy;
122 double abx,aby,acx,acy,bcx,bcy;
123 double *a,*b,*c,*ma,*mb,*mc;
124 double area,aream,hm,m[6],h1,h2,h3;
125 MMG5_int ipa,ipb,ipc;
147 area = abx*acy - aby*acx;
148 if ( area <= 0.0 )
return 0.0;
150 for (i=0; i<3; i++) m[i] = (ma[i]+mb[i]+mc[i]) / 3.0;
153 h1 = m[0]*abx*abx + m[2]*aby*aby + 2.0*m[1]*abx*aby;
154 h1 = h1 > 0.0 ? sqrt(h1) : 0.0;
155 h2 = m[0]*acx*acx + m[2]*acy*acy + 2.0*m[1]*acx*acy;
156 h2 = h2 > 0.0 ? sqrt(h2) : 0.0;
157 h3 = m[0]*bcx*bcx + m[2]*bcy*bcy + 2.0*m[1]*bcx*bcy;
158 h3 = h3 > 0.0 ? sqrt(h3) : 0.0;
160 hm = h1*h1 + h2*h2 + h3*h3;
163 aream = sqrt(m[0]*m[2]-m[1]*m[1])*area;
185 double rap,rapmin,rapmax,rapavg,med,good;
186 int i,ir,imax,his[5];
187 MMG5_int k,iel,ok,nex;
188 static int8_t mmgWarn0;
195 for (k=1; k<=
mesh->
nt; k++) {
197 if( !
MG_EOK(pt) )
continue;
203 pt->
qual = MMG2D_caltri(
mesh,met,pt);
209 rapavg = med = good = 0.0;
212 for (k=0; k<5; k++) his[k] = 0;
215 for (k=1; k<=
mesh->
nt; k++) {
224 fprintf(stderr,
" ## Warning: %s: at least 1 negative area\n",__func__);
233 if ( rap < rapmin ) {
237 if ( rap > 0.5 ) med++;
238 if ( rap > 0.12 ) good++;
241 rapmax =
MG_MAX(rapmax,rap);
242 ir =
MG_MIN(4,(
int)(5.0*rap));
247 fprintf(stdout,
"\n -- MESH QUALITY %" MMG5_PRId
"\n",
mesh->
nt - nex);
248 fprintf(stdout,
" BEST %8.6f AVRG. %8.6f WRST. %8.6f (%" MMG5_PRId
")\n",
249 rapmax,rapavg / (
mesh->
nt-nex),rapmin,iel);
251 fprintf(stdout,
" BEST %e AVRG. %e WRST. %e (%" MMG5_PRId
")\n => %" MMG5_PRId
" %" MMG5_PRId
" %" MMG5_PRId
"\n",
252 rapmax,rapavg / (
mesh->
nt-nex),rapmin,iel,
258 fprintf(stdout,
" HISTOGRAMM:");
259 fprintf(stdout,
" %6.2f %% > 0.12\n",100.0*(good/(
float)(
mesh->
nt-nex)));
261 fprintf(stdout,
" %6.2f %% > 0.5\n",100.0*( med/(
float)(
mesh->
nt-nex)));
262 imax =
MG_MIN(4,(
int)(5.*rapmax));
263 for (i=imax; i>=(int)(5*rapmin); i--) {
264 fprintf(stdout,
" %5.1f < Q < %5.1f %7d %6.2f %%\n",
265 i/5.,i/5.+0.2,his[i],100.*(his[i]/(
float)(
mesh->
nt-nex)));
int MMG5_minQualCheck(MMG5_int iel, double minqual, double alpha)
double MMG2D_quickarea(double a[2], double b[2], double c[2])
double MMG2D_caltri_iso(MMG5_pMesh mesh, MMG5_pSol met, MMG5_pTria pt)
double MMG2D_caltri_iso_3pt(double *a, double *b, double *c)
double MMG2D_caltri_ani(MMG5_pMesh mesh, MMG5_pSol met, MMG5_pTria pt)
int MMG2D_outqua(MMG5_pMesh mesh, MMG5_pSol met)
double MMG2D_quickcal(MMG5_pMesh mesh, MMG5_pTria pt)
Structure to store vertices of an MMG mesh.
Structure to store triangles of a MMG mesh.