56 double step,ll1,ll2,o[2],no[2],calold,calnew;
57 MMG5_int k,iel,ip0,ip1,ip2,it1,it2;
59 static int8_t mmgWarn0=0,mmgWarn1=0;
63 ip1 = ip2 = it1 = it2 = 0;
64 calold = calnew = DBL_MAX;
67 for (k=0; k<ilist; k++) {
74 calold =
MG_MIN(MMG2D_caltri(
mesh,met,pt),calold);
81 else if ( ip1 != pt->
v[i2] ) {
86 else if ( ip2 != pt->
v[i2] ) {
89 fprintf(stderr,
"\n ## Warning: %s: at least 1 point at the "
90 "intersection of 3 edges. abort.\n",__func__);
102 else if ( ip1 != pt->
v[i1] ) {
107 else if ( ip2 != pt->
v[i1] ) {
110 fprintf(stderr,
"\n ## Warning: %s: at least 1 point at the "
111 "intersection of 3 edges. abort.\n",__func__);
120 if ( ip1 == 0 || ip2 == 0 ) {
123 fprintf(stderr,
"\n ## Warning: %s: non singular point at end of edge.\n",
136 if ( met->
m && met->
size == 3 ) {
143 ll1 = (p1->
c[0]-p0->
c[0])*(p1->
c[0]-p0->
c[0]) + (p1->
c[1]-p0->
c[1])*(p1->
c[1]-p0->
c[1]);
144 ll2 = (p2->
c[0]-p0->
c[0])*(p2->
c[0]-p0->
c[0]) + (p2->
c[1]-p0->
c[1])*(p2->
c[1]-p0->
c[1]);
174 for (k=0; k<ilist; k++) {
181 calnew =
MG_MIN(MMG2D_caltri(
mesh,met,pt0),calnew);
184 if ( calold <
MMG2D_NULKAL && calnew <= calold )
return 0;
186 else if ( improve && calnew < 1.02 * calold )
return 0;
187 else if ( calnew < 0.3 * calold )
return 0;
216 double calold,calnew,vol,volbal,b[2];
225 calold = calnew = DBL_MAX;
228 for (k=0; k<ilist; k++) {
240 vol = 0.5* fabs((p1->
c[0]-p0->
c[0])*(p2->
c[1]-p0->
c[1]) - (p1->
c[1]-p0->
c[1])*(p2->
c[0]-p0->
c[0]));
253 volbal = 1.0 / volbal;
261 for (k=0; k<ilist; k++) {
271 if (calold <
MMG2D_NULKAL && calnew <= calold)
return 0;
273 else if ( improve && calnew < 1.02 * calold )
return 0;
274 else if ( calnew < 0.3 * calold )
return 0;
int MMG2D_bezierCurv(MMG5_pMesh mesh, MMG5_int k, int8_t i, double s, double *o, double *no)
double MMG2D_lencurv_ani(MMG5_pMesh mesh, MMG5_pSol met, MMG5_int ip1, MMG5_int ip2)
double MMG2D_caltri_iso(MMG5_pMesh mesh, MMG5_pSol sol, MMG5_pTria)
static const uint8_t MMG5_iprv2[3]
static const uint8_t MMG5_inxt2[6]
int MMG2D_movintpt(MMG5_pMesh mesh, MMG5_pSol met, int ilist, MMG5_int *list, int8_t improve)
int MMG2D_movedgpt(MMG5_pMesh mesh, MMG5_pSol met, int ilist, MMG5_int *list, int8_t improve)
Structure to store vertices of an MMG mesh.
Structure to store triangles of a MMG mesh.