58 MMG5_int ns,src,k,ip,ip1,ip2;
61 int8_t imax,j,i,i1,i2;
63 static int8_t mmgWarn = 0;
68 if ( met->
size==6 ) chkRidTet=1;
71 for (k=1; k<=
mesh->
ne; k++) {
77 imax = -1; lmax = 0.0;
80 len = MMG5_lenedg(
mesh,met,i,pt);
90 "\n ## Warning: %s: at least 1 tetra with 4 required"
91 " or null edges.\n",__func__);
99 MMG3D_find_bdyface_from_edge(
mesh,pt,imax,&i,&j,&i1,&i2,&ip1,&ip2,&p0,&p1);
107 if (
ier==-1 ) {
return -1; }
108 else if ( !
ier ) {
continue; }
123 if ( !ilist )
continue;
127 else if ( ilist<0 ) {
131 o[0] = 0.5*(p0->
c[0] + p1->
c[0]);
132 o[1] = 0.5*(p0->
c[1] + p1->
c[1]);
133 o[2] = 0.5*(p0->
c[2] + p1->
c[2]);
151 if ( met && met->
m ) {
152 ier = MMG5_intmet(
mesh,met,k,imax,ip,0.5);
168 fprintf(stderr,
"\n ## Error: %s: unable to split.\n",__func__);
171 else if (
ier == 0 ||
ier == 2 ) {
199 static int8_t mmgWarn = 0;
202 for (k=1; k<=
mesh->
ne; k++) {
208 imin = -1; lmin = DBL_MAX;
209 for (i=0; i<6; i++) {
211 len = MMG5_lenedg(
mesh,met,i,pt);
221 "\n ## Warning: %s: at least 1 tetra with 4 required"
222 " or null edges.\n",__func__);
260 MMG5_int nf,nnf,nnm,nm,nnc,nc,nns,ns;
264 it = nnc = nns = nnf = nnm = warn = 0;
270 fprintf(stderr,
"\n ## Error: %s: unable to complete mesh."
271 " Exit program.\n",__func__);
284 fprintf(stderr,
"\n ## Error: %s: unable to complete mesh."
285 " Exit program.\n",__func__);
292 nm =
MMG5_movtet(
mesh,met,NULL,
MMG3D_MAXKAL,
MMG3D_MAXKAL,1,0,0,0,1,
mesh->
mark-2);
294 fprintf(stderr,
"\n ## Error: %s: unable to improve mesh."
295 " Exiting.\n",__func__);
304 fprintf(stderr,
"\n ## Error: %s: unable to improve mesh."
305 " Exiting.\n",__func__);
312 fprintf(stderr,
"\n ## Error: %s: unable to improve mesh."
313 " Exiting.\n",__func__);
325 fprintf(stdout,
" %8" MMG5_PRId
" splitted, %8" MMG5_PRId
" collapsed, %8" MMG5_PRId
" swapped, %8" MMG5_PRId
" moved\n",ns,nc,nf,nm);
326 if ( ns < 10 && MMG5_abs(nc-ns) < 3 )
break;
327 else if ( it > 3 && MMG5_abs(nc-ns) < 0.3 *
MG_MAX(nc,ns) )
break;
329 while( ++it < maxit && nc+ns > 0 );
332 fprintf(stderr,
"\n ## Error: %s: unable to allocate a new point in last"
333 " call of MMG5_adpspl.\n",__func__);
336 fprintf(stderr,
"\n ## Error: %s: uncomplete mesh."
337 " Exiting\n",__func__ );
358 nm =
MMG5_movtet(
mesh,met,NULL,
MMG3D_MAXKAL,
MMG3D_MAXKAL,1,1,1,1,0,
mesh->
mark-2);
360 fprintf(stderr,
"\n ## Error: %s: unable to improve mesh.\n",
371 fprintf(stderr,
"\n ## Error: %s: unable to improve mesh."
372 " Exiting.\n",__func__);
379 fprintf(stderr,
"\n ## Error: %s: Unable to improve mesh."
380 " Exiting.\n",__func__);
388 fprintf(stdout,
"%8" MMG5_PRId
" swapped, %8" MMG5_PRId
" moved\n",nf,nm);
391 while( ++it < maxit && /*nw+*/nm+nf > 0 );
394 nm =
MMG5_movtet(
mesh,met,NULL,
MMG3D_MAXKAL,
MMG3D_MAXKAL,1,1,1,1,3,
mesh->
mark-2);
396 fprintf(stderr,
"\n ## Error: %s: unable to improve mesh.\n",
406 fprintf(stdout,
" %8" MMG5_PRId
" moved\n",nm);
411 fprintf(stdout,
" %8" MMG5_PRId
" splitted, %8" MMG5_PRId
" collapsed, %8" MMG5_PRId
" swapped, %8" MMG5_PRId
" moved,"
413 nns,nnc,nnf,nnm,it+it1);
431 fprintf(stdout,
" ** MESH ANALYSIS\n");
434 fprintf(stderr,
"\n ## Non orientable implicit surface before remeshing. Exit program.\n");
440 fprintf(stdout,
" ** GEOMETRIC MESH\n");
443 fprintf(stderr,
"\n ## Unable to split mesh. Exiting.\n");
449 if ( getenv(
"MMG_SAVE_ANATET1") ) {
450 printf(
" ## WARNING: EXIT AFTER ANATET-1."
451 " (MMG_SAVE_ANATET1 env variable is exported).\n");
461 fprintf(stdout,
" ** COMPUTATIONAL MESH\n");
464 if ( !MMG3D_defsiz(
mesh,met) ) {
465 fprintf(stderr,
"\n ## Metric undefined. Exit program.\n");
471 if ( getenv(
"MMG_SAVE_DEFSIZ") ) {
472 printf(
" ## WARNING: EXIT AFTER DEFSIZ."
473 " (MMG_SAVE_DEFSIZ env variable is exported).\n");
481 if ( getenv(
"MMG_SAVE_GRADSIZ") ) {
482 printf(
" ## WARNING: EXIT AFTER GRADSIZ."
483 " (MMG_SAVE_GRADSIZ env variable is exported).\n");
488 if ( !MMG3D_gradsiz(
mesh,met) ) {
489 fprintf(stderr,
"\n ## Gradation problem. Exit program.\n");
494 MMG3D_gradsizreq(
mesh,met);
501 fprintf(stderr,
"\n ## Unable to split mesh. Exiting.\n");
507 if ( getenv(
"MMG_SAVE_ANATET2") ) {
508 printf(
" ## WARNING: EXIT AFTER ANATET-2."
509 " (MMG_SAVE_ANATET2 env variable is exported).\n");
518 puts(
"---------------------------Fin anatet---------------------");
522 fprintf(stderr,
"\n ## Unable to adapt. Exit program.\n");
527 puts(
"---------------------Fin adptet-----------------");
532 fprintf(stderr,
"\n ## Topology of mesh unsuited for fem computations. Exit program.\n");
537 fprintf(stdout,
"\n ## Warning: %s: Non orientable implicit surface after remeshing.\n",__func__);
int MMG5_coquil(MMG5_pMesh mesh, MMG5_int start, int ia, int64_t *list, int8_t *isbdy)
int MMG5_chkfemtopo(MMG5_pMesh mesh)
void MMG5_gradation_info(MMG5_pMesh mesh)
API headers and documentation for the mmg3d library, for volumetric meshes in 3D.
#define MMG3D_SSWAPIMPROVE
int MMG5_split1b(MMG5_pMesh, MMG5_pSol, int64_t *, int, MMG5_int, int, int8_t, int8_t)
MMG5_int MMG5_swpmsh(MMG5_pMesh mesh, MMG5_pSol met, MMG3D_pPROctree PROctree, int)
MMG5_int MMG5_swptet(MMG5_pMesh mesh, MMG5_pSol met, double, double, MMG3D_pPROctree, int, MMG5_int)
MMG5_int MMG5_movtet(MMG5_pMesh mesh, MMG5_pSol met, MMG3D_pPROctree PROctree, double clickSurf, double clickVol, int moveVol, int improveSurf, int improveVolSurf, int improveVol, int maxit, MMG5_int testmark)
void MMG3D_find_bdyface_from_edge(MMG5_pMesh, MMG5_pTetra, int8_t, int8_t *, int8_t *, int8_t *, int8_t *, MMG5_int *, MMG5_int *, MMG5_pPoint *, MMG5_pPoint *)
int MMG5_anatet(MMG5_pMesh mesh, MMG5_pSol met, int8_t typchk, int patternMode)
int MMG3D_simbulgept(MMG5_pMesh mesh, MMG5_pSol met, int64_t *list, int ilist, MMG5_int)
void MMG3D_delPt(MMG5_pMesh mesh, MMG5_int ip)
int MMG3D_chkmani(MMG5_pMesh mesh)
MMG5_int MMG3D_newPt(MMG5_pMesh mesh, double c[3], uint16_t tag, MMG5_int src)
int MMG3D_splsurfedge(MMG5_pMesh, MMG5_pSol, MMG5_int, MMG5_pTetra, MMG5_pxTetra, int8_t, int8_t, int8_t, int *)
int MMG3D_tetraQual(MMG5_pMesh mesh, MMG5_pSol met, int8_t metRidTyp)
int MMG3D_outqua(MMG5_pMesh mesh, MMG5_pSol met)
#define MMG3D_POINT_REALLOC(mesh, sol, ip, wantedGap, law, o, tag, src)
int MMG3D_adpcoledg(MMG5_pMesh, MMG5_pSol, MMG3D_pPROctree *, MMG5_int, int8_t, double, MMG5_int *)
int MMG5_scotchCall(MMG5_pMesh mesh, MMG5_pSol met, MMG5_pSol fields, MMG5_int *permNodGlob)
static MMG5_int MMG5_adpspl(MMG5_pMesh mesh, MMG5_pSol met, int *warn)
static int MMG5_adptet(MMG5_pMesh mesh, MMG5_pSol met, MMG5_int *permNodGlob)
static MMG5_int MMG5_adpcol(MMG5_pMesh mesh, MMG5_pSol met)
int MMG5_mmg3d1_pattern(MMG5_pMesh mesh, MMG5_pSol met, MMG5_int *permNodGlob)
#define MMG5_INCREASE_MEM_MESSAGE()
#define MG_GET(flag, bit)
Structure to store vertices of an MMG mesh.
Structure to store tetrahedra of an MMG mesh.
Structure to store additional information for the surface tetrahedra of an MMG mesh.