36#ifndef _INLINED_FUNC_H
37#define _INLINED_FUNC_H
55 double *m0,
double *m1,int8_t isedg) {
57 double gammaprim0[3],gammaprim1[3],t[3],*n1,*n2,ux,uy,uz,ps1,ps2,l0,l1;
58 static int8_t mmgWarn=0;
63 ux = p1->
c[0] - p0->
c[0];
64 uy = p1->
c[1] - p0->
c[1];
65 uz = p1->
c[2] - p0->
c[2];
74 memcpy(t,p0->
n,3*
sizeof(
double));
75 ps1 = ux*t[0] + uy*t[1] + uz*t[2];
76 gammaprim0[0] = ps1*t[0];
77 gammaprim0[1] = ps1*t[1];
78 gammaprim0[2] = ps1*t[2];
85 ps1 = ux*n1[0] + uy*n1[1] + uz*n1[2];
86 ps2 = ux*n2[0] + uy*n2[1] + uz*n2[2];
87 if ( fabs(ps2) < fabs(ps1) ) {
95 ps1 = ux*n1[0] + uy*n1[1] + uz*n1[2];
101 ps1 = ux*n1[0] + uy*n1[1] + uz*n1[2];
103 gammaprim0[0] = ux - ps1*n1[0];
104 gammaprim0[1] = uy - ps1*n1[1];
105 gammaprim0[2] = uz - ps1*n1[2];
114 memcpy(t,p1->
n,3*
sizeof(
double));
115 ps1 = -ux*t[0] - uy*t[1] - uz*t[2];
116 gammaprim1[0] = ps1*t[0];
117 gammaprim1[1] = ps1*t[1];
118 gammaprim1[2] = ps1*t[2];
124 ps1 = -ux*n1[0] - uy*n1[1] - uz*n1[2];
125 ps2 = -ux*n2[0] - uy*n2[1] - uz*n2[2];
127 if ( fabs(ps2) < fabs(ps1) ) {
135 ps1 = - ux*n1[0] - uy*n1[1] - uz*n1[2];
141 ps1 = -ux*n1[0] - uy*n1[1] - uz*n1[2];
143 gammaprim1[0] = - ux - ps1*n1[0];
144 gammaprim1[1] = - uy - ps1*n1[1];
145 gammaprim1[2] = - uz - ps1*n1[2];
152 l0 = m0[0]*gammaprim0[0]*gammaprim0[0] + m0[3]*gammaprim0[1]*gammaprim0[1] \
153 + m0[5]*gammaprim0[2]*gammaprim0[2] \
154 + 2.0*m0[1]*gammaprim0[0]*gammaprim0[1] + 2.0*m0[2]*gammaprim0[0]*gammaprim0[2] \
155 + 2.0*m0[4]*gammaprim0[1]*gammaprim0[2];
157 l1 = m1[0]*gammaprim1[0]*gammaprim1[0] + m1[3]*gammaprim1[1]*gammaprim1[1] \
158 + m1[5]*gammaprim1[2]*gammaprim1[2] \
159 +2.0*m1[1]*gammaprim1[0]*gammaprim1[1] + 2.0*m1[2]*gammaprim1[0]*gammaprim1[2] \
160 + 2.0*m1[4]*gammaprim1[1]*gammaprim1[2];
164 fprintf(stderr,
" ## Warning: %s: at least 1 negative edge length "
165 "(%e)\n",__func__,l0);
172 fprintf(stderr,
" ## Warning: %s: at least 1 negative edge length "
173 "(%e)\n",__func__,l1);
178 l0 = 0.5*(sqrt(l0) + sqrt(l1));
201 double *m0,*m1,met0[6],met1[6],ux,uy,uz,rbasis[3][3];
202 static int8_t mmgWarn = 0;
207 ux = p1->
c[0] - p0->
c[0];
208 uy = p1->
c[1] - p0->
c[1];
209 uz = p1->
c[2] - p0->
c[2];
219 fprintf(stderr,
" ## Warning: %s: a- unable to compute at least 1 ridge"
220 " metric.\n",__func__);
238 fprintf(stderr,
" ## Warning: %s: b- unable to compute at least 1 ridge"
239 " metric.\n",__func__);
269 MMG5_int np0,MMG5_int np1,int8_t isedg) {
295 double h1,h2,l,r,len;
301 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]) \
302 + (p2->
c[2]-p1->
c[2])*(p2->
c[2]-p1->
c[2]);
305 len = fabs(r) <
MMG5_EPS ? l / h1 : l / (h2-h1) * log1p(r);
332 for( i = 0; i < dim; i++ ) {
334 for( j = i; j < dim; j++ ) {
348 for( k = 0; k < dim; k++ ) {
349 m[ij] += dm[k]*iv[i*dim+k]*iv[j*dim+k];
355 assert( ij == (dim+1)*dim/2 );
static double MMG5_lenSurfEdg_iso(MMG5_pMesh mesh, MMG5_pSol met, MMG5_int ip1, MMG5_int ip2, int8_t isedg)
static double MMG5_lenSurfEdg33_ani(MMG5_pMesh mesh, MMG5_pSol met, MMG5_int np0, MMG5_int np1, int8_t isedg)
static void MMG5_simredmat(int8_t dim, double *m, double *dm, double *iv)
static double MMG5_lenSurfEdg_ani(MMG5_pMesh mesh, MMG5_pSol met, MMG5_int np0, MMG5_int np1, int8_t isedg)
static double MMG5_lenEdg(MMG5_pMesh mesh, MMG5_int np0, MMG5_int np1, double *m0, double *m1, int8_t isedg)
inlined Functions
Structure to store vertices of an MMG mesh.