54 double n[3],nref[3],vnew,vold;
60 vold = nref[0]*nref[0] + nref[1]*nref[1] + nref[2]*nref[2];
73 vnew = n[0]*n[0] + n[1]*n[1] + n[2]*n[2];
77 if ( nref[0]*n[0]+nref[1]*n[1]+nref[2]*n[2] < 0 ) {
81 pt0->
v[is] = pt->
v[is];
87 vnew = n[0]*n[0] + n[1]*n[1] + n[2]*n[2];
91 if ( nref[0]*n[0]+nref[1]*n[1]+nref[2]*n[2] < 0 ) {
118 fprintf(stderr,
"\n ## Error: %s: unable to allocate"
119 " a new element.\n",__func__);
121 fprintf(stderr,
" Exit program.\n");
134 if ( pt->
edg[i] > 0 ) {
139 pt->
v[i2] = pt1->
v[i1] = vx[i];
141 pt->
edg[i1] = pt1->
edg[i2] = 0;
168 static int mmgErr0 = 0, mmgErr1 = 0;
179 memcpy(&met->
m[0],&met->
m[met->
size*ip], met->
size*
sizeof(
double));
189 MMG5_int *adja = &
mesh->
adja[3*(k-1)+1];
194 int8_t compute_n2 = kadja && (pt0->
tag[i] &
MG_GEO) ;
201 fprintf(stderr,
"\n ## Warning: %s: function MMG5_bezierCP return 0.\n",
206 double uv[2],o[3],no[3],to[3];
209 if ( iadja == 1 ) uv[0] = 0.0;
210 else if ( iadja == 2 ) uv[1] = 0.0;
216 fprintf(stderr,
" ## Warning: %s: function MMGS_bezierInt return 0.\n",
221 MMG5_int nxp =
mesh->
xp + 1;
224 "larger xpoint table",
229 memcpy(go->
n2,no,3*
sizeof(
double));
230 assert ( ppt->
xp &&
"missing xpoint at ridge point" );
232 memcpy(go->
n1,pxp->
n1,3*
sizeof(
double));
236 cal = MMG5_calelt(
mesh,met,pt0);
239 pt0->
v[is] = pt->
v[is];
242 cal = MMG5_calelt(
mesh,met,pt0);
247 if ( !kadja )
return 1;
253 cal = MMG5_calelt(
mesh,met,pt0);
256 pt0->
v[is] = pt->
v[is];
259 cal = MMG5_calelt(
mesh,met,pt0);
266 memcpy(pxp->
n2,go->
n2,3*
sizeof(
double));
286 MMG5_int *adja,iel,jel,kel,mel;
287 int8_t i1,i2,j,j1,j2,m;
324 mesh->
adja[3*(k-1)+1+i1] = 3*iel+i2;
325 mesh->
adja[3*(iel-1)+1+i2] = 3*k+i1;
326 mesh->
adja[3*(iel-1)+1+i1] = 3*mel+m;
328 mesh->
adja[3*(mel-1)+1+m] = 3*iel+i1;
343 memcpy(&
mesh->
adja[3*(kel-1)+1],&
mesh->
adja[3*(jel-1)+1],3*
sizeof(MMG5_int));
358 mesh->
adja[3*(jel-1)+1+j2] = 3*kel+j1;
359 mesh->
adja[3*(kel-1)+1+j1] = 3*jel+j2;
360 mesh->
adja[3*(kel-1)+1+j2] = 3*mel+m;
362 mesh->
adja[3*(mel-1)+1+m] = 3*kel+j2;
364 mesh->
adja[3*(iel-1)+1+i] = 3*kel+j;
365 mesh->
adja[3*(kel-1)+1+j] = 3*iel+i;
385 double n[3],nref[3],vold,vnew;
391 vold = nref[0]*nref[0] + nref[1]*nref[1] + nref[2]*nref[2];
400 else if ( !vx[1] ) i = 2;
409 vnew = n[0]*n[0] + n[1]*n[1] + n[2]*n[2];
413 if ( nref[0]*n[0]+nref[1]*n[1]+nref[2]*n[2] < 0 ) {
423 vnew = n[0]*n[0] + n[1]*n[1] + n[2]*n[2];
427 if ( nref[0]*n[0]+nref[1]*n[1]+nref[2]*n[2] < 0 ) {
432 pt0->
v[i2] = pt->
v[i2];
438 vnew = n[0]*n[0] + n[1]*n[1] + n[2]*n[2];
442 if ( nref[0]*n[0]+nref[1]*n[1]+nref[2]*n[2] < 0 ) {
469 fprintf(stderr,
"\n ## Error: %s: unable to allocate"
470 " a new element.\n",__func__);
472 fprintf(stderr,
" Exit program.\n");
478 fprintf(stderr,
"\n ## Error: %s: unable to allocate"
479 " a new element.\n",__func__);
481 fprintf(stderr,
" Exit program.\n");
494 else if ( !vx[1] ) i = 2;
502 if ( pt->
edg[i] > 0 ) p3->
ref = pt->
edg[i];
503 if ( pt->
edg[i1] > 0 ) p4->
ref = pt->
edg[i1];
505 pt->
v[i1] = pt1->
v[i2] = pt2->
v[i1] = vx[i];
506 pt->
v[i2] = pt2->
v[i] = vx[i1];
509 pt->
edg[i] = pt->
edg[i2] = pt1->
edg[i1] = pt2->
edg[i2] = 0;
534 double n[3],nref[3],vnew,vold;
539 vold = nref[0]*nref[0] + nref[1]*nref[1] + nref[2]*nref[2];
553 vnew = n[0]*n[0] + n[1]*n[1] + n[2]*n[2];
557 if ( nref[0]*n[0]+nref[1]*n[1]+nref[2]*n[2] < 0 ) {
562 pt0->
v[1] = pt->
v[1];
568 vnew = n[0]*n[0] + n[1]*n[1] + n[2]*n[2];
572 if ( nref[0]*n[0]+nref[1]*n[1]+nref[2]*n[2] < 0 ) {
577 pt0->
v[2] = pt->
v[2];
583 vnew = n[0]*n[0] + n[1]*n[1] + n[2]*n[2];
587 if ( nref[0]*n[0]+nref[1]*n[1]+nref[2]*n[2] < 0 ) {
599 vnew = n[0]*n[0] + n[1]*n[1] + n[2]*n[2];
603 if ( nref[0]*n[0]+nref[1]*n[1]+nref[2]*n[2] < 0 ) {
623 MMG5_int iel,jel,kel;
629 fprintf(stderr,
"\n ## Error: %s: unable to allocate"
630 " a new element.\n",__func__);
632 fprintf(stderr,
" Exit program.\n");
638 fprintf(stderr,
"\n ## Error: %s: unable to allocate"
639 " a new element.\n",__func__);
641 fprintf(stderr,
" Exit program.\n");
647 fprintf(stderr,
"\n ## Error: %s: unable to allocate"
648 " a new element.\n",__func__);
650 fprintf(stderr,
" Exit program.\n");
668 if ( pt->
edg[0] > 0 ) p3->
ref = pt->
edg[0];
669 if ( pt->
edg[1] > 0 ) p4->
ref = pt->
edg[1];
670 if ( pt->
edg[2] > 0 ) p5->
ref = pt->
edg[2];
673 pt->
v[1] = pt1->
v[0] = pt3->
v[0] = vx[2];
674 pt->
v[2] = pt2->
v[0] = pt3->
v[2] = vx[1];
675 pt1->
v[2] = pt2->
v[1] = pt3->
v[1] = vx[0];
678 pt->
edg[0] = pt1->
edg[1] = pt2->
edg[2] = 0;
681 pt3->
edg[0] = pt3->
edg[1] = pt3->
edg[2] = 0;
int MMGS_bezierInt(MMG5_pBezier pb, double uv[2], double o[3], double no[3], double to[3])
int MMGS_delElt(MMG5_pMesh mesh, MMG5_int iel)
MMG5_int MMGS_newElt(MMG5_pMesh mesh)
#define MMGS_TRIA_REALLOC(mesh, jel, wantedGap, law)
#define MMG5_INCREASE_MEM_MESSAGE()
static const uint8_t MMG5_iprv2[3]
#define MMG5_TAB_RECALLOC(mesh, ptr, initSize, wantedGap, type, message, law)
int MMG5_nonUnitNorPts(MMG5_pMesh, MMG5_int, MMG5_int, MMG5_int, double *)
static const uint8_t MMG5_inxt2[6]
int MMG5_split2_sim(MMG5_pMesh mesh, MMG5_pSol met, MMG5_int k, MMG5_int *vx)
int MMGS_split1(MMG5_pMesh mesh, MMG5_pSol met, MMG5_int k, int i, MMG5_int *vx)
int MMGS_split3_sim(MMG5_pMesh mesh, MMG5_pSol met, MMG5_int k, MMG5_int *vx)
int MMGS_split3(MMG5_pMesh mesh, MMG5_pSol met, MMG5_int k, MMG5_int *vx)
int MMGS_simbulgept(MMG5_pMesh mesh, MMG5_pSol met, MMG5_int k, int i, MMG5_int ip)
int MMGS_split1_sim(MMG5_pMesh mesh, MMG5_pSol met, MMG5_int k, int i, MMG5_int *vx)
int MMGS_split2(MMG5_pMesh mesh, MMG5_pSol met, MMG5_int k, MMG5_int *vx)
int split1b(MMG5_pMesh mesh, MMG5_int k, int8_t i, MMG5_int ip)
Structure to store vertices of an MMG mesh.
Structure to store triangles of a MMG mesh.
Structure to store surface vertices of an MMG mesh.