115 fprintf(stderr,
"\n ## Warning: %s: old solution deletion.\n",__func__);
118 fprintf(stderr,
"\n ## Error: %s: mmg3d need a solution imposed on vertices.\n",
137 fprintf(stderr,
"\n ## Error: %s: type of solution not yet implemented.\n",
158 MMG5_int nentities,
int *typSol) {
165 fprintf(stderr,
"\n ## Warning: %s: old solutions array deletion.\n",
178 for ( j=0; j<nsols; ++j ) {
183 sprintf(data,
"sol_%d",j);
188 sprintf(data,
"sol_%d.o",j);
194 fprintf(stderr,
"\n ## Error: %s: unable to set the size of the"
195 " solution num %d.\n",__func__,j);
217 MMG5_int nt, MMG5_int nquad, MMG5_int na ) {
221 fprintf(stderr,
"\n ## Warning: %s: old mesh deletion.\n",__func__);
224 fprintf(stderr,
" ** MISSING DATA:\n");
225 fprintf(stderr,
" Your mesh must contains at least points.\n");
229 fprintf(stderr,
" ** WARNING:\n");
230 fprintf(stderr,
" Your mesh don't contains tetrahedra.\n");
261 MMG5_int nt, MMG5_int nquad, MMG5_int na ) {
272 fprintf(stderr,
"\n ## Error: %s: not enough memory %d\n",__func__,
288 if ( typEntity != NULL )
291 if ( typSol != NULL ) {
292 if (
sol->size == 1 )
294 else if (
sol->size == 3 )
296 else if (
sol->size == 6 )
311 MMG5_int* np,
int* typSol) {
316 fprintf(stderr,
"\n ## Error: %s: your mesh structure must be allocated"
317 " and filled\n",__func__);
327 if ( typSol != NULL ) {
328 typSol[j] = psl->
type;
340 MMG5_int* nt, MMG5_int * nquad, MMG5_int* na) {
346 if ( nprism != NULL )
361 fprintf(stderr,
"\n ## Error: %s: you must set the number of points with the",
363 fprintf(stderr,
" MMG3D_Set_meshSize function before setting vertices in mesh.\n");
368 fprintf(stderr,
"\n ## Error: %s: unable to allocate a new point.\n",__func__);
369 fprintf(stderr,
" max number of points: %" MMG5_PRId
"\n",
mesh->
npmax);
375 fprintf(stderr,
"\n ## Error: %s: attempt to set new vertex at position %" MMG5_PRId
".",
377 fprintf(stderr,
" Overflow of the given number of vertices: %" MMG5_PRId
"\n",
mesh->
np);
378 fprintf(stderr,
"\n ## Check the mesh size, its compactness or the position");
379 fprintf(stderr,
" of the vertex.\n");
395 int* isCorner,
int* isRequired) {
400 fprintf(stderr,
"\n ## Warning: %s: reset the internal counter of points.\n",
402 fprintf(stderr,
" You must pass here exactly one time (the first time ");
403 fprintf(stderr,
"you call the MMG3D_Get_vertex function).\n");
404 fprintf(stderr,
" If not, the number of call of this function");
405 fprintf(stderr,
" exceed the number of points: %" MMG5_PRId
"\n ",
mesh->
np);
412 fprintf(stderr,
"\n ## Error: %s: unable to get point.\n",__func__);
413 fprintf(stderr,
" The number of call of MMG3D_Get_vertex function");
414 fprintf(stderr,
" can not exceed the number of points: %" MMG5_PRId
"\n ",
mesh->
np);
422 int* isCorner,
int* isRequired, MMG5_int idx) {
424 if ( idx < 1 || idx >
mesh->
np ) {
425 fprintf(stderr,
"\n ## Error: %s: unable to get point at position %" MMG5_PRId
".\n",
427 fprintf(stderr,
" Your vertices numbering goes from 1 to %" MMG5_PRId
"\n",
mesh->
np);
437 if ( isCorner != NULL ) {
444 if ( isRequired != NULL ) {
465 ppt->
c[0] = vertices[j];
466 ppt->
c[1] = vertices[j+1];
467 ppt->
c[2] = vertices[j+2];
474 ppt->
ref = refs[i-1];
482 int* areCorners,
int* areRequired) {
491 vertices[j] = ppt->
c[0];
492 vertices[j+1] = ppt->
c[1];
493 vertices[j+2] = ppt->
c[2];
499 if ( areCorners !=NULL ) {
506 if ( areRequired != NULL ) {
525 fprintf(stderr,
"\n ## Error: %s: You must set the number of elements with the",
527 fprintf(stderr,
" MMG3D_Set_meshSize function before setting elements in mesh\n");
532 fprintf(stderr,
"\n ## Error: %s: unable to allocate a new element.\n",
534 fprintf(stderr,
" max number of element: %" MMG5_PRId
"\n",
mesh->
nemax);
540 fprintf(stderr,
"\n ## Error: %s: attempt to set new tetrahedron at position %" MMG5_PRId
".",
542 fprintf(stderr,
" Overflow of the given number of tetrahedron: %" MMG5_PRId
"\n",
mesh->
ne);
543 fprintf(stderr,
"\n ## Check the mesh size, its compactness or the position");
544 fprintf(stderr,
" of the tetrahedron.\n");
553 pt->
ref = MMG5_abs(ref);
562 fprintf(stderr,
"\n ## Error: %s: tetrahedron %" MMG5_PRId
" has volume null.\n",
564 for ( ip=0; ip<4; ip++ ) {
566 for ( j=0; j<3; j++ ) {
567 if ( fabs(ppt->
c[j])>0. ) {
568 fprintf(stderr,
" Check that you don't have a sliver tetrahedron.\n");
573 fprintf(stderr,
" All vertices have zero coordinates.");
574 fprintf(stderr,
" Check that you have set the vertices before the tetrahedra.\n");
577 else if ( vol < 0.0 ) {
590 MMG5_int* ref,
int* isRequired) {
595 fprintf(stderr,
"\n ## Warning: %s: reset the internal counter of"
596 " tetrahedra.\n",__func__);
597 fprintf(stderr,
" You must pass here exactly one time (the first time ");
598 fprintf(stderr,
"you call the MMG3D_Get_tetrahedron function).\n");
599 fprintf(stderr,
" If not, the number of call of this function");
600 fprintf(stderr,
" exceed the number of tetrahedron: %" MMG5_PRId
"\n ",
mesh->
ne);
607 fprintf(stderr,
"\n ## Error: %s: unable to get tetra.\n",__func__);
608 fprintf(stderr,
" The number of call of MMG3D_Get_tetrahedron function");
609 fprintf(stderr,
" can not exceed the number of tetra: %" MMG5_PRId
"\n ",
mesh->
ne);
621 if ( isRequired != NULL ) {
644 pt->
v[1] = tetra[j+1];
645 pt->
v[2] = tetra[j+2];
646 pt->
v[3] = tetra[j+3];
649 pt->
ref = MMG5_abs(refs[i-1]);
659 fprintf(stderr,
"\n ## Error: %s: tetrahedron %" MMG5_PRId
" has volume null.\n",
662 for ( ip=0; ip<4; ip++ ) {
664 for ( j=0; j<3; j++ ) {
665 if ( fabs(ppt->
c[j])>0. ) {
666 fprintf(stderr,
" Check that you don't have a sliver tetrahedron.\n");
672 fprintf(stderr,
" All vertices have zero coordinates.");
673 fprintf(stderr,
" Check that you have set the vertices before the tetrahedra.\n");
676 else if ( vol < 0.0 ) {
698 tetra[j+1] = pt->
v[1];
699 tetra[j+2] = pt->
v[2];
700 tetra[j+3] = pt->
v[3];
702 refs[i-1] = pt->
ref ;
703 if ( areRequired != NULL ) {
705 areRequired[i-1] = 1;
707 areRequired[i-1] = 0;
714 MMG5_int v3, MMG5_int v4, MMG5_int v5, MMG5_int ref, MMG5_int pos) {
718 fprintf(stderr,
"\n ## Error: %s: You must set the number of prisms with the",
720 fprintf(stderr,
" MMG3D_Set_meshSize function before setting elements in mesh\n");
725 fprintf(stderr,
"\n ## Error: %s: attempt to set new prism at position %" MMG5_PRId
".",
727 fprintf(stderr,
" Overflow of the given number of prism: %" MMG5_PRId
"\n",
mesh->
nprism);
728 fprintf(stderr,
"\n ## Check the mesh size, its compactness or the position");
729 fprintf(stderr,
" of the prism.\n");
754 MMG5_int* v4, MMG5_int* v5, MMG5_int* ref,
int* isRequired) {
755 static MMG5_int npri = 0;
760 fprintf(stderr,
"\n ## Warning: %s: reset the internal counter of prisms.\n",
762 fprintf(stderr,
" You must pass here exactly one time (the first time ");
763 fprintf(stderr,
"you call the MMG3D_Get_prism function).\n");
764 fprintf(stderr,
" If not, the number of call of this function");
765 fprintf(stderr,
" exceed the number of prisms: %" MMG5_PRId
"\n ",
mesh->
nprism);
772 fprintf(stderr,
"\n ## Error: %s: unable to get prism.\n",__func__);
773 fprintf(stderr,
" The number of call of MMG3D_Get_prism function");
774 fprintf(stderr,
" can not exceed the number of prism: %" MMG5_PRId
"\n ",
mesh->
nprism);
789 if ( isRequired != NULL ) {
807 pp->
v[0] = prisms[j];
808 pp->
v[1] = prisms[j+1];
809 pp->
v[2] = prisms[j+2];
810 pp->
v[3] = prisms[j+3];
811 pp->
v[4] = prisms[j+4];
812 pp->
v[5] = prisms[j+5];
837 prisms[j] = pp->
v[0];
838 prisms[j+2] = pp->
v[1];
839 prisms[j+1] = pp->
v[2];
840 prisms[j+3] = pp->
v[3];
841 prisms[j+4] = pp->
v[4];
842 prisms[j+5] = pp->
v[5];
845 refs[i-1] = pp->
ref ;
846 if ( areRequired != NULL ) {
848 areRequired[i-1] = 1;
850 areRequired[i-1] = 0;
861 fprintf(stderr,
"\n ## Error: %s: You must set the number of triangles"
862 " with the",__func__);
863 fprintf(stderr,
" MMG3D_Set_meshSize function before setting triangles in mesh\n");
868 fprintf(stderr,
"\n ## Error: %s: unable to allocate a new triangle.\n",
870 fprintf(stderr,
" max number of triangle: %" MMG5_PRId
"\n",
mesh->
ntmax);
876 fprintf(stderr,
"\n ## Error: %s: attempt to set new triangle at"
877 " position %" MMG5_PRId
".",__func__,pos);
878 fprintf(stderr,
" Overflow of the given number of triangles: %" MMG5_PRId
"\n",
mesh->
nt);
879 fprintf(stderr,
"\n ## Check the mesh size, its compactness or the position");
880 fprintf(stderr,
" of the triangle.\n");
899 fprintf(stderr,
"\n ## Warning: %s: reset the internal counter of"
900 " triangles.\n",__func__);
901 fprintf(stderr,
" You must pass here exactly one time (the first time ");
902 fprintf(stderr,
"you call the MMG3D_Get_triangle function).\n");
903 fprintf(stderr,
" If not, the number of call of this function");
904 fprintf(stderr,
" exceed the number of triangles: %" MMG5_PRId
"\n ",
mesh->
nt);
911 fprintf(stderr,
"\n ## Error: %s: unable to get triangle.\n",__func__);
912 fprintf(stderr,
" The number of call of MMG3D_Get_triangle function");
913 fprintf(stderr,
" can not exceed the number of triangles: %" MMG5_PRId
"\n ",
mesh->
nt);
924 if ( isRequired != NULL ) {
943 ptt->
v[0] = tria[j] ;
944 ptt->
v[1] = tria[j+2];
945 ptt->
v[2] = tria[j+1];
947 ptt->
ref = refs[i-1];
961 tria[j+1] = ptt->
v[1];
962 tria[j+2] = ptt->
v[2];
965 refs[i-1] = ptt->
ref ;
966 if ( areRequired != NULL ) {
969 areRequired[i-1] = 1;
971 areRequired[i-1] = 0;
978 MMG5_int ref,MMG5_int pos) {
981 fprintf(stderr,
"\n ## Error: %s: You must set the number of quadrilaterals"
982 " with the",__func__);
983 fprintf(stderr,
" MMG3D_Set_meshSize function before setting quadrilaterals in mesh\n");
988 fprintf(stderr,
"\n ## Error: %s: attempt to set new quadrilateral"
989 " at position %" MMG5_PRId
".",__func__,pos);
990 fprintf(stderr,
" Overflow of the given number of quadrilaterals: %" MMG5_PRId
"\n",
mesh->
nquad);
991 fprintf(stderr,
"\n ## Check the mesh size, its compactness or the position");
992 fprintf(stderr,
" of the quadrilateral.\n");
1006 MMG5_int* ref,
int* isRequired) {
1008 static MMG5_int nqi = 0;
1013 fprintf(stderr,
"\n ## Warning: %s: reset the internal counter"
1014 " of quadrilaterals.\n",__func__);
1015 fprintf(stderr,
" You must pass here exactly one time (the first time ");
1016 fprintf(stderr,
"you call the MMG3D_Get_quadrilateral function).\n");
1017 fprintf(stderr,
" If not, the number of call of this function");
1018 fprintf(stderr,
" exceed the number of quadrilaterals: %" MMG5_PRId
"\n ",
mesh->
nquad);
1025 fprintf(stderr,
"\n ## Error: %s: unable to get quadrilateral.\n",__func__);
1026 fprintf(stderr,
" The number of call of MMG3D_Get_quadrilateral function");
1027 fprintf(stderr,
" can not exceed the number of quadrilaterals: %" MMG5_PRId
"\n ",
mesh->
nquad);
1039 if ( isRequired != NULL ) {
1058 pq->
v[0] = quads[j] ;
1059 pq->
v[1] = quads[j+1];
1060 pq->
v[2] = quads[j+2];
1061 pq->
v[3] = quads[j+3];
1063 pq->
ref = refs[i-1];
1076 quads[j] = pq->
v[0];
1077 quads[j+1] = pq->
v[1];
1078 quads[j+2] = pq->
v[2];
1079 quads[j+3] = pq->
v[3];
1082 refs[i-1] = pq->
ref ;
1083 if ( areRequired != NULL ) {
1086 areRequired[i-1] = 1;
1088 areRequired[i-1] = 0;
1097 fprintf(stderr,
"\n ## Error: %s: You must set the number of edges with"
1099 fprintf(stderr,
" MMG3D_Set_meshSize function before setting edges in mesh\n");
1103 fprintf(stderr,
"\n ## Error: %s: unable to allocate a new edge.\n",
1105 fprintf(stderr,
" max number of edge: %" MMG5_PRId
"\n",
mesh->
namax);
1110 fprintf(stderr,
"\n ## Error: %s: attempt to set new edge at position %" MMG5_PRId
".",
1112 fprintf(stderr,
" Overflow of the given number of edges: %" MMG5_PRId
"\n",
mesh->
na);
1113 fprintf(stderr,
"\n ## Check the mesh size, its compactness or the position");
1114 fprintf(stderr,
" of the edge.\n");
1127 ,
int* isRidge,
int* isRequired) {
1132 fprintf(stderr,
"\n ## Warning: %s: reset the internal counter of edges.\n",
1134 fprintf(stderr,
" You must pass here exactly one time (the first time ");
1135 fprintf(stderr,
"you call the MMG3D_Get_edge function).\n");
1136 fprintf(stderr,
" If not, the number of call of this function");
1137 fprintf(stderr,
" exceed the number of edges: %" MMG5_PRId
"\n ",
mesh->
na);
1144 fprintf(stderr,
"\n ## Error: %s: unable to get edge.\n",__func__);
1145 fprintf(stderr,
" The number of call of MMG3D_Get_edge function");
1146 fprintf(stderr,
" can not exceed the number of edges: %" MMG5_PRId
"\n ",
mesh->
na);
1155 if ( isRidge != NULL ) {
1162 if ( isRequired != NULL ) {
1175 for (i=1;i<=
mesh->
na;i++)
1192 for (i=1;i<=
mesh->
na;i++)
1201 if ( areRidges != NULL ) {
1208 if ( areRequired != NULL ) {
1210 areRequired[i-1] = 1;
1212 areRequired[i-1] = 0;
1220 assert ( k <= mesh->np );
1226 assert ( k <= mesh->np );
1232 assert ( k <= mesh->np );
1239 assert ( k <= mesh->np );
1245 assert ( k <= mesh->ne );
1251 assert ( k <= mesh->ne );
1259 for ( k=0; k<nreq; ++k ){
1269 for ( k=0; k<nreq; ++k ){
1277 assert ( k <= mesh->nt );
1285 assert ( k <= mesh->nt );
1295 for ( k=0; k<nreq; ++k ){
1306 for ( k=0; k<nreq; ++k ){
1315 assert ( k <= mesh->nt );
1323 assert ( k <= mesh->nt );
1333 for ( k=0; k<npar; ++k ){
1344 for ( k=0; k<npar; ++k ){
1353 assert ( k <= mesh->na );
1359 assert ( k <= mesh->na );
1365 assert ( k <= mesh->na );
1371 assert ( k <= mesh->na );
1378 assert ( k <= mesh->np );
1390 assert ( k <= mesh->np );
1402 if ( k < 1 || k >
mesh->
ne ) {
1403 fprintf(stderr,
"\n ## Error: %s: unable to access to tetra %" MMG5_PRId
".\n",
1405 fprintf(stderr,
" Tetra numbering goes from 1 to %" MMG5_PRId
"\n",
mesh->
ne);
1411 if ( (!met) || (!met->
m) || met->
size==1 ) {
1433 fprintf(stderr,
"\n ## Error: %s: You must set the number of"
1434 " solution with the",__func__);
1435 fprintf(stderr,
" MMG3D_Set_solSize function before setting values");
1436 fprintf(stderr,
" in solution structure \n");
1440 fprintf(stderr,
"\n ## Error: %s: unable to set a new solution.\n",__func__);
1441 fprintf(stderr,
" Minimal index of the solution position must be 1.\n");
1444 if ( pos >= met->
npmax ) {
1445 fprintf(stderr,
"\n ## Error: %s: unable to set a new solution.\n",__func__);
1446 fprintf(stderr,
" max number of solutions: %" MMG5_PRId
"\n",met->
npmax);
1450 if ( pos > met->
np ) {
1451 fprintf(stderr,
"\n ## Error: %s: attempt to set new solution at"
1452 " position %" MMG5_PRId
".",__func__,pos);
1453 fprintf(stderr,
" Overflow of the given number of solutions: %" MMG5_PRId
"\n",met->
np);
1454 fprintf(stderr,
"\n ## Check the solution size, its compactness or the position");
1455 fprintf(stderr,
" of the solution.\n");
1468 if ( met->
npi == met->
np ) {
1471 fprintf(stderr,
"\n ## Warning: %s: reset the internal counter of points.\n",
1473 fprintf(stderr,
" You must pass here exactly one time (the first time ");
1474 fprintf(stderr,
"you call the MMG3D_Get_scalarSol function).\n");
1475 fprintf(stderr,
" If not, the number of call of this function");
1476 fprintf(stderr,
" exceed the number of points: %" MMG5_PRId
"\n ",met->
np);
1482 if ( met->
npi > met->
np ) {
1483 fprintf(stderr,
"\n ## Error: %s: unable to get solution.\n",__func__);
1484 fprintf(stderr,
" The number of call of MMG3D_Get_scalarSol function");
1485 fprintf(stderr,
" can not exceed the number of points: %" MMG5_PRId
"\n ",met->
np);
1489 *s = met->
m[met->
npi];
1498 fprintf(stderr,
"\n ## Error: %s: You must set the number of solution"
1499 " with the",__func__);
1500 fprintf(stderr,
" MMG3D_Set_solSize function before setting values");
1501 fprintf(stderr,
" in solution structure \n");
1505 for ( k=0; k<met->
np; ++k )
1514 for ( k=0; k<met->
np; ++k )
1523 fprintf(stderr,
"\n ## Error: %s: You must set the number of solution"
1524 " with the",__func__);
1525 fprintf(stderr,
" MMG3D_Set_solSize function before setting values");
1526 fprintf(stderr,
" in solution structure \n");
1530 fprintf(stderr,
"\n ## Error: %s: unable to set a new solution.\n",__func__);
1531 fprintf(stderr,
" Minimal index of the solution position must be 1.\n");
1534 if ( pos >= met->
npmax ) {
1535 fprintf(stderr,
"\n ## Error: %s: unable to set a new solution.\n",__func__);
1536 fprintf(stderr,
" max number of solutions: %" MMG5_PRId
"\n",met->
npmax);
1540 if ( pos > met->
np ) {
1541 fprintf(stderr,
"\n ## Error: %s: attempt to set new solution at"
1542 " position %" MMG5_PRId
".",__func__,pos);
1543 fprintf(stderr,
" Overflow of the given number of solutions: %" MMG5_PRId
"\n",met->
np);
1544 fprintf(stderr,
"\n ## Check the solution size, its compactness or the position");
1545 fprintf(stderr,
" of the solution.\n");
1550 met->
m[3*pos+1] = vy;
1551 met->
m[3*pos+2] = vz;
1561 if ( met->
npi == met->
np ) {
1564 fprintf(stderr,
"\n ## Warning: %s: reset the internal counter of points.\n",
1566 fprintf(stderr,
" You must pass here exactly one time (the first time ");
1567 fprintf(stderr,
"you call the MMG3D_Get_vectorSol function).\n");
1568 fprintf(stderr,
" If not, the number of call of this function");
1569 fprintf(stderr,
" exceed the number of points: %" MMG5_PRId
"\n ",met->
np);
1575 if ( met->
npi > met->
np ) {
1576 fprintf(stderr,
"\n ## Error: %s: unable to get solution.\n",__func__);
1577 fprintf(stderr,
" The number of call of MMG3D_Get_vectorSol function");
1578 fprintf(stderr,
" can not exceed the number of points: %" MMG5_PRId
"\n ",met->
np);
1582 *vx = met->
m[3*met->
npi];
1583 *vy = met->
m[3*met->
npi+1];
1584 *vz = met->
m[3*met->
npi+2];
1594 fprintf(stderr,
"\n ## Error: %s: You must set the number of solution"
1595 " with the",__func__);
1596 fprintf(stderr,
" MMG3D_Set_solSize function before setting values");
1597 fprintf(stderr,
" in solution structure \n");
1601 for ( k=0; k<met->
np; ++k ) {
1616 for ( k=0; k<met->
np; ++k ) {
1628 double m22,
double m23,
double m33, MMG5_int pos) {
1631 fprintf(stderr,
"\n ## Error: %s: You must set the number of solution"
1632 " with the",__func__);
1633 fprintf(stderr,
" MMG3D_Set_solSize function before setting values");
1634 fprintf(stderr,
" in solution structure \n");
1638 fprintf(stderr,
"\n ## Error: %s: unable to set a new solution.\n",
1640 fprintf(stderr,
" Minimal index of the solution position must be 1.\n");
1643 if ( pos >= met->
npmax ) {
1644 fprintf(stderr,
"\n ## Error: %s: unable to set a new solution.\n",__func__);
1645 fprintf(stderr,
" max number of solutions: %" MMG5_PRId
"\n",met->
npmax);
1649 if ( pos > met->
np ) {
1650 fprintf(stderr,
"\n ## Error: %s: attempt to set new solution at "
1651 "position %" MMG5_PRId
".",__func__,pos);
1652 fprintf(stderr,
" Overflow of the given number of solutions: %" MMG5_PRId
"\n",met->
np);
1653 fprintf(stderr,
"\n ## Check the solution size, its compactness or the position");
1654 fprintf(stderr,
" of the solution.\n");
1658 met->
m[6*pos] = m11;
1659 met->
m[6*pos+1] = m12;
1660 met->
m[6*pos+2] = m13;
1661 met->
m[6*pos+3] = m22;
1662 met->
m[6*pos+4] = m23;
1663 met->
m[6*pos+5] = m33;
1670 double *m22,
double *m23,
double *m33) {
1674 if ( met->
npi == met->
np ) {
1677 fprintf(stderr,
"\n ## Warning: %s: reset the internal counter of points.\n",
1679 fprintf(stderr,
" You must pass here exactly one time (the first time ");
1680 fprintf(stderr,
"you call the MMG3D_Get_tensorSol function).\n");
1681 fprintf(stderr,
" If not, the number of call of this function");
1682 fprintf(stderr,
" exceed the number of points: %" MMG5_PRId
"\n ",met->
np);
1688 if ( met->
npi > met->
np ) {
1689 fprintf(stderr,
"\n ## Error: %s: unable to get solution.\n",__func__);
1690 fprintf(stderr,
" The number of call of MMG3D_Get_tensorSol function");
1691 fprintf(stderr,
" can not exceed the number of points: %" MMG5_PRId
"\n ",met->
np);
1695 *m11 = met->
m[6*met->
npi];
1696 *m12 = met->
m[6*met->
npi+1];
1697 *m13 = met->
m[6*met->
npi+2];
1698 *m22 = met->
m[6*met->
npi+3];
1699 *m23 = met->
m[6*met->
npi+4];
1700 *m33 = met->
m[6*met->
npi+5];
1710 fprintf(stderr,
"\n ## Error: %s: You must set the number of"
1711 " solution with the",__func__);
1712 fprintf(stderr,
" MMG3D_Set_solSize function before setting values");
1713 fprintf(stderr,
" in solution structure \n");
1717 for ( k=0; k<met->
np; ++k ) {
1735 for ( k=0; k<met->
np; ++k ) {
1756 switch ( psl->
type ) {
1770 fprintf(stderr,
"\n ## Error: %s: unexpected type of solution: %s.\n",
1785 switch ( psl->
type ) {
1799 fprintf(stderr,
"\n ## Error: %s: unexpected type of solution: %s\n",
1813 switch ( psl->
type ) {
1827 fprintf(stderr,
"\n ## Error: %s: unexpected type of solution: %s.\n",
1841 switch ( psl->
type ) {
1855 fprintf(stderr,
"\n ## Error: %s: unexpected type of solution: %s\n",
1867 for (k=1; k<=
mesh->
ne; k++) {
1882 fprintf(stderr,
"\n ## Error: %s: if you don't use the MMG3D_loadMesh"
1883 " function,",__func__);
1884 fprintf(stderr,
" you must call the MMG3D_Set_meshSize function to have a");
1885 fprintf(stderr,
" valid mesh.\n");
1886 fprintf(stderr,
" Missing datas.\n");
1890 if ( met->
npi != met->
np ) {
1891 fprintf(stderr,
"\n ## Error: %s: if you don't use the MMG3D_loadSol"
1892 " function,",__func__);
1893 fprintf(stderr,
" you must call the MMG3D_Set_solSize function to have a");
1894 fprintf(stderr,
" valid solution.\n");
1895 fprintf(stderr,
" Missing datas.\n");
1903 fprintf(stderr,
" ** MISSING DATA.\n");
1904 fprintf(stderr,
" Check that your mesh contains points and tetrahedra.\n");
1905 fprintf(stderr,
" Exit program.\n");
1911 fprintf(stderr,
" ** 3 DIMENSIONAL MESH NEEDED. Exit program.\n");
1914 if ( met->
dim != 3 ) {
1915 fprintf(stderr,
" ** WRONG DIMENSION FOR METRIC. Exit program.\n");
1919 if ( !met ->ver ) met ->
ver = 2;
1931 fprintf(stderr,
"\n ## Warning: %s: skip of all entites with %"MMG5_PRId
1948 }
while( ++k <= mesh->nti );
1956 "triangles",
return 0);
1967 pa->
ref = MMG5_abs(pa->
ref);
1979 pa1->
ref = MMG5_abs(pa1->
ref);
1981 }
while( ++k <= mesh->nai );
1997 for (k=1; k<=
mesh->
ne; k++) {
2008 MMG5_int aux,vv[4],iel;
2015 for ( j=0; j<4; ++j ) {
2016 if ( vv[j] >
mesh->
np ) {
2017 fprintf(stderr,
"\n ## Error: %s: vertex %" MMG5_PRId
" doesn't exist in the mesh.\n",
2019 fprintf(stderr,
" Use the MMG3D_Add_vertex function to add it.\n");
2027 fprintf(stderr,
"\n ## Error: %s: unable to allocate"
2028 " a new element.\n",__func__);
2030 fprintf(stderr,
" Exit program.\n");
2039 pt->
ref = MMG5_abs(ref);
2048 fprintf(stderr,
"\n ## Error: %s: tetrahedron %" MMG5_PRId
": null volume.\n",
2050 for ( ip=0; ip<4; ip++ ) {
2052 for ( j=0; j<3; j++ ) {
2053 if ( fabs(ppt->
c[j])>0. ) {
2054 fprintf(stderr,
" Check that you don't have a sliver tetrahedron.\n");
2059 fprintf(stderr,
" All vertices have zero coordinates.");
2060 fprintf(stderr,
" Check that you have set the vertices before the tetrahedra.\n");
2063 else if ( vol < 0.0 ) {
2066 pt->
v[2] = pt->
v[3];
2088 "larger point table",
2089 fprintf(stderr,
"\n ## Error: %s: unable to allocate"
2090 " a new point\n",__func__);
2094 for (klink=
mesh->
npnil; klink<mesh->npmax-1; klink++)
2100 fprintf(stderr,
"\n ## Error: %s: unable to allocate"
2101 " a new point\n",__func__);
2119 fprintf(stderr,
"\n ## Warning: %s: maximal memory authorized must be"
2120 " strictly positive.\n",__func__);
2121 fprintf(stderr,
" Reset to default value.\n");
2147 fprintf(stderr,
"\n ## Warning: %s: angle detection parameter set"
2148 " to default value\n",__func__);
2172 if ( val < 0 || val > 2 )
2181 fprintf(stderr,
"\n ## Error: %s"
2182 " \"lagrangian motion\" option unavailable (-lag):\n"
2183 " set the USE_ELAS CMake's flag to ON when compiling the mmg3d"
2184 " library to enable this feature.\n",__func__);
2222 fprintf(stderr,
"\n ## Warning: %s: new local parameter values\n",__func__);
2229 printf(
" Exit program.\n");
2245 printf(
" Exit program.\n");
2258 fprintf(stderr,
"\n ## Warning: %s: new multi materials values\n",__func__);
2264 printf(
" Exit program.\n");
2282 fprintf(stderr,
"\n ## Error: %s: unknown type of parameter\n",__func__);
2352 fprintf(stderr,
"\n ## Error: %s: unknown type of parameter\n",__func__);
2370 fprintf(stderr,
"\n ## Warning: hmin value must be strictly lower than hmax one"
2379 fprintf(stderr,
"\n ## Warning: hmin value must be strictly lower than hmax one"
2403 fprintf(stderr,
"\n ## Error: %s: hausdorff number must be strictly"
2404 " positive.\n",__func__);
2424 fprintf(stderr,
"\n ## Error: %s: unknown type of parameter\n", __func__);
2431 double hmin,
double hmax,
double hausd){
2436 fprintf(stderr,
"\n ## Error: %s: You must set the number of local"
2437 " parameters",__func__);
2438 fprintf(stderr,
" with the MMG3D_Set_iparameters function before setting");
2439 fprintf(stderr,
" values in local parameters structure. \n");
2443 fprintf(stderr,
"\n ## Error: %s: unable to set a new local parameter.\n",
2445 fprintf(stderr,
" max number of local parameters: %d\n",
mesh->
info.
npar);
2449 fprintf(stderr,
"\n ## Warning: %s: you must apply your local parameters",
2451 fprintf(stderr,
" on triangles (MMG5_Triangle or %d) or tetrahedron"
2453 fprintf(stderr,
"\n ## Unknown type of entity: ignored.\n");
2457 fprintf(stderr,
"\n ## Error: %s: negative references are not allowed.\n",
2463 fprintf(stderr,
"\n ## Error: %s: negative hmin value is not allowed.\n",
2468 fprintf(stderr,
"\n ## Error: %s: negative hmax value is not allowed.\n",
2473 fprintf(stderr,
"\n ## Error: %s: negative hausd value is not allowed.\n",
2481 if ( par->
elt == typ && par->
ref == ref ) {
2486 fprintf(stderr,
"\n ## Warning: %s: new parameters (hausd, hmin and hmax)",
2488 fprintf(stderr,
" for entities of type %d and of ref %" MMG5_PRId
"\n",typ,ref);
2509 fprintf(stderr,
"\n ## Error: %s: unexpected entity type: %s.\n",
const char * MMG5_Get_typeName(enum MMG5_type typ)
int MMG5_Set_outputMeshName(MMG5_pMesh mesh, const char *meshout)
int MMG5_Set_inputSolName(MMG5_pMesh mesh, MMG5_pSol sol, const char *solin)
int MMG5_Free_allSols(MMG5_pMesh mesh, MMG5_pSol *sol)
int MMG5_Set_inputMeshName(MMG5_pMesh mesh, const char *meshin)
void MMG5_Init_parameters(MMG5_pMesh mesh)
const char * MMG5_Get_entitiesName(enum MMG5_entities ent)
void MMG5_Init_fileNames(MMG5_pMesh mesh, MMG5_pSol sol)
int MMG5_Set_outputSolName(MMG5_pMesh mesh, MMG5_pSol sol, const char *solout)
int MMG3D_Init_mesh(const int starter,...)
int MMG3D_Set_vectorSol(MMG5_pSol met, double vx, double vy, double vz, MMG5_int pos)
int MMG3D_Unset_requiredEdge(MMG5_pMesh mesh, MMG5_int k)
int MMG3D_GetByIdx_vertex(MMG5_pMesh mesh, double *c0, double *c1, double *c2, MMG5_int *ref, int *isCorner, int *isRequired, MMG5_int idx)
int MMG3D_Get_vectorSol(MMG5_pSol met, double *vx, double *vy, double *vz)
int MMG3D_Get_vertices(MMG5_pMesh mesh, double *vertices, MMG5_int *refs, int *areCorners, int *areRequired)
int MMG3D_Get_prism(MMG5_pMesh mesh, MMG5_int *v0, MMG5_int *v1, MMG5_int *v2, MMG5_int *v3, MMG5_int *v4, MMG5_int *v5, MMG5_int *ref, int *isRequired)
int MMG3D_Set_multiMat(MMG5_pMesh mesh, MMG5_pSol sol, MMG5_int ref, int split, MMG5_int rin, MMG5_int rout)
int MMG3D_Get_normalAtVertex(MMG5_pMesh mesh, MMG5_int k, double *n0, double *n1, double *n2)
int MMG3D_Set_triangles(MMG5_pMesh mesh, MMG5_int *tria, MMG5_int *refs)
int MMG3D_Unset_corner(MMG5_pMesh mesh, MMG5_int k)
void MMG3D_Init_fileNames(MMG5_pMesh mesh, MMG5_pSol sol)
int MMG3D_Set_quadrilateral(MMG5_pMesh mesh, MMG5_int v0, MMG5_int v1, MMG5_int v2, MMG5_int v3, MMG5_int ref, MMG5_int pos)
int MMG3D_Unset_ridge(MMG5_pMesh mesh, MMG5_int k)
int MMG3D_Set_corner(MMG5_pMesh mesh, MMG5_int k)
int MMG3D_Get_edge(MMG5_pMesh mesh, MMG5_int *e0, MMG5_int *e1, MMG5_int *ref, int *isRidge, int *isRequired)
int MMG3D_Set_inputMeshName(MMG5_pMesh mesh, const char *meshin)
int MMG3D_Set_ithSols_inSolsAtVertices(MMG5_pSol sol, int i, double *s)
int MMG3D_Get_prisms(MMG5_pMesh mesh, MMG5_int *prisms, MMG5_int *refs, int *areRequired)
int MMG3D_Set_edges(MMG5_pMesh mesh, MMG5_int *edges, MMG5_int *refs)
int MMG3D_Set_tensorSols(MMG5_pSol met, double *sols)
int MMG3D_Set_requiredTetrahedron(MMG5_pMesh mesh, MMG5_int k)
int MMG3D_Get_triangle(MMG5_pMesh mesh, MMG5_int *v0, MMG5_int *v1, MMG5_int *v2, MMG5_int *ref, int *isRequired)
double MMG3D_Get_tetrahedronQuality(MMG5_pMesh mesh, MMG5_pSol met, MMG5_int k)
int MMG3D_Set_dparameter(MMG5_pMesh mesh, MMG5_pSol sol, int dparam, double val)
int MMG3D_Get_tensorSol(MMG5_pSol met, double *m11, double *m12, double *m13, double *m22, double *m23, double *m33)
int MMG3D_Set_localParameter(MMG5_pMesh mesh, MMG5_pSol sol, int typ, MMG5_int ref, double hmin, double hmax, double hausd)
int MMG3D_Set_tetrahedron(MMG5_pMesh mesh, MMG5_int v0, MMG5_int v1, MMG5_int v2, MMG5_int v3, MMG5_int ref, MMG5_int pos)
int MMG3D_Set_triangle(MMG5_pMesh mesh, MMG5_int v0, MMG5_int v1, MMG5_int v2, MMG5_int ref, MMG5_int pos)
int MMG3D_Get_tetrahedron(MMG5_pMesh mesh, MMG5_int *v0, MMG5_int *v1, MMG5_int *v2, MMG5_int *v3, MMG5_int *ref, int *isRequired)
int MMG3D_Set_scalarSols(MMG5_pSol met, double *s)
int MMG3D_Get_quadrilaterals(MMG5_pMesh mesh, MMG5_int *quads, MMG5_int *refs, int *areRequired)
int MMG3D_Get_solSize(MMG5_pMesh mesh, MMG5_pSol sol, int *typEntity, MMG5_int *np, int *typSol)
int MMG3D_Set_edge(MMG5_pMesh mesh, MMG5_int v0, MMG5_int v1, MMG5_int ref, MMG5_int pos)
int MMG3D_Get_ithSol_inSolsAtVertices(MMG5_pSol sol, int i, double *s, MMG5_int pos)
int MMG3D_Set_scalarSol(MMG5_pSol met, double s, MMG5_int pos)
int MMG3D_Free_allSols(MMG5_pMesh mesh, MMG5_pSol *sol)
int MMG3D_Get_vectorSols(MMG5_pSol met, double *sols)
int MMG3D_Set_quadrilaterals(MMG5_pMesh mesh, MMG5_int *quads, MMG5_int *refs)
int MMG3D_Get_vertex(MMG5_pMesh mesh, double *c0, double *c1, double *c2, MMG5_int *ref, int *isCorner, int *isRequired)
int MMG3D_Set_ithSol_inSolsAtVertices(MMG5_pSol sol, int i, double *s, MMG5_int pos)
int MMG3D_Get_edges(MMG5_pMesh mesh, MMG5_int *edges, MMG5_int *refs, int *areRidges, int *areRequired)
int MMG3D_Get_tensorSols(MMG5_pSol met, double *sols)
int MMG3D_Set_lsBaseReference(MMG5_pMesh mesh, MMG5_pSol sol, MMG5_int br)
int MMG3D_Set_parallelTriangles(MMG5_pMesh mesh, MMG5_int *parIdx, MMG5_int npar)
int MMG3D_Set_vectorSols(MMG5_pSol met, double *sols)
void MMG3D_Set_handGivenMesh(MMG5_pMesh mesh)
int MMG3D_Set_requiredVertex(MMG5_pMesh mesh, MMG5_int k)
int MMG3D_Set_inputSolName(MMG5_pMesh mesh, MMG5_pSol sol, const char *solin)
int MMG3D_Unset_requiredTriangles(MMG5_pMesh mesh, MMG5_int *reqIdx, MMG5_int nreq)
int MMG3D_Unset_requiredTetrahedra(MMG5_pMesh mesh, MMG5_int *reqIdx, MMG5_int nreq)
int MMG3D_Set_requiredTriangle(MMG5_pMesh mesh, MMG5_int k)
int MMG3D_Set_vertices(MMG5_pMesh mesh, double *vertices, MMG5_int *refs)
int MMG3D_Free_structures(const int starter,...)
int MMG3D_Add_tetrahedron(MMG5_pMesh mesh, MMG5_int v0, MMG5_int v1, MMG5_int v2, MMG5_int v3, MMG5_int ref)
int MMG3D_Set_ridge(MMG5_pMesh mesh, MMG5_int k)
int MMG3D_Set_solsAtVerticesSize(MMG5_pMesh mesh, MMG5_pSol *sol, int nsols, MMG5_int nentities, int *typSol)
int MMG3D_Free_names(const int starter,...)
int MMG3D_Set_outputSolName(MMG5_pMesh mesh, MMG5_pSol sol, const char *solout)
int MMG3D_Get_iparameter(MMG5_pMesh mesh, MMG5_int iparam)
int MMG3D_Set_outputMeshName(MMG5_pMesh mesh, const char *meshout)
int MMG3D_Set_parallelTriangle(MMG5_pMesh mesh, MMG5_int k)
int MMG3D_Set_prism(MMG5_pMesh mesh, MMG5_int v0, MMG5_int v1, MMG5_int v2, MMG5_int v3, MMG5_int v4, MMG5_int v5, MMG5_int ref, MMG5_int pos)
int MMG3D_Get_ithSols_inSolsAtVertices(MMG5_pSol sol, int i, double *s)
int MMG3D_setMeshSize_initData(MMG5_pMesh mesh, MMG5_int np, MMG5_int ne, MMG5_int nprism, MMG5_int nt, MMG5_int nquad, MMG5_int na)
int MMG3D_Chk_meshData(MMG5_pMesh mesh, MMG5_pSol met)
int MMG3D_Get_scalarSols(MMG5_pSol met, double *s)
MMG5_int MMG3D_Add_vertex(MMG5_pMesh mesh, double c0, double c1, double c2, MMG5_int ref)
int MMG3D_Get_solsAtVerticesSize(MMG5_pMesh mesh, MMG5_pSol *sol, int *nsols, MMG5_int *np, int *typSol)
int MMG3D_Get_triangles(MMG5_pMesh mesh, MMG5_int *tria, MMG5_int *refs, int *areRequired)
int MMG3D_Unset_parallelTriangle(MMG5_pMesh mesh, MMG5_int k)
int MMG3D_Set_tensorSol(MMG5_pSol met, double m11, double m12, double m13, double m22, double m23, double m33, MMG5_int pos)
int MMG3D_Get_quadrilateral(MMG5_pMesh mesh, MMG5_int *v0, MMG5_int *v1, MMG5_int *v2, MMG5_int *v3, MMG5_int *ref, int *isRequired)
int MMG3D_Get_tetrahedra(MMG5_pMesh mesh, MMG5_int *tetra, MMG5_int *refs, int *areRequired)
int MMG3D_Set_vertex(MMG5_pMesh mesh, double c0, double c1, double c2, MMG5_int ref, MMG5_int pos)
int MMG3D_Get_scalarSol(MMG5_pSol met, double *s)
int MMG3D_Get_meshSize(MMG5_pMesh mesh, MMG5_int *np, MMG5_int *ne, MMG5_int *nprism, MMG5_int *nt, MMG5_int *nquad, MMG5_int *na)
int MMG3D_Set_prisms(MMG5_pMesh mesh, MMG5_int *prisms, MMG5_int *refs)
void MMG3D_Init_parameters(MMG5_pMesh mesh)
int MMG3D_Free_all(const int starter,...)
int MMG3D_Set_iparameter(MMG5_pMesh mesh, MMG5_pSol sol, int iparam, MMG5_int val)
int MMG3D_Unset_requiredTetrahedron(MMG5_pMesh mesh, MMG5_int k)
int MMG3D_Unset_requiredVertex(MMG5_pMesh mesh, MMG5_int k)
int MMG3D_Set_normalAtVertex(MMG5_pMesh mesh, MMG5_int k, double n0, double n1, double n2)
int MMG3D_Set_requiredEdge(MMG5_pMesh mesh, MMG5_int k)
int MMG3D_Set_meshSize(MMG5_pMesh mesh, MMG5_int np, MMG5_int ne, MMG5_int nprism, MMG5_int nt, MMG5_int nquad, MMG5_int na)
int MMG3D_Unset_requiredTriangle(MMG5_pMesh mesh, MMG5_int k)
int MMG3D_Unset_parallelTriangles(MMG5_pMesh mesh, MMG5_int *parIdx, MMG5_int npar)
int MMG3D_Set_requiredTriangles(MMG5_pMesh mesh, MMG5_int *reqIdx, MMG5_int nreq)
int MMG3D_Set_requiredTetrahedra(MMG5_pMesh mesh, MMG5_int *reqIdx, MMG5_int nreq)
int MMG3D_Set_solSize(MMG5_pMesh mesh, MMG5_pSol sol, int typEntity, MMG5_int np, int typSol)
int MMG3D_Set_tetrahedra(MMG5_pMesh mesh, MMG5_int *tetra, MMG5_int *refs)
static int MMG3D_skipIso(MMG5_pMesh mesh)
MMG5_pMesh MMG5_pSol * sol
if(!ier) exit(EXIT_FAILURE)
va_start(argptr, starter)
static double MMG5_caltet_iso(MMG5_pMesh mesh, MMG5_pSol met, MMG5_pTetra pt)
static double MMG5_caltet_ani(MMG5_pMesh mesh, MMG5_pSol met, MMG5_pTetra pt)
static double MMG3D_caltetLES_iso(MMG5_pMesh mesh, MMG5_pSol met, MMG5_pTetra pt)
API headers for the mmg3d library.
@ MMG3D_IPARAM_numberOfLocalParam
@ MMG3D_DPARAM_angleDetection
@ MMG3D_IPARAM_numsubdomain
@ MMG3D_IPARAM_numberOfMat
@ MMG3D_IPARAM_numberOfLSBaseReferences
MMG5_int MMG3D_newPt(MMG5_pMesh mesh, double c[3], int16_t tag, MMG5_int src)
MMG5_int MMG3D_newElt(MMG5_pMesh mesh)
int MMG3D_Free_all_var(va_list argptr)
int MMG3D_Free_structures_var(va_list argptr)
double MMG5_caltet33_ani(MMG5_pMesh mesh, MMG5_pSol met, MMG5_pTetra pt)
int MMG3D_Free_names_var(va_list argptr)
int MMG3D_Init_mesh_var(va_list argptr)
#define MMG3D_TETRA_REALLOC(mesh, jel, wantedGap, law)
int MMG3D_memOption(MMG5_pMesh mesh)
int MMG3D_setMeshSize_alloc(MMG5_pMesh)
LIBMMG_CORE_EXPORT int MMG5_Set_multiMat(MMG5_pMesh mesh, MMG5_pSol sol, MMG5_int ref, int split, MMG5_int rin, MMG5_int rex)
LIBMMG_CORE_EXPORT int MMG5_Set_lsBaseReference(MMG5_pMesh mesh, MMG5_pSol sol, MMG5_int br)
#define MMG5_SAFE_CALLOC(ptr, size, type, law)
#define MMG5_INCREASE_MEM_MESSAGE()
#define MMG5_ADD_MEM(mesh, size, message, law)
#define MMG5_TAB_RECALLOC(mesh, ptr, initSize, wantedGap, type, message, law)
double MMG5_orvol(MMG5_pPoint point, MMG5_int *v)
#define MMG5_DEL_MEM(mesh, ptr)
#define MMG5_SAFE_RECALLOC(ptr, prevSize, newSize, type, message, law)
Structure to store edges of a MMG mesh.
To store user-defined references in the mesh (useful in LS mode)
Structure to store points of a MMG mesh.