33#define MMG2D_RETURN_AND_PACK(mesh,met,sol,val)do \
35 if ( !MMG2D_pack(mesh,met,sol) ) { \
36 mesh->npi = mesh->np; \
37 mesh->nti = mesh->nt; \
38 mesh->nai = mesh->na; \
39 mesh->nei = mesh->ne; \
41 if ( met ) { met->npi = met->np; } \
42 if ( sol ) { sol->npi = sol->np; } \
43 return MMG5_LOWFAILURE; \
45 _LIBMMG5_RETURN(mesh,met,sol,val); \
92 fprintf(stdout,
"\n ## ERROR: NO TRIANGLES IN THE MESH. \n");
93 fprintf(stdout,
" To generate a mesh from boundaries call the"
94 " MMG2D_mmg2dmesh function\n.");
98 fprintf(stdout,
"\n ## ERROR: LEVEL-SET DISCRETISATION UNAVAILABLE"
99 " (MMG2D_IPARAM_iso or MMG2D_IPARAM_isosurf ):\n"
100 " YOU MUST CALL THE MMG2D_mmg2dls FUNCTION TO USE THIS"
105 fprintf(stdout,
"\n ## ERROR: LAGRANGIAN MODE UNAVAILABLE (MMG2D_IPARAM_lag):\n"
106 " YOU MUST CALL THE MMG2D_mmg2dmov FUNCTION TO MOVE A"
111 if (
mesh->
info.
imprim > 0 ) fprintf(stdout,
"\n -- MMG2DLIB: INPUT DATA\n");
117 fprintf(stdout,
"\n ## WARNING: WRONG SOLUTION NUMBER : %" MMG5_PRId
" != %" MMG5_PRId
"\n",met->
np,
mesh->
np);
120 else if ( met->
size!=1 && met->
size!=3 ) {
121 fprintf(stderr,
"\n ## ERROR: WRONG DATA TYPE.\n");
128 printf(
"\n ## ERROR: MISMATCH OPTIONS: OPTIM OPTION CAN NOT BE USED"
129 " WITH AN INPUT METRIC.\n");
134 printf(
"\n ## ERROR: MISMATCH OPTIONS: HSIZ OPTION CAN NOT BE USED"
135 " WITH AN INPUT METRIC.\n");
141 printf(
"\n ## ERROR: MISMATCH OPTIONS: HSIZ AND OPTIM OPTIONS CAN NOT BE USED"
150 fprintf(stdout,
" -- INPUT DATA COMPLETED. %s\n",stim);
157 fprintf(stdout,
" MAXIMUM NUMBER OF POINTS (NPMAX) : %8" MMG5_PRId
"\n",
mesh->
npmax);
158 fprintf(stdout,
" MAXIMUM NUMBER OF TRIANGLES (NTMAX) : %8" MMG5_PRId
"\n",
mesh->
ntmax);
163 if (
mesh->
info.
imprim > 0 ) fprintf(stdout,
"\n -- PHASE 1 : DATA ANALYSIS\n");
214 fprintf(stdout,
" -- PHASE 1 COMPLETED. %s\n",stim);
220 fprintf(stdout,
"\n -- PHASE 2 : %s MESHING\n",met->
size < 3 ?
"ISOTROPIC" :
"ANISOTROPIC");
231 fprintf(stdout,
" -- PHASE 2 COMPLETED. %s\n",stim);
246 if (
mesh->
info.
imprim > 0 ) fprintf(stdout,
"\n -- MESH PACKED UP\n");
257 fprintf(stdout,
"\n MMG2DLIB: ELAPSED TIME %s\n",stim);
258 fprintf(stdout,
"\n %s\n END OF MODULE MMG2D\n %s\n\n",
MG_STR,
MG_STR);
283 "initial triangles",
return 0);
286 for ( k=
mesh->
nenil; k<mesh->ntmax-1; k++) {
294 "initial edges",
return 0);
334 fprintf(stdout,
"\n ## ERROR: YOUR MESH CONTAINS ALREADY TRIANGLES.\n"
335 " THE MESH GENERATION OPTION IS UNAVAILABLE.\n");
340 fprintf(stdout,
"\n ## ERROR: LEVEL-SET DISCRETISATION UNAVAILABLE"
341 " (MMG2D_IPARAM_iso || MMG2D_IPARAM_isosurf ):\n"
342 " YOU MUST CALL THE MMG2D_MMG2DLS FUNCTION TO USE THIS OPTION.\n");
347 fprintf(stdout,
"\n ## ERROR: LAGRANGIAN MODE UNAVAILABLE (MMG2D_IPARAM_lag):\n"
348 " YOU MUST CALL THE MMG2D_MMG2DMOV FUNCTION TO MOVE A RIGIDBODY.\n");
354 printf(
"\n ## ERROR: MISMATCH OPTIONS: OPTIM OPTION CAN NOT BE USED"
355 " WITH AN INPUT METRIC.\n");
360 printf(
"\n ## ERROR: MISMATCH OPTIONS: HSIZ OPTION CAN NOT BE USED"
361 " WITH AN INPUT METRIC.\n");
367 printf(
"\n ## ERROR: MISMATCH OPTIONS: HSIZ AND OPTIM OPTIONS CAN NOT BE USED"
372 if (
mesh->
info.
imprim > 0 ) fprintf(stdout,
"\n -- MMG2DMESH: INPUT DATA\n");
378 fprintf(stdout,
"\n ## WARNING: WRONG SOLUTION NUMBER : %" MMG5_PRId
" != %" MMG5_PRId
"\n",met->
np,
mesh->
np);
380 }
else if ( met->
size!=1 && met->
size!=3 ) {
381 fprintf(stderr,
"\n ## ERROR: WRONG DATA TYPE.\n");
388 fprintf(stdout,
" -- INPUT DATA COMPLETED. %s\n",stim);
395 fprintf(stdout,
" MAXIMUM NUMBER OF POINTS (NPMAX) : %8" MMG5_PRId
"\n",
mesh->
npmax);
396 fprintf(stdout,
" MAXIMUM NUMBER OF TRIANGLES (NTMAX) : %8" MMG5_PRId
"\n",
mesh->
ntmax);
406 if (
mesh->
info.
imprim > 0 ) fprintf(stdout,
"\n -- PHASE 1 : MESH GENERATION\n");
422 printf(
" Exit program.\n");
436 fprintf(stdout,
" -- PHASE 1 COMPLETED. %s\n",stim);
441 fprintf(stdout,
"\n -- PHASE 2 : ANALYSIS\n");
476 fprintf(stdout,
" -- PHASE 2 COMPLETED. %s\n",stim);
481 fprintf(stdout,
"\n -- PHASE 3 : MESH IMPROVEMENT (%s)\n",
482 met->
size < 3 ?
"ISOTROPIC" :
"ANISOTROPIC");
492 fprintf(stdout,
" -- PHASE 3 COMPLETED. %s\n",stim);
509 if (
mesh->
info.
imprim > 0 ) fprintf(stdout,
"\n -- MESH PACKED UP\n");
518 fprintf(stdout,
"\n MMG2DMESH: ELAPSED TIME %s\n",stim);
519 fprintf(stdout,
"\n %s\n END OF MODULE MMG2D\n %s\n\n",
MG_STR,
MG_STR);
531 int8_t mettofree = 0;
541 fprintf(stdout,
"\n ## WARNING: ISO MODE NOT PROVIDED: ENABLING ISOVALUE DISCRETIZATION MODE (-ls) \n");
570 fprintf(stdout,
"\n ## ERROR: LAGRANGIAN MODE UNAVAILABLE (MMG2D_IPARAM_lag):\n"
571 " YOU MUST CALL THE MMG2D_mmg2dmov FUNCTION TO MOVE A RIGIDBODY.\n");
576 if (
mesh->
info.
imprim > 0 ) fprintf(stdout,
"\n -- MMG2DLS: INPUT DATA\n");
582 fprintf(stdout,
"\n ## ERROR: NO TRIANGLES IN THE MESH \n");
586 else if ( !
sol->m ) {
587 fprintf(stdout,
"\n ## ERROR: A VALID SOLUTION FILE IS NEEDED \n");
590 }
else if (
sol->size != 1 ) {
591 fprintf(stdout,
"\n ## ERROR: WRONG DATA TYPE.\n");
595 fprintf(stdout,
"\n ## WARNING: WRONG SOLUTION NUMBER. IGNORED\n");
601 if ( met && met->
np ) {
603 printf(
"\n ## ERROR: MISMATCH OPTIONS: OPTIM OPTION CAN NOT BE USED"
604 " WITH AN INPUT METRIC.\n");
610 printf(
"\n ## ERROR: MISMATCH OPTIONS: HSIZ OPTION CAN NOT BE USED"
611 " WITH AN INPUT METRIC.\n");
616 fprintf(stdout,
"\n ## WARNING: WRONG METRIC NUMBER. IGNORED\n");
623 printf(
"\n ## ERROR: MISMATCH OPTIONS: HSIZ AND OPTIM OPTIONS CAN NOT BE USED"
630 printf(
"\n ## ERROR: UNABLE TO HANDLE HYBRID MESHES IN ISOVALUE DISCRETIZATION MODE.\n");
638 fprintf(stdout,
" -- INPUT DATA COMPLETED. %s\n",stim);
647 fprintf(stdout,
"\n -- PHASE 1 : ISOSURFACE DISCRETIZATION\n");
650 fprintf(stdout,
" MAXIMUM NUMBER OF POINTS (NPMAX) : %8"MMG5_PRId
"\n",
mesh->
npmax);
651 fprintf(stdout,
" MAXIMUM NUMBER OF TRIANGLES (NTMAX) : %8"MMG5_PRId
"\n",
mesh->
ntmax);
718 fprintf(stdout,
" -- PHASE 1 COMPLETED. %s\n",stim);
722 fprintf(stdout,
"\n -- PHASE 2 : ANALYSIS\n");
755 fprintf(stdout,
" -- PHASE 2 COMPLETED. %s\n",stim);
760 fprintf(stdout,
"\n -- PHASE 3 : MESH IMPROVEMENT\n");
776 fprintf(stdout,
" -- PHASE 3 COMPLETED. %s\n",stim);
798 if (
mesh->
info.
imprim > 0 ) fprintf(stdout,
"\n -- MESH PACKED UP\n");
811 fprintf(stdout,
"\n MMG2DLS: ELAPSED TIME %s\n",stim);
812 fprintf(stdout,
"\n %s\n END OF MODULE MMG2D\n %s\n\n",
MG_STR,
MG_STR);
826 MMG5_int k,*invalidTris;
851 if (
mesh->
info.
imprim > 0 ) fprintf(stdout,
"\n -- MMG2DMOV: INPUT DATA\n");
857 fprintf(stderr,
"\n ## ERROR: YOU NEED TO COMPILE WITH THE USE_ELAS"
858 " CMake's FLAG SET TO ON TO USE THE RIGIDBODY MOVEMENT LIBRARY.\n");
863 fprintf(stdout,
"\n ## ERROR: NO TRIANGLES IN THE MESH \n");
866 else if ( !disp->
m ) {
867 fprintf(stdout,
"\n ## ERROR: A VALID SOLUTION FILE IS NEEDED \n");
870 else if ( disp->
size != 2 ) {
871 fprintf(stdout,
"\n ## ERROR: LAGRANGIAN MOTION OPTION NEED A VECTOR DISPLACEMENT.\n");
874 else if ( disp->
np && (disp->
np !=
mesh->
np) ) {
875 fprintf(stdout,
"\n ## WARNING: WRONG SOLUTION NUMBER. IGNORED\n");
881 printf(
"\n ## ERROR: OPTIM OPTION UNAVAILABLE IN LAGRANGIAN"
882 " MOVEMENT MODE.\n");
886 printf(
"\n ## ERROR: HSIZ OPTION UNAVAILABLE IN LAGRANGIAN"
887 " MOVEMENT MODE.\n");
892 printf(
"\n ## ERROR: UNABLE TO HANDLE HYBRID MESHES IN LAGRANGIAN MOVEMENT MODE.\n");
900 fprintf(stdout,
" -- INPUT DATA COMPLETED. %s\n",stim);
909 fprintf(stdout,
"\n -- PHASE 1 : ANALYSIS\n");
913 fprintf(stdout,
" MAXIMUM NUMBER OF POINTS (NPMAX) : %8" MMG5_PRId
"\n",
mesh->
npmax);
914 fprintf(stdout,
" MAXIMUM NUMBER OF TRIANGLES (NTMAX) : %8" MMG5_PRId
"\n",
mesh->
ntmax);
948 fprintf(stdout,
" -- PHASE 1 COMPLETED. %s\n",stim);
953 fprintf(stdout,
"\n -- PHASE 2 : LAGRANGIAN MOTION\n");
960 disp->
npi = disp->
np;
963 else if (
ier < 0 ) {
964 printf(
"\n ## Warning: Unable to perform any movement "
965 "(%d intersecting triangles).\n",-
ier);
967 printf(
" List of invalid trias: ");
968 for ( k=0; k<-
ier; ++k ) {
979 fprintf(stdout,
" -- PHASE 2 COMPLETED. %s\n",stim);
986 fprintf(stdout,
"\n -- PHASE 3 : MESH IMPROVEMENT\n");
997 fprintf(stdout,
" -- PHASE 3 COMPLETED. %s\n",stim);
1010 if (
mesh->
info.
imprim > 0 ) fprintf(stdout,
"\n -- MESH PACKED UP\n");
1020 fprintf(stdout,
"\n MMG2DMOV: ELAPSED TIME %s\n",stim);
1021 fprintf(stdout,
"\n %s\n END OF MODULE MMG2D\n %s\n\n",
MG_STR,
MG_STR);
int MMG5_Set_defaultTruncatureSizes(MMG5_pMesh mesh, int8_t sethmin, int8_t sethmax)
MMG5_pMesh MMG5_pSol * sol
int MMG2D_analys(MMG5_pMesh mesh)
int MMG2D_grad2metreq_ani(MMG5_pMesh mesh, MMG5_pSol met, MMG5_pTria pt, MMG5_int npmaster, MMG5_int npslave)
MMG5_int MMG2D_grad2met_ani(MMG5_pMesh mesh, MMG5_pSol met, MMG5_pTria pt, MMG5_int np1, MMG5_int np2)
int MMG5_mmg2dChkmsh(MMG5_pMesh mesh, int severe, MMG5_int base)
void tminit(mytime *t, int maxtim)
Initialize mytime object.
void printim(double elps, char *stim)
Print real time.
void chrono(int cmode, mytime *ptt)
Function to measure time.
int MMG2D_hashTria(MMG5_pMesh mesh)
int MMG2D_pack(MMG5_pMesh mesh, MMG5_pSol sol, MMG5_pSol met)
int MMG2D_prilen(MMG5_pMesh mesh, MMG5_pSol sol)
int MMG2D_mmg2dlib(MMG5_pMesh mesh, MMG5_pSol met)
#define MMG2D_RETURN_AND_PACK(mesh, met, sol, val)
int MMG2D_mmg2dls(MMG5_pMesh mesh, MMG5_pSol sol, MMG5_pSol umet)
int MMG2D_mmg2dmesh(MMG5_pMesh mesh, MMG5_pSol met)
static int MMG2D_restart(MMG5_pMesh mesh)
void MMG2D_Set_commonFunc(void)
int MMG2D_mmg2dmov(MMG5_pMesh mesh, MMG5_pSol met, MMG5_pSol disp)
API headers for the mmg2d library.
LIBMMG2D_EXPORT int(* MMG2D_doSol)(MMG5_pMesh mesh, MMG5_pSol met)
LIBMMG2D_EXPORT int MMG2D_Set_constantSize(MMG5_pMesh mesh, MMG5_pSol met)
LIBMMG2D_EXPORT void MMG2D_setfunc(MMG5_pMesh mesh, MMG5_pSol met)
int MMG2D_mmg2d1n(MMG5_pMesh, MMG5_pSol)
MMG5_int MMG2D_indPt(MMG5_pMesh mesh, MMG5_int kp)
static void MMG2D_excfun(int sigid)
int MMG2D_mmg2d9(MMG5_pMesh, MMG5_pSol, MMG5_pSol, MMG5_int **)
int MMG2D_mmg2d2(MMG5_pMesh, MMG5_pSol)
MMG5_int MMG2D_indElt(MMG5_pMesh mesh, MMG5_int kel)
int MMG2D_outqua(MMG5_pMesh, MMG5_pSol)
void MMG2D_keep_only1Subdomain(MMG5_pMesh mesh, int nsd)
int MMG2D_mmg2d6(MMG5_pMesh, MMG5_pSol, MMG5_pSol)
LIBMMG_CORE_EXPORT int MMG5_unscaleMesh(MMG5_pMesh mesh, MMG5_pSol met, MMG5_pSol ls)
LIBMMG_CORE_EXPORT int MMG5_scaleMesh(MMG5_pMesh mesh, MMG5_pSol met, MMG5_pSol ls)
#define MMG5_STRONGFAILURE
#define MMG5_SAFE_CALLOC(ptr, size, type, law)
#define _LIBMMG5_RETURN(mesh, sol, met, val)
#define MMG5_ADD_MEM(mesh, size, message, law)
int MMG5_2dSolTruncature_ani(MMG5_pMesh mesh, MMG5_pSol met)
#define MMG5_SAFE_FREE(ptr)
#define MMG5_DEL_MEM(mesh, ptr)
Structure to store edges of a MMG mesh.