45 MMG5_int ip1,ip2,ip3,ip4,k,iadr,*adja,iadr2,*adja2,iel,nd;
47 static int8_t mmgWarn0=0;
56 for(k=1; k<=
mesh->
nt; k++) {
58 if ( !
MG_EOK(pt) )
continue;
64 if ( !adja[i] )
continue;
67 iadr2 = 3*(iel-1) + 1;
74 else if ( !pt->
base ) {
77 fprintf(stderr,
"\n ## Warning: %s: at least 1 undetermined"
78 " triangle.\n",__func__);
91 fprintf(stderr,
"\n ## Error: %s: procedure failed :"
92 " %" MMG5_PRId
" indetermined triangles.\n",__func__,nd);
103 MMG5_int base,nd,k,ip1,ip2,ip3,ip4;
116 for(k=1; k<=
mesh->
nt; k++) {
118 if ( !
MG_EOK(pt) )
continue;
123 printf(
" ** how many undetermined triangles ? %" MMG5_PRId
"\n",nd);
126 while (nd && ++iter<maxiter);
143 if ( pt->
v[i] == ip1 || pt->
v[i] == ip2 || pt->
v[i] == ip3 || pt->
v[i] == ip4 ) nb++;
168 static int8_t mmgWarn0=0;
176 printf(
" ** exhaustive search of point location.\n");
180 for(kk=1; kk<=
mesh->
nt; kk++) {
188 fprintf(stderr,
"\n ## Error: %s: unable to find triangle"
189 " for at least vertex %" MMG5_PRId
".\n",__func__,k);
210 MMG5_int k,kk,ns,nus,nu,nud;
212 static int8_t mmgWarn0=0,mmgWarn1=0,mmgWarn2=0;
216 for(k=1; k<=
mesh->
np-4; k++) {
226 mmgWarn1 = mmgWarn2 = 0;
227 for(k=1; k<=
mesh->
np-4; k++) {
229 if(ppt->
flag != flag)
continue;
245 fprintf(stderr,
"\n ## Warning: %s: unable to insert "
246 "at least 1 vertex. (%" MMG5_PRId
")\n",__func__,k);
256 fprintf(stderr,
"\n ## Warning: %s: unable to"
257 " insert at least 1 point with Delaunay (%" MMG5_PRId
")\n",__func__,k);
268 fprintf(stdout,
" %8" MMG5_PRId
" vertex inserted %8" MMG5_PRId
" not inserted\n",ns,nu+nud);
270 fprintf(stdout,
" unable to insert %8" MMG5_PRId
" vertex : cavity %8" MMG5_PRId
" -- delaunay %8" MMG5_PRId
" \n",nu+nud,nu,nud);
271 }
while (ns && ++iter<maxiter);
273 if(MMG5_abs(nus-ns)) {
275 fprintf(stderr,
"\n ## Warning: %s: unable to"
276 " insert %8" MMG5_PRId
" point with Delaunay \n",__func__,MMG5_abs(nus-ns));
277 fprintf(stdout,
" try to insert with splitbar\n");
282 for(k=1; k<=
mesh->
np-4; k++) {
284 if(ppt->
flag != flag)
continue;
296 fprintf(stderr,
"\n ## Warning: %s: unable to"
297 " insert at least 1 point with splitbar (%" MMG5_PRId
")\n",__func__,k);
303 if ( MMG5_abs(nus-ns) ) {
304 fprintf(stderr,
" ## Warning: %s: %" MMG5_PRId
" point(s) not "
305 "inserted. Check your output mesh\n",__func__,MMG5_abs(nus-ns));
324 MMG5_int k,l,iadr,*adja,ped0,ped1,ipil,ncurc,nref;
325 MMG5_int kinit,nt,nsd,ip1,ip2,ip3,ip4,ned,iel;
331 for(k=1 ; k<=
mesh->
nt ; k++)
340 for(k=1; k<=
mesh->
nt; k++) {
342 if ( !
MG_EOK(pt) )
continue;
345 if ( (!kinit) && ( pt->
v[0]==ip1 || pt->
v[1]==ip1 || pt->
v[2]==ip1) ) kinit = k;
364 if( !iel || pt1->
ref == nref )
continue;
372 for(l=1; l<=
mesh->
na; l++) {
374 if( ( ped->
a == ped0 && ped->
b == ped1 ) || ( ped->
b == ped0 && ped->
a == ped1 ) )
break;
376 if ( l <= mesh->na )
continue;
383 while ( ipil <= ncurc );
386 for(k=1; k<=
mesh->
nt; k++) {
388 if ( !
MG_EOK(pt) )
continue;
397 fprintf(stdout,
" %8" MMG5_PRId
" sub-domains\n",nref-1);
412 for(k=1; k<=nt; k++) {
414 if ( !
MG_EOK(pt) )
continue;
416 if ( pt->
ref != 1 )
continue;
421 if ( !adja[i] )
continue;
424 (&
mesh->
adja[3*(iel-1)+1])[voy] = 0;
432 for(k=1 ; k<=nt ; k++) {
434 if ( !
MG_EOK(pt) )
continue;
436 if( !(pt->
v[0]==ip1 || pt->
v[1]==ip1 || pt->
v[2]==ip1 ||
437 pt->
v[0]==ip2 || pt->
v[1]==ip2 || pt->
v[2]==ip2 ||
438 pt->
v[0]==ip3 || pt->
v[1]==ip3 || pt->
v[2]==ip3 ||
439 pt->
v[0]==ip4 || pt->
v[1]==ip4 || pt->
v[2]==ip4 ) )
continue;
444 for(i=0 ; i<3 ; i++) {
445 if(!adja[i])
continue;
448 (&
mesh->
adja[3*(iel-1)+1])[voy] = 0;
462 for(k=1 ; k<=nt ; k++) {
464 if ( !
MG_EOK(pt) )
continue;
465 if ( pt->
ref == nsd )
continue;
471 for (k=1; k<=
mesh->
nt; k++) {
473 if ( !
MG_EOK(pt) )
continue;
474 for (i=0; i<3; i++) {
481 for (k=1; k<=ned; k++) {
483 if ( !ped->
a )
continue;
510 MMG5_int ip1,ip2,ip3,ip4,jel,kel,iadr,*adja;
523 fprintf(stderr,
"\n ## Error: %s: unable to allocate"
524 " a new point.\n",__func__);
536 fprintf(stderr,
"\n ## Error: %s: unable to allocate"
537 " a new point.\n",__func__);
549 fprintf(stderr,
"\n ## Error: %s: unable to allocate a "
550 " new point.\n",__func__);
562 fprintf(stderr,
"\n ## Error: %s: unable to allocate a"
563 " new point.\n",__func__);
568 assert ( ip1 ==
mesh->
np-3 );
569 assert ( ip2 ==
mesh->
np-2 );
570 assert ( ip3 ==
mesh->
np-1 );
571 assert ( ip4 ==
mesh->
np );
577 fprintf(stderr,
"\n ## Error: %s: unable to allocate a"
578 " new element.\n",__func__);
580 printf(
" Exit program.\n");
return 0);
591 fprintf(stderr,
"\n ## Error: %s: unable to allocate"
592 " a new element.\n",__func__);
594 printf(
" Exit program.\n");
return 0);
602 iadr = 3*(jel-1) + 1;
606 iadr = 3*(kel-1) + 1;
614 fprintf(stdout,
" Insertion succeed\n");
618 fprintf(stderr,
"\n ## Error: %s: unable to enforce the boundaries.\n",
624 if ( !MMG5_chkmsh(
mesh,1,0) )
return 0;
MMG5_pMesh MMG5_pSol * sol
int MMG2D_delone(MMG5_pMesh mesh, MMG5_pSol sol, MMG5_int ip, MMG5_int *list, int ilist)
int MMG2D_cavity(MMG5_pMesh mesh, MMG5_pSol sol, MMG5_int ip, MMG5_int *list)
int MMG2D_bdryenforcement(MMG5_pMesh mesh, MMG5_pSol sol)
#define MMG2D_POINT_REALLOC(mesh, sol, ip, wantedGap, law, o, tag)
void MMG5_delEdge(MMG5_pMesh mesh, MMG5_int iel)
MMG5_int MMG2D_isInTriangle(MMG5_pMesh, MMG5_int, double c[2])
MMG5_int MMG2D_findTria(MMG5_pMesh, MMG5_int)
int MMG2D_splitbar(MMG5_pMesh, MMG5_int, MMG5_int)
MMG5_int MMG2D_newPt(MMG5_pMesh mesh, double c[2], uint16_t tag)
int MMG2D_delElt(MMG5_pMesh mesh, MMG5_int iel)
#define MMG2D_TRIA_REALLOC(mesh, jel, wantedGap, law)
void MMG2D_delPt(MMG5_pMesh mesh, MMG5_int ip)
MMG5_int MMG2D_newElt(MMG5_pMesh mesh)
int MMG2D_settagtriangles(MMG5_pMesh mesh, MMG5_pSol sol)
MMG5_int MMG2D_findtrianglestate(MMG5_pMesh mesh, MMG5_int k, MMG5_int ip1, MMG5_int ip2, MMG5_int ip3, MMG5_int ip4, MMG5_int base)
static MMG5_int MMG2D_findTria_exhaust(MMG5_pMesh mesh, MMG5_int k)
int MMG2D_markSD(MMG5_pMesh mesh)
int MMG2D_mmg2d2(MMG5_pMesh mesh, MMG5_pSol sol)
int MMG2D_insertpointdelone(MMG5_pMesh mesh, MMG5_pSol sol)
int MMG2D_removeBBtriangles(MMG5_pMesh mesh)
#define MMG5_SAFE_CALLOC(ptr, size, type, law)
#define MMG5_INCREASE_MEM_MESSAGE()
static const uint8_t MMG5_iprv2[3]
static const uint8_t MMG5_inxt2[6]
#define MMG5_SAFE_FREE(ptr)
Structure to store edges of am MMG mesh.
Structure to store vertices of an MMG mesh.
Structure to store triangles of a MMG mesh.