118 printf(
" Maximum memory set to default value: %d MB.\n",
MMG5_MEMMAX);
161 fprintf(stderr,
" Exit program.\n");
168 fprintf(stderr,
" Exit program.\n");
173 fprintf(stderr,
"\n ## Warning: %s: no name given for input mesh.\n",__func__);
174 fprintf(stderr,
" Use of default value \"mesh.mesh\".\n");
195 if ( solin && strlen(solin) ) {
197 fprintf(stderr,
" Exit program.\n");
212 ptr = strstr(dot,
".mesh");
219 "input sol name",
return 0);
222 fprintf(stderr,
" Exit program.\n");
228 fprintf(stderr,
" Exit program.\n");
250 if ( fparamin && strlen(fparamin) ) {
252 fprintf(stderr,
" Exit program.\n");
258 fprintf(stderr,
"\n ## Warning: %s: no name given for the parameter file.\n",__func__);
259 fprintf(stderr,
" We should have never end here.\n");
280 if ( meshout && strlen(meshout) ) {
281 ptr = strrchr(meshout,
'.');
284 fprintf(stderr,
" Exit program.\n");
327 fprintf(stderr,
" Exit program.\n");
335 if ( ptr ) *ptr =
'\0';
364 fprintf(stderr,
" Exit program.\n");
368 fprintf(stderr,
"\n ## Warning: %s: no name given for output mesh.\n",
370 fprintf(stderr,
" Use of default value \"mesh.o.mesh\".\n");
395 if ( solout && strlen(solout) ) {
397 fprintf(stderr,
" Exit program.\n");
408 ptr = strstr(dot,
".mesh");
422 ptr = strstr(dot,
".mesh");
429 fprintf(stderr,
" Exit program.\n");
432 "output sol name",
return 0);
437 fprintf(stderr,
"\n ## Error: %s: no name for output mesh. please, use",
439 fprintf(stderr,
" the MMG5_Set_outputMeshName to set the mesh name.\n");
450 if ( met->
size == 1 ) {
451 for (k=1; k<=
mesh->
np; k++) {
453 if ( !
MG_VOK(ppt) )
continue;
458 hsiz = 1./(hsiz*hsiz);
461 for (k=1; k<=
mesh->
np; k++) {
463 if ( !
MG_VOK(ppt) )
continue;
468 met->
m[iadr+2] = hsiz;
473 for (k=1; k<=
mesh->
np; k++) {
475 if ( !
MG_VOK(ppt) )
continue;
481 met->
m[iadr+3] = hsiz;
483 met->
m[iadr+5] = hsiz;
549 printf(
" MEMORY USED AT END (Bytes) %zu\n",
mesh->
memCur);
606 assert ( sethmin && sethmax );
607 fprintf(stderr,
"\n ## Error: %s: Mismatched options:"
608 " minimal mesh size larger than maximal one.\n",__func__);
614 fprintf(stdout,
" After truncature computation: hmin %lf (user setted %d)\n"
615 " hmax %lf (user setted %d)\n",
626 fprintf(stderr,
"\n ## Error: %s: Mismatched options: hmin (%e) is greater"
627 " than hsiz (%e). Exit Program.\n",__func__,
633 fprintf(stderr,
"\n ## Error: %s: Mismatched options: hmax (%e) is lower"
634 " than hsiz (%e). Exit Program.\n",__func__,
673 fprintf(stdout,
" After hsiz computation: hmin %lf (user setted %d)\n"
674 " hmax %lf (user setted %d)\n",
684 char *s = strrchr(path,
'/');
689 return strdup(s + 1);
698 return "MMG5_Noentity";
701 return "MMG5_Vertex";
707 return "MMG5_Triangle";
710 return "MMG5_Tetrahedron";
713 return"MMG5_Unknown";
721 return "MMG5_Notype";
724 return "MMG5_Scalar";
727 return "MMG5_Vector";
730 return "MMG5_Tensor";
733 return "MMG5_Unknown";
739 static char tags_name[1024];
750 strcpy(tags_name,
"\0");
753 strcat(tags_name,
"Reference ");
757 strcat(tags_name,
"Ridge ");
761 strcat(tags_name,
"Required ");
765 strcat(tags_name,
"Non-manifold ");
769 strcat(tags_name,
"Boundary ");
773 strcat(tags_name,
"Corner ");
777 strcat(tags_name,
"Nosurf ");
781 strcat(tags_name,
"Opnbdy ");
785 strcat(tags_name,
"Old-parbdy ");
789 strcat(tags_name,
"Parbdybdy ");
793 strcat(tags_name,
"Parbdy ");
797 strcat(tags_name,
"Overlap ");
800 strcat(tags_name,
"tag(s).");
820 if ( !ptr )
return defFmt;
822 if ( !strncmp ( ptr,
".meshb",strlen(
".meshb") ) ) {
825 else if ( !strncmp( ptr,
".mesh",strlen(
".mesh") ) ) {
828 else if ( !strncmp( ptr,
".mshb",strlen(
".mshb") ) ) {
831 else if ( !strncmp( ptr,
".msh",strlen(
".msh") ) ) {
834 else if ( !strncmp ( ptr,
".pvtu",strlen(
".pvtu") ) ) {
837 else if ( !strncmp ( ptr,
".vtu",strlen(
".vtu") ) ) {
840 else if ( !strncmp ( ptr,
".pvtp",strlen(
".pvtu") ) ) {
843 else if ( !strncmp ( ptr,
".vtp",strlen(
".vtp") ) ) {
846 else if ( !strncmp ( ptr,
".vtk",strlen(
".vtk") ) ) {
849 else if ( !strncmp ( ptr,
".node",strlen(
".node") ) ) {
869 return "MMG5_FMT_MeditASCII";
872 return "MMG5_FMT_MeditBinary";
875 return "MMG5_FMT_VtkVtu";
878 return "MMG5_FMT_VtkVtp";
881 return "MMG5_FMT_VtkPvtu";
884 return "MMG5_FMT_VtkPvtp";
887 return "MMG5_FMT_VtkVtk";
890 return "MMG5_FMT_GmshASCII";
893 return "MMG5_FMT_GmshBinary";
896 return "MMG5_FMT_Tetgen";
899 return "MMG5_Unknown";
913 const char pathsep=
'/';
921 lastpath = (pathsep == 0) ? NULL : strrchr (
filename, pathsep);
923 if ( (!dot) || dot ==
filename || (lastpath>dot) || (!strcmp(dot,
".o")) ) {
940 char *lastpath,*retpath;
943 if ( path == NULL)
return NULL;
953 while ( path+len != lastpath ) {
960 strncpy ( retpath, path, len );
976 char *retpath, *lastext, *lastpath;
980 if ( (!ext) || !*ext ) {
988 if ( path == NULL)
return NULL;
992 lastext = strstr (path, extloc);
995 if ( lastext == NULL || (lastpath != NULL && lastpath > lastext) ) {
1003 while ( path+len != lastext ) {
1011 strncpy ( retpath, path, len );
1012 retpath[len] =
'\0';
const char * MMG5_Get_tagName(uint16_t tag)
const char * MMG5_Get_typeName(enum MMG5_type typ)
int MMG5_Compute_constantSize(MMG5_pMesh mesh, MMG5_pSol met, double *hsiz)
int MMG5_Set_inputParamName(MMG5_pMesh mesh, const char *fparamin)
int MMG5_Set_outputMeshName(MMG5_pMesh mesh, const char *meshout)
char * MMG5_Get_basename(char *path)
int MMG5_Set_inputSolName(MMG5_pMesh mesh, MMG5_pSol sol, const char *solin)
const char * MMG5_Get_formatName(enum MMG5_Format fmt)
int MMG5_Free_allSols(MMG5_pMesh mesh, MMG5_pSol *sol)
int MMG5_Set_defaultTruncatureSizes(MMG5_pMesh mesh, int8_t sethmin, int8_t sethmax)
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)
char * MMG5_Remove_ext(char *path, char *ext)
int MMG5_Get_format(char *ptr, int fmt)
void MMG5_mmgFree_names(MMG5_pMesh mesh, MMG5_pSol met)
void MMG5_Free_structures(MMG5_pMesh mesh, MMG5_pSol sol)
char * MMG5_Get_path(char *path)
void MMG5_Set_constantSize(MMG5_pMesh mesh, MMG5_pSol met, double hsiz)
void MMG5_Init_fileNames(MMG5_pMesh mesh, MMG5_pSol sol)
char * MMG5_Get_filenameExt(char *filename)
int MMG5_Set_outputSolName(MMG5_pMesh mesh, MMG5_pSol sol, const char *solout)
strncpy(tmp, meshin, *strlen0)
MMG5_pMesh MMG5_pSol * sol
MMG5_pMesh char * filename
MMG5_type
Type of solutions.
MMG5_Format
Type of supported file format.
MMG5_entities
Identifies the types of mesh entities.
#define MMG5_BITWIZE_MB_TO_B
#define MMG5_SAFE_CALLOC(ptr, size, type, law)
size_t MMG5_memSize(void)
#define MMG5_ADD_MEM(mesh, size, message, law)
#define MMG5_SAFE_REALLOC(ptr, prevSize, newSize, type, message, law)
#define MMG5_SAFE_MALLOC(ptr, size, type, law)
int MMG5_check_setted_hminhmax(MMG5_pMesh mesh)
#define MMG5_DEL_MEM(mesh, ptr)
Structure to store input parameters of the job.
Structure to store vertices of an MMG mesh.