48 double anisurf,dd,abx,aby,abz,acx,acy,acz,bcx,bcy,bcz;
49 double *a,*b,*c,*ma,*mb,*mc,m[6],l0,l1,l2,rap;
67 m[i] = dd * (ma[i] + mb[i] + mc[i]);
84 l0 = m[0]*abx*abx + m[3]*aby*aby + m[5]*abz*abz
85 + 2.0*(m[1]*abx*aby + m[2]*abx*abz + m[4]*aby*abz);
87 l1 = m[0]*acx*acx + m[3]*acy*acy + m[5]*acz*acz
88 + 2.0*(m[1]*acx*acy + m[2]*acx*acz + m[4]*acy*acz);
90 l2 = m[0]*bcx*bcx + m[3]*bcy*bcy + m[5]*bcz*bcz
91 + 2.0*(m[1]*bcx*bcy + m[2]*bcx*bcz + m[4]*bcy*bcz);
117 double rap,anisurf,l0,l1,l2,m[6],mm[6],rbasis[3][3];
118 double abx,aby,abz,acx,acy,acz,bcy,bcx,bcz;
123 for (i=0; i<3; i++) {
129 for ( j=0; j<6; ++j) {
136 memcpy(&m[0],&met->
m[6*np[i]],6*
sizeof(
double));
138 else if ( p[i]->tag &
MG_GEO ) {
141 abx = 0.5*(p[i1]->
c[0]+p[i2]->
c[0]) - p[i]->c[0];
142 aby = 0.5*(p[i1]->
c[1]+p[i2]->
c[1]) - p[i]->c[1];
143 abz = 0.5*(p[i1]->
c[2]+p[i2]->
c[2]) - p[i]->c[2];
150 memcpy(&m[0],&met->
m[6*np[i]],6*
sizeof(
double));
153 for ( j=0; j<6; ++j) {
161 abx = p[1]->
c[0] - p[0]->
c[0];
162 aby = p[1]->
c[1] - p[0]->
c[1];
163 abz = p[1]->
c[2] - p[0]->
c[2];
164 acx = p[2]->
c[0] - p[0]->
c[0];
165 acy = p[2]->
c[1] - p[0]->
c[1];
166 acz = p[2]->
c[2] - p[0]->
c[2];
167 bcx = p[2]->
c[0] - p[1]->
c[0];
168 bcy = p[2]->
c[1] - p[1]->
c[1];
169 bcz = p[2]->
c[2] - p[1]->
c[2];
172 l0 = mm[0]*abx*abx + mm[3]*aby*aby + mm[5]*abz*abz
173 + 2.0*(mm[1]*abx*aby + mm[2]*abx*abz + mm[4]*aby*abz);
175 l1 = mm[0]*acx*acx + mm[3]*acy*acy + mm[5]*acz*acz
176 + 2.0*(mm[1]*acx*acy + mm[2]*acx*acz + mm[4]*acy*acz);
178 l2 = mm[0]*bcx*bcx + mm[3]*bcy*bcy + mm[5]*bcz*bcz
179 + 2.0*(mm[1]*bcx*bcy + mm[2]*bcx*bcz + mm[4]*bcy*bcz);
186 return (anisurf / rap);
200 double *a,*b,*c,cal,abx,aby,abz,acx,acy,acz,bcx,bcy,bcz,rap;
217 cal = (aby*acz - abz*acy) * (aby*acz - abz*acy);
218 cal += (abz*acx - abx*acz) * (abz*acx - abx*acz);
219 cal += (abx*acy - aby*acx) * (abx*acy - aby*acx);
224 rap = abx*abx + aby*aby + abz*abz;
225 rap += acx*acx + acy*acy + acz*acz;
226 rap += bcx*bcx + bcy*bcy + bcz*bcz;
230 return sqrt(cal) / rap;
253 MMG5_int amin, MMG5_int bmin,
double lmin,
254 MMG5_int amax, MMG5_int bmax,
double lmax,
255 int nullEdge,
double *bd, MMG5_int *hl,int8_t shift)
260 (*avlen) = (*avlen) / dned;
262 fprintf(stdout,
"\n -- RESULTING EDGE LENGTHS %" MMG5_PRId
"\n",ned);
263 fprintf(stdout,
" AVERAGE LENGTH %12.4f\n",(*avlen));
264 fprintf(stdout,
" SMALLEST EDGE LENGTH %12.4f %6" MMG5_PRId
" %6" MMG5_PRId
"\n",
266 fprintf(stdout,
" LARGEST EDGE LENGTH %12.4f %6" MMG5_PRId
" %6" MMG5_PRId
" \n",
270 lmax,nullEdge,bd,hl,shift,
295 MMG5_int bmin,
double lmin,MMG5_int amax, MMG5_int bmax,
296 double lmax,MMG5_int nullEdge,
double *bd,
297 MMG5_int *hl,int8_t shift,
int imprim)
301 if ( abs(imprim) < 3 )
return;
303 if ( hl[2+shift]+hl[3+shift]+hl[4+shift] )
304 fprintf(stdout,
" %6.2f < L <%5.2f %8"MMG5_PRId
" %5.2f %% \n",
305 bd[2+shift],bd[5+shift],hl[2+shift]+hl[3+shift]+hl[4+shift],
306 100.*(hl[2+shift]+hl[3+shift]+hl[4+shift])/(
double)ned);
308 if ( abs(imprim) < 4 )
return;
310 if ( abs(imprim) > 3 ) {
311 fprintf(stdout,
"\n HISTOGRAMM:\n");
313 fprintf(stdout,
" 0.00 < L < 0.30 %8"MMG5_PRId
" %5.2f %% \n",
314 hl[0],100.*(hl[0]/(
float)ned));
316 for (k=2; k<9; k++) {
318 fprintf(stdout,
" %6.2f < L <%5.2f %8"MMG5_PRId
" %5.2f %% \n",
319 bd[k-1],bd[k],hl[k-1],100.*(hl[k-1]/(
float)ned));
322 fprintf(stdout,
" 5. < L %8"MMG5_PRId
" %5.2f %% \n",
323 hl[8],100.*(hl[8]/(
float)ned));
326 fprintf(stdout,
"\n WARNING: unable to compute the length of %"MMG5_PRId
327 " edges\n",nullEdge);
347 minqualAlpha = minqual*alpha;
350 fprintf(stderr,
"\n ## Error: %s: too bad quality for the worst element: "
351 "(elt %" MMG5_PRId
" -> %15e)\n",__func__,iel,minqual);
355 fprintf(stderr,
"\n ## Warning: %s: very bad quality for the worst element: "
356 "(elt %" MMG5_PRId
" -> %15e)\n",__func__,iel,minqual);
double MMG5_surftri33_ani(MMG5_pMesh mesh, MMG5_pTria ptt, double ma[6], double mb[6], double mc[6])
static const uint8_t MMG5_iprv2[3]
static const uint8_t MMG5_inxt2[6]
int MMG5_minQualCheck(MMG5_int iel, double minqual, double alpha)
double MMG5_caltri_ani(MMG5_pMesh mesh, MMG5_pSol met, MMG5_pTria ptt)
void MMG5_displayLengthHisto_internal(MMG5_int ned, MMG5_int amin, MMG5_int bmin, double lmin, MMG5_int amax, MMG5_int bmax, double lmax, MMG5_int nullEdge, double *bd, MMG5_int *hl, int8_t shift, int imprim)
void MMG5_displayLengthHisto(MMG5_pMesh mesh, MMG5_int ned, double *avlen, MMG5_int amin, MMG5_int bmin, double lmin, MMG5_int amax, MMG5_int bmax, double lmax, int nullEdge, double *bd, MMG5_int *hl, int8_t shift)
double MMG5_caltri_iso(MMG5_pMesh mesh, MMG5_pSol met, MMG5_pTria ptt)
double MMG5_caltri33_ani(MMG5_pMesh mesh, MMG5_pSol met, MMG5_pTria pt)
Structure to store vertices of an MMG mesh.
Structure to store triangles of a MMG mesh.