58 isqhmax = 1.0 / (isqhmax*isqhmax);
90 double hausd,hmin,hmax,sqhmin,sqhmax,ux,uy,ll,li,ps1,ps2,lm,ltmp,pv;
91 double M1,M2,t1[2],t2[2],b1[2],b2[2],*n,*m;
92 double gpp1[2],gpp2[2];
95 int8_t isloc,hausdloc;
97 static int8_t mmgWarn0=0,mmgWarn1=0,mmgWarn2=0;
118 for (k=0; k<ilist; k++) {
140 for ( i=0; i<3; i++ ) {
189 assert ( isloc &&
"Non compatible local parameters" );
190 fprintf(stderr,
"\n ## Warning: %s: Non compatible local parameters:\n"
191 " hmin (%.15lg) > hmax (%.15lg).\nhmax ignored.",__func__,hmin,hmax);
200 for (l=0; l<ilist; l++) {
213 else if ( ip1 != pt->
v[i2] ) {
218 else if ( ip2 != pt->
v[i2] ) {
221 fprintf(stderr,
"\n ## Warning: %s: at least 1 point at the"
222 " intersection of 3 edges. abort.\n",__func__);
234 else if ( ip1 != pt->
v[i1] ) {
239 else if ( ip2 != pt->
v[i1] ) {
242 fprintf(stderr,
"\n ## Warning: %s: at least 1 point at the"
243 " intersection of 3 edges. abort.\n",__func__);
252 if ( ip1 == 0 || ip2 == 0 ) {
255 fprintf(stderr,
"\n ## Warning: %s: at least 1 point that is not"
256 "at the intersection of 2 edges. abort.\n",__func__);
264 for (j=0; j<2; j++) {
276 ux = p2->
c[0] - p1->
c[0];
277 uy = p2->
c[1] - p1->
c[1];
303 ps1 = ux*t1[0] + uy*t1[1];
307 ps2 = ux*t2[0] + uy*t2[1];
317 gpp1[0] = 6.0*(p1->
c[0] - 2.0*b1[0] + b2[0]);
318 gpp1[1] = 6.0*(p1->
c[1] - 2.0*b1[1] + b2[1]);
321 pv = gpp1[0]*t1[1] - gpp1[1]*t1[0];
325 gpp2[0] = 6.0*(p2->
c[0] - 2.0*b2[0] + b1[0]);
326 gpp2[1] = 6.0*(p2->
c[1] - 2.0*b2[1] + b1[1]);
329 pv = gpp2[0]*t2[1] - gpp2[1]*t2[0];
335 ltmp = 8.0*hausd / M1;
342 sqhmax = 1.0 / sqhmax;
345 m[0] = lm*n[1]*n[1] + sqhmax*n[0]*n[0];
346 m[1] = n[0]*n[1]*(sqhmax-lm);
347 m[2] = lm*n[0]*n[0] + sqhmax*n[1]*n[1];
367 double mm[3],mr[3],isqhmax;
377 for (k=1; k<=
mesh->
np; k++) {
404 for (k=1; k<=
mesh->
nt; k++) {
406 if ( !
MG_EOK(pt) || pt->
ref < 0 )
continue;
408 for (i=0; i<3; i++) {
413 memcpy(mm,&met->
m[3*ip],3*
sizeof(
double));
435 memcpy(&met->
m[3*ip],mr,3*
sizeof(
double));
443 for (k=1; k<=
mesh->
nt; k++) {
445 if ( !
MG_EOK(pt) )
continue;
451 for (i=0; i<3; i++) {
456 mm[0] = mm[2] = isqhmax;
459 memcpy(&met->
m[3*ip],mr,3*
sizeof(
double));
467 for (k=1; k<=
mesh->
np; k++) {
469 if ( (!
MG_VOK(ppt)) || ppt->
flag > 1 )
continue;
476 mm[0] = mm[2] = isqhmax;
479 memcpy(&met->
m[3*k],mr,3*
sizeof(
double));
505 hm = 1.0 / sqrt(dm[dir]);
506 hn = 1.0 / sqrt(dn[dir]);
510 dn[dir] = 1.0 / (hn*hn);
515 dm[dir] = 1.0 / (hm*hm);
540 double vp[2][2],*m,*n,ll,difsiz;
549 ll = (p2->
c[0]-p1->
c[0])*(p2->
c[0]-p1->
c[0])
550 + (p2->
c[1]-p1->
c[1])*(p2->
c[1]-p1->
c[1]);
555 m = &met->
m[met->
size*np1];
556 n = &met->
m[met->
size*np2];
601 MMG5_int npmaster,MMG5_int npslave) {
603 double ux,uy,dm[2],dn[2];
604 double vp[2][2],*m,*n,ll,difsiz;
613 ux = p2->
c[0]-p1->
c[0];
614 uy = p2->
c[1]-p1->
c[1];
621 m = &met->
m[met->
size*npmaster];
622 n = &met->
m[met->
size*npslave];
int MMG2D_Set_solSize(MMG5_pMesh mesh, MMG5_pSol sol, int typEntity, MMG5_int np, int typSol)
Set the size and type of a solution field.
int MMG5_updatemetreq_ani(double *n, double dn[2], double vp[2][2])
void MMG5_gradEigenvreq(double *dm, double *dn, double difsiz, int8_t dir, int8_t *ier)
int MMG5_updatemet2d_ani(double *m, double *n, double dm[2], double dn[2], double vp[2][2], int8_t ier)
int MMG5_simred2d(MMG5_pMesh mesh, double *m, double *n, double dm[2], double dn[2], double vp[2][2])
static void MMG2D_gradEigenv(double dm[2], double dn[2], double difsiz, int8_t dir, int8_t *ier)
int MMG2D_defsiz_ani(MMG5_pMesh mesh, MMG5_pSol met)
int MMG2D_defaultmet_2d(MMG5_pMesh mesh, MMG5_pSol met, MMG5_int k, int8_t i)
int MMG2D_defmetbdy_2d(MMG5_pMesh mesh, MMG5_pSol met, MMG5_int k, int8_t i)
int MMG2D_grad2metreq_ani(MMG5_pMesh mesh, MMG5_pSol met, MMG5_pTria pt, MMG5_int npmaster, MMG5_int npslave)
MMG5_int MMG2D_grad2met_ani(MMG5_pMesh mesh, MMG5_pSol met, MMG5_pTria pt, MMG5_int np1, MMG5_int np2)
int MMG5_boulet(MMG5_pMesh mesh, MMG5_int start, int ip, MMG5_int *list, int8_t s, int8_t *opn)
int MMG5_defsiz_startingMessage(MMG5_pMesh mesh, MMG5_pSol met, const char *funcname)
int MMG2D_set_metricAtPointsOnReqEdges(MMG5_pMesh mesh, MMG5_pSol met, int8_t ismet)
API headers and documentation for the mmg2d library.
static const uint8_t MMG5_iprv2[3]
static const uint8_t MMG5_inxt2[6]
Local parameters for a specific entity and reference.
Structure to store vertices of an MMG mesh.
Structure to store triangles of a MMG mesh.