27double long_iso(
double *ca,
double *cb,
double *ma,
double *mb) {
28 double ha,hb,ux,uy,dd,rap,len;
34 dd = sqrt(ux*ux + uy*uy);
40 len = dd * (1.0/ha + 1.0/hb + 8.0 / (ha+hb)) / 6.0;
47double long_ani(
double *ca,
double *cb,
double *ma,
double *mb) {
48 double ux,uy,dd1,dd2,len;
52 dd1 = ma[0]*ux*ux + ma[2]*uy*uy + 2.0*ma[1]*ux*uy;
53 if ( dd1 <= 0.0 ) dd1 = 0.0;
54 dd2 = mb[0]*ux*ux + mb[2]*uy*uy + 2.0*mb[1]*ux*uy;
55 if ( dd2 <= 0.0 ) dd2 = 0.0;
57 len = (sqrt(dd1)+sqrt(dd2)+4.0*sqrt(0.5*(dd1+dd2))) / 6.0;
73 l = (p2->
c[0]-p1->
c[0])*(p2->
c[0]-p1->
c[0]) + (p2->
c[1]-p1->
c[1])*(p2->
c[1]-p1->
c[1]);
76 len = ( fabs(r) <
MMG5_EPS ) ? ( l/h1 ) : ( l / (h2-h1) * log1p(r) );
84 double len,*m1,*m2,ux,uy,l1,l2;
85 static int8_t mmgWarn0=0,mmgWarn1=0;
93 ux = p2->
c[0] - p1->
c[0];
94 uy = p2->
c[1] - p1->
c[1];
96 l1 = m1[0]*ux*ux + 2.0*m1[1]*ux*uy + m1[2]*uy*uy;
97 l2 = m2[0]*ux*ux + 2.0*m2[1]*ux*uy + m2[2]*uy*uy;
102 fprintf(stderr,
"\n ## Error: %s: at least 1 negative edge length"
103 " (l1: %e).\n",__func__,l1);
110 fprintf(stderr,
"\n ## Error: %s: at least 1 negative edge length"
111 " (l2: %e)\n",__func__,l2);
127 double lavg,len,lmin,lmax;
129 MMG5_int iamin,ibmin,iamax,ibmax,hl[9],nullEdge,navg;
130 static double bd[9] = {0.0, 0.3, 0.6, 0.7071, 0.9, 1.3, 1.4142, 2.0, 5.0};
143 if ( (!
sol) || (!
sol->m) ) {
153 for (k=0; k<9; k++) hl[k] = 0;
155 for (k=1; k<=
mesh->
nt; k++) {
157 if ( !
MG_EOK(pt) )
continue;
159 for (ia=0; ia<3; ia++) {
161 if ( l < 3*k )
continue;
167 len = MMG2D_lencurv(
mesh,
sol,pt->
v[ipa],pt->
v[ipb]);
188 if (len > bd[2]) hl[2]++;
189 else if (len > bd[1]) hl[1]++;
192 else if (len < bd[5]) {
193 if (len > bd[4]) hl[4]++;
194 else if (len > bd[3]) hl[3]++;
196 else if (len < bd[6]) hl[5]++;
197 else if (len < bd[7]) hl[6]++;
198 else if (len < bd[8]) hl[7]++;
203 iamax, ibmax, lmax,nullEdge, &bd[0], &hl[0],0);
MMG5_pMesh MMG5_pSol * sol
double MMG2D_lencurv_iso(MMG5_pMesh mesh, MMG5_pSol met, MMG5_int ip1, MMG5_int ip2)
double MMG2D_lencurv_ani(MMG5_pMesh mesh, MMG5_pSol met, MMG5_int ip1, MMG5_int ip2)
double long_ani(double *ca, double *cb, double *ma, double *mb)
int MMG2D_prilen(MMG5_pMesh mesh, MMG5_pSol sol)
double long_iso(double *ca, double *cb, double *ma, double *mb)
static const int MMG2D_iare[3][2]
void MMG5_displayLengthHisto(MMG5_pMesh, MMG5_int, double *, MMG5_int, MMG5_int, double, MMG5_int, MMG5_int, double, int, double *, MMG5_int *, int8_t)
Structure to store vertices of an MMG mesh.
Structure to store triangles of a MMG mesh.