105 for ( k=1; k<=
mesh->
nt; k++ ) {
107 if ( !
MG_EOK(pt) )
continue;
109 for ( i=0; i<3; i++ ) {
125 if ( !MMG5_compute_meanMetricAtMarkedPoints (
mesh,met ) ) {
146 double n[3][3],t[3][3],nt[3],c1[3],c2[3],*n1,*n2,*t1,*t2;
147 double ps,ps2,ux,uy,uz,ll,l,lm,dd,M1,M2,hausd,hmin,hmax;
157 for (k=1; k<=
mesh->
np; k++) {
190 for (k=1; k<=
mesh->
np; k++) {
200 for (k=1; k<=
mesh->
nt; k++) {
202 if ( !
MG_EOK(pt) )
continue;
209 for (i=0; i<3; i++) {
210 if (
MS_SIN(p[i]->tag) ) {
213 else if (
MG_EDG(p[i]->tag) ) {
217 ps = n1[0]*nt[0] + n1[1]*nt[1] + n1[2]*nt[2];
218 ps2 = n2[0]*nt[0] + n2[1]*nt[1] + n2[2]*nt[2];
219 if ( fabs(ps) > fabs(ps2) )
220 memcpy(&n[i],n1,3*
sizeof(
double));
222 memcpy(&n[i],n2,3*
sizeof(
double));
223 memcpy(&t[i],p[i]->n,3*
sizeof(
double));
226 memcpy(&n[i],p[i]->n,3*
sizeof(
double));
229 for (i=0; i<3; i++) {
257 ux = p[i2]->
c[0] - p[i1]->
c[0];
258 uy = p[i2]->
c[1] - p[i1]->
c[1];
259 uz = p[i2]->
c[2] - p[i1]->
c[2];
260 ll = ux*ux + uy*uy + uz*uz;
265 if (
MS_SIN(p[i1]->tag) ) {
274 if (
MS_SIN(p[i2]->tag) ) {
287 dd = (t1[0]*ux + t1[1]*uy + t1[2]*uz)/3.0;
288 c1[0] = p[i1]->
c[0] + dd * t1[0];
289 c1[1] = p[i1]->
c[1] + dd * t1[1];
290 c1[2] = p[i1]->
c[2] + dd * t1[2];
292 dd = -(t2[0]*ux + t2[1]*uy + t2[2]*uz)/3.0;
293 c2[0] = p[i2]->
c[0] + dd * t2[0];
294 c2[1] = p[i2]->
c[1] + dd * t2[1];
295 c2[2] = p[i2]->
c[2] + dd * t2[2];
297 M1 = (c2[0]-2.0*c1[0]+p[i1]->
c[0])*(c2[0]-2.0*c1[0]+p[i1]->c[0]) \
298 + (c2[1]-2.0*c1[1]+p[i1]->
c[1])*(c2[1]-2.0*c1[1]+p[i1]->c[1]) \
299 + (c2[2]-2.0*c1[2]+p[i1]->
c[2])*(c2[2]-2.0*c1[2]+p[i1]->c[2]);
301 M2 = (p[i2]->
c[0]-2.0*c2[0]+c1[0])*(p[i2]->c[0]-2.0*c2[0]+c1[0]) \
302 + (p[i2]->
c[1]-2.0*c2[1]+c1[1])*(p[i2]->c[1]-2.0*c2[1]+c1[1])\
303 + (p[i2]->
c[2]-2.0*c2[2]+c1[2])*(p[i2]->c[2]-2.0*c2[2]+c1[2]);
312 lm = (16.0*ll*hausd) / (3.0*M1);
326 ps = ux*n1[0] + uy*n1[1] + uz*n1[2];
327 c1[0] = (2.0*p[i1]->
c[0] + p[i2]->
c[0] - ps*n1[0]) / 3.0;
328 c1[1] = (2.0*p[i1]->
c[1] + p[i2]->
c[1] - ps*n1[1]) / 3.0;
329 c1[2] = (2.0*p[i1]->
c[2] + p[i2]->
c[2] - ps*n1[2]) / 3.0;
331 ps = -(ux*n2[0] + uy*n2[1] + uz*n2[2]);
332 c2[0] = (2.0*p[i2]->
c[0] + p[i1]->
c[0] - ps*n2[0]) / 3.0;
333 c2[1] = (2.0*p[i2]->
c[1] + p[i1]->
c[1] - ps*n2[1]) / 3.0;
334 c2[2] = (2.0*p[i2]->
c[2] + p[i1]->
c[2] - ps*n2[2]) / 3.0;
336 M1 = (c2[0]-2.0*c1[0]+p[i1]->
c[0])*(c2[0]-2.0*c1[0]+p[i1]->c[0]) \
337 + (c2[1]-2.0*c1[1]+p[i1]->
c[1])*(c2[1]-2.0*c1[1]+p[i1]->c[1]) \
338 + (c2[2]-2.0*c1[2]+p[i1]->
c[2])*(c2[2]-2.0*c1[2]+p[i1]->c[2]);
340 M2 = (p[i2]->
c[0]-2.0*c2[0]+c1[0])*(p[i2]->c[0]-2.0*c2[0]+c1[0]) \
341 + (p[i2]->
c[1]-2.0*c2[1]+c1[1])*(p[i2]->c[1]-2.0*c2[1]+c1[1])\
342 + (p[i2]->
c[2]-2.0*c2[2]+c1[2])*(p[i2]->c[2]-2.0*c2[2]+c1[2]);
351 lm = (16.0*ll*hausd) / (3.0*M1);
368 for (k=1; k<=
mesh->
nt; k++) {
int MMGS_Set_solSize(MMG5_pMesh mesh, MMG5_pSol sol, int typEntity, MMG5_int np, int typSol)
Initialize an array of solution fields: set dimension, types and number of fields.
int MMG5_hashNew(MMG5_pMesh mesh, MMG5_Hash *hash, MMG5_int hsiz, MMG5_int hmax)
MMG5_int MMG5_hashGet(MMG5_Hash *hash, MMG5_int a, MMG5_int b)
int MMG5_hashEdge(MMG5_pMesh mesh, MMG5_Hash *hash, MMG5_int a, MMG5_int b, MMG5_int k)
int MMG5_sum_reqEdgeLengthsAtPoint(MMG5_pMesh mesh, MMG5_pSol met, MMG5_int ip0, MMG5_int ip1)
int MMG5_reset_metricAtReqEdges_surf(MMG5_pMesh mesh, MMG5_pSol met, int8_t ismet)
int MMG5_defsiz_startingMessage(MMG5_pMesh mesh, MMG5_pSol met, const char *funcname)
int MMGS_set_metricAtPointsOnReqEdges(MMG5_pMesh mesh, MMG5_pSol met, int8_t ismet)
int MMGS_defsiz_iso(MMG5_pMesh mesh, MMG5_pSol met)
static int MMGS_sum_reqEdgeLengthsAtPoint(MMG5_pMesh mesh, MMG5_pSol met, MMG5_Hash *hash, MMG5_pTria pt, int8_t i)
API headers and documentation for the mmgs library.
static const uint8_t MMG5_iprv2[3]
static const uint8_t MMG5_inxt2[6]
int MMG5_nortri(MMG5_pMesh mesh, MMG5_pTria pt, double *n)
#define MMG5_DEL_MEM(mesh, ptr)
Identic as MMG5_HGeom but use MMG5_hedge to store edges instead of MMG5_hgeom (memory economy).
Local parameters for a specific entity and reference.
Structure to store vertices of an MMG mesh.
Structure to store triangles of a MMG mesh.