Mmg
Simplicial remeshers (mesh adaptation, isovalue discretization, lagrangian movement)
API_functions.c
Go to the documentation of this file.
1/* =============================================================================
2** This file is part of the mmg software package for the tetrahedral
3** mesh modification.
4** Copyright (c) Bx INP/CNRS/Inria/UBordeaux/UPMC, 2004-
5**
6** mmg is free software: you can redistribute it and/or modify it
7** under the terms of the GNU Lesser General Public License as published
8** by the Free Software Foundation, either version 3 of the License, or
9** (at your option) any later version.
10**
11** mmg is distributed in the hope that it will be useful, but WITHOUT
12** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13** FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
14** License for more details.
15**
16** You should have received a copy of the GNU Lesser General Public
17** License and of the GNU General Public License along with mmg (in
18** files COPYING.LESSER and COPYING). If not, see
19** <http://www.gnu.org/licenses/>. Please read their terms carefully and
20** use this copy of the mmg distribution only if you accept them.
21** =============================================================================
22*/
23
43#include "mmgcommon_private.h"
44
52
53 memset(&mesh->info,0, sizeof(MMG5_Info));
54
55 /* default values for integers */
56 /* [-1..10], Tune level of imprim */
57 mesh->info.imprim = 1;
58 /* [0/1] ,Turn on/off levelset meshing */
60 /* [n/10] ,Value for isosurface boundary reference */
62 /* [n/-1] ,Set memory size to n Mbytes/keep the default value */
64 /* [0/1] ,Turn on/off debug mode */
66 /* [n] ,number of local parameters */
68 /* [0/1] ,avoid/allow point insertion/deletion */
70 /* [0/1] ,avoid/allow edge or face flipping */
72 /* [0/1] ,avoid/allow point relocation */
74 /* [n] ,number of user-defined references */
76 /* [-1/val] ,Turn off/on the removal of small bubles in levelset meshing */
78 /* [0/1] ,avoid/allow */
80
81
82 /* default values for doubles */
83 /* angle detection */
85 /* minimal mesh size */
87 /* maximal mesh size */
89 /* constant mesh size */
91 /* control Hausdorff */
93 /* control gradation */
95 /* control gradation on required entities */
97
98 /* default values for pointers */
99 /* list of user-defined references */
100 mesh->info.mat = NULL;
101
105
106 /* initial value for memMax and gap */
107 mesh->gap = MMG5_GAP;
109 if ( mesh->memMax ) {
110 /* maximal memory = 50% of total physical memory */
111 mesh->memMax = (size_t)(mesh->memMax*MMG5_MEMPERCENT);
112 } else {
113 /* default value = 800 MB */
114 printf(" Maximum memory set to default value: %d MB.\n",MMG5_MEMMAX);
116 }
117
118}
119
120
129 ) {
132
133 if ( sol ) {
136 }
137
138 return;
139}
140
150
151 if ( mesh->namein ){
153 }
154
155 if ( meshin && strlen(meshin) ) {
156 MMG5_ADD_MEM(mesh,(strlen(meshin)+1)*sizeof(char),"input mesh name",
157 fprintf(stderr," Exit program.\n");
158 return 0);
159 MMG5_SAFE_CALLOC(mesh->namein,strlen(meshin)+1,char,return 0);
160 strcpy(mesh->namein,meshin);
161 }
162 else {
163 MMG5_ADD_MEM(mesh,10*sizeof(char),"input mesh name",
164 fprintf(stderr," Exit program.\n");
165 return 0);
166 MMG5_SAFE_CALLOC(mesh->namein,10,char,return 0);
167 strcpy(mesh->namein,"mesh.mesh");
168 if ( (mesh->info.imprim > 5) || mesh->info.ddebug ) {
169 fprintf(stderr,"\n ## Warning: %s: no name given for input mesh.\n",__func__);
170 fprintf(stderr," Use of default value \"mesh.mesh\".\n");
171 }
172 }
173 return 1;
174}
175
186 char *ptr;
187
188 if ( sol->namein )
190
191 if ( solin && strlen(solin) ) {
192 MMG5_ADD_MEM(mesh,(strlen(solin)+1)*sizeof(char),"input sol name",
193 fprintf(stderr," Exit program.\n");
194 return 0);
195 MMG5_SAFE_CALLOC(sol->namein,strlen(solin)+1,char,return 0);
196 strcpy(sol->namein,solin);
197 }
198 else {
199 if ( mesh->namein && strlen(mesh->namein) ) {
200 int mesh_len = strlen(mesh->namein)+1;
201 MMG5_SAFE_CALLOC(sol->namein,mesh_len,char,return 0);
202 strcpy(sol->namein,mesh->namein);
203 ptr = strstr(sol->namein,".mesh");
204 if ( ptr ) {
205 /* the sol file is renamed with the meshfile without extension */
206 *ptr = '\0';
207 MMG5_SAFE_REALLOC(sol->namein,mesh_len,(strlen(sol->namein)+1),char,
208 "input sol name",return 0);
209 }
210 MMG5_ADD_MEM(mesh,(strlen(sol->namein)+1)*sizeof(char),"input sol name",
211 fprintf(stderr," Exit program.\n");
212 return 0);
213 }
214 else {
215 MMG5_ADD_MEM(mesh,9*sizeof(char),"input sol name",
216 fprintf(stderr," Exit program.\n");
217 return 0);
218 MMG5_SAFE_CALLOC(sol->namein,9,char,return 0);
219 strcpy(sol->namein,"mesh.sol");
220 }
221 }
222 return 1;
223}
224
233int MMG5_Set_outputMeshName(MMG5_pMesh mesh, const char* meshout) {
234 int fmt = MMG5_FMT_MeditASCII,fmtin;
235 char *ptr,*ptrin;
236
237 if ( mesh->nameout )
239
240 if ( meshout && strlen(meshout) ) {
241 ptr = strrchr(meshout, '.');
242
243 MMG5_ADD_MEM(mesh,(strlen(meshout)+7)*sizeof(char),"output mesh name",
244 fprintf(stderr," Exit program.\n");
245 return 0);
246 MMG5_SAFE_CALLOC(mesh->nameout,strlen(meshout)+7,char,return 0);
247 strcpy(mesh->nameout,meshout);
248
249 if ( ( ptr && MMG5_Get_format(ptr,0)==MMG5_FMT_Unknown ) || (!ptr) || ptr == meshout ) {
250 /* No extension */
253 fmt = MMG5_FMT_Unknown;
254 }
255 strcpy(mesh->nameout,meshout);
256
257 if ( fmt == MMG5_FMT_Unknown ) {
258 /* No extension */
259 switch ( fmtin ) {
260 case ( MMG5_FMT_GmshASCII ):
261 strcat(mesh->nameout,".msh");
262 break;
263 case ( MMG5_FMT_GmshBinary ):
264 strcat(mesh->nameout,".mshb");
265 break;
266 case ( MMG5_FMT_VtkVtu ):
267 strcat(mesh->nameout,".vtu");
268 break;
269 case ( MMG5_FMT_VtkVtp ):
270 strcat(mesh->nameout,".vtp");
271 break;
272 case ( MMG5_FMT_VtkVtk ):
273 strcat(mesh->nameout,".vtk");
274 break;
275 case ( MMG5_FMT_MeditBinary ):
276 strcat(mesh->nameout,".meshb");
277 break;
278 case ( MMG5_FMT_MeditASCII ): default:
279 strcat(mesh->nameout,".mesh");
280 break;
281 }
282 }
283 }
284 else {
285 if ( mesh->namein && strlen(mesh->namein) ) {
286 MMG5_ADD_MEM(mesh,(strlen(mesh->namein)+9)*sizeof(char),"output mesh name",
287 fprintf(stderr," Exit program.\n");
288 return 0);
289 MMG5_SAFE_CALLOC(mesh->nameout,strlen(mesh->namein)+9,char,return 0);
290 strcpy(mesh->nameout,mesh->namein);
291
294
295 if ( ptr ) *ptr = '\0';
296
297 switch ( fmt ) {
298
299 case ( MMG5_FMT_GmshASCII ):
300 strcat(mesh->nameout,".o.msh");
301 break;
302 case ( MMG5_FMT_GmshBinary ):
303 strcat(mesh->nameout,".o.mshb");
304 break;
305 case ( MMG5_FMT_VtkVtu ):
306 strcat(mesh->nameout,".o.vtu");
307 break;
308 case ( MMG5_FMT_VtkVtp ):
309 strcat(mesh->nameout,".o.vtp");
310 break;
311 case ( MMG5_FMT_VtkVtk ):
312 strcat(mesh->nameout,".o.vtk");
313 break;
314 case ( MMG5_FMT_MeditBinary ):
315 strcat(mesh->nameout,".o.meshb");
316 break;
317 case ( MMG5_FMT_MeditASCII ): default:
318 strcat(mesh->nameout,".o.mesh");
319 break;
320 }
321 }
322 else {
323 MMG5_ADD_MEM(mesh,12*sizeof(char),"output mesh name",
324 fprintf(stderr," Exit program.\n");
325 return 0);
326 MMG5_SAFE_CALLOC(mesh->nameout,12,char,return 0);
327 if ( (mesh->info.imprim > 5) || mesh->info.ddebug ) {
328 fprintf(stderr,"\n ## Warning: %s: no name given for output mesh.\n",
329 __func__);
330 fprintf(stderr," Use of default value \"mesh.o.mesh\".\n");
331 }
332 strcpy(mesh->nameout,"mesh.o.mesh");
333 }
334 }
335 return 1;
336}
337
338
349 char *ptr;
350 int oldsize;
351
352 if ( sol->nameout )
354
355 if ( solout && strlen(solout) ) {
356 MMG5_ADD_MEM(mesh,(strlen(solout)+1)*sizeof(char),"output sol name",
357 fprintf(stderr," Exit program.\n");
358 return 0);
359 MMG5_SAFE_CALLOC(sol->nameout,strlen(solout)+1,char,return 0);
360 strcpy(sol->nameout,solout);
361 }
362 else {
363 if ( mesh->nameout && strlen(mesh->nameout) ) {
364 ptr = strstr(mesh->nameout,".mesh");
365 if ( ptr ) {
366 MMG5_SAFE_CALLOC(sol->nameout,strlen(mesh->nameout)+1,char,return 0);
367 oldsize = strlen(mesh->nameout)+1;
368 }
369 else {
370 MMG5_SAFE_CALLOC(sol->nameout,strlen(mesh->nameout)+6,char,return 0);
371 oldsize = strlen(mesh->nameout)+6;
372 }
373 strcpy(sol->nameout,mesh->nameout);
374 ptr = strstr(sol->nameout,".mesh");
375 if ( ptr )
376 /* the sol file is renamed with the meshfile without extension */
377 *ptr = '\0';
378 strcat(sol->nameout,".sol");
379 MMG5_ADD_MEM(mesh,(strlen(sol->nameout)+1)*sizeof(char),"output sol name",
380 fprintf(stderr," Exit program.\n");
381 return 0);
382 MMG5_SAFE_REALLOC(sol->nameout,oldsize,(strlen(sol->nameout)+1),char,
383 "output sol name",return 0);
384 }
385 else {
386 fprintf(stderr,"\n ## Error: %s: no name for output mesh. please, use",
387 __func__);
388 fprintf(stderr," the MMG5_Set_outputMeshName to set the mesh name.\n");
389 return 0;
390 }
391 }
392 return 1;
393}
394
396 MMG5_pPoint ppt;
397 MMG5_int k,iadr;
398
399 if ( met->size == 1 ) {
400 for (k=1; k<=mesh->np; k++) {
401 ppt = &mesh->point[k];
402 if ( !MG_VOK(ppt) ) continue;
403 met->m[k] = hsiz;
404 }
405 }
406 else {
407 hsiz = 1./(hsiz*hsiz);
408
409 if ( mesh->dim==2 ) {
410 for (k=1; k<=mesh->np; k++) {
411 ppt = &mesh->point[k];
412 if ( !MG_VOK(ppt) ) continue;
413
414 iadr = 3*k;
415 met->m[iadr] = hsiz;
416 met->m[iadr+1] = 0.;
417 met->m[iadr+2] = hsiz;
418 }
419 }
420 else {
421 assert ( mesh->dim==3 );
422 for (k=1; k<=mesh->np; k++) {
423 ppt = &mesh->point[k];
424 if ( !MG_VOK(ppt) ) continue;
425
426 iadr = 6*k;
427 met->m[iadr] = hsiz;
428 met->m[iadr+1] = 0.;
429 met->m[iadr+2] = 0.;
430 met->m[iadr+3] = hsiz;
431 met->m[iadr+4] = 0.;
432 met->m[iadr+5] = hsiz;
433 }
434 }
435 }
436
437 return;
438}
439
441 int i;
442
443 if ( sol ) {
444 if ( mesh->nsols ) {
445 for ( i=0; i<mesh->nsols; ++i ) {
446 MMG5_DEL_MEM(mesh,(*sol)[i].m);
447 }
448 }
450 }
451
452 return 1;
453}
454
463
464 if ( mesh->point )
466
467 if ( mesh->xpoint )
469
470 if ( mesh->edge )
472
473 if ( mesh->adja )
475
476 if ( mesh->tria )
478
479 if ( mesh->adjt )
481
482 /* sol */
483 if ( sol && sol->m )
485
486 /* mesh->info */
487 if ( mesh->info.npar && mesh->info.par )
489
490 if ( mesh->info.nmat ) {
491 if( mesh->info.mat )
493 if( mesh->info.invmat.lookup )
495 }
496
497 if ( mesh->info.imprim>5 || mesh->info.ddebug ) {
498 printf(" MEMORY USED AT END (Bytes) %zu\n",mesh->memCur);
499 }
500
501 return;
502}
503
512
513 /* mesh */
514 if ( mesh->nameout ) {
516 }
517
518 if ( mesh->namein ) {
520 }
521
522 /* met */
523 if ( met ) {
524 if ( met->namein ) {
526 }
527
528 if ( met->nameout ) {
530 }
531 }
532}
533
534inline
535int MMG5_Set_defaultTruncatureSizes(MMG5_pMesh mesh,int8_t sethmin,int8_t sethmax) {
536
537 if ( !sethmin ) {
538 if ( sethmax ) {
540 } else {
542 }
543 }
544
545 if ( !sethmax ) {
546 if ( sethmin ) {
548 }
549 else {
551 }
552 }
553
554 if ( mesh->info.hmax < mesh->info.hmin ) {
555 assert ( sethmin && sethmax );
556 fprintf(stderr,"\n ## Error: %s: Mismatched options:"
557 " minimal mesh size larger than maximal one.\n",__func__);
558 return 0;
559 }
560
561 if ( mesh->info.ddebug ) {
562 /* print unscaled values for debug purpose */
563 fprintf(stdout," After truncature computation: hmin %lf (user setted %d)\n"
564 " hmax %lf (user setted %d)\n",
567 }
568
569 return 1;
570}
571
573
574 if ( mesh->info.hmin > mesh->info.hsiz ) {
575 fprintf(stderr,"\n ## Error: %s: Mismatched options: hmin (%e) is greater"
576 " than hsiz (%e). Exit Program.\n",__func__,
578 return 0;
579 }
580
581 if ( mesh->info.hmax > 0. && mesh->info.hmax < mesh->info.hsiz ) {
582 fprintf(stderr,"\n ## Error: %s: Mismatched options: hmax (%e) is lower"
583 " than hsiz (%e). Exit Program.\n",__func__,
585 return 0;
586 }
587
588 *hsiz = mesh->info.hsiz;
589
591 return 0;
592 }
593
594 if ( mesh->info.sethmin ) {
595 *hsiz = MG_MAX(mesh->info.hmin,*hsiz);
596 }
597
598 if ( mesh->info.sethmax ) {
599 *hsiz = MG_MIN(mesh->info.hmax,*hsiz);
600 }
601
602 /* Set hmin */
603 if ( !mesh->info.sethmin ) {
604 if ( mesh->info.sethmax ) {
605 mesh->info.hmin = MG_MIN(0.1*(*hsiz),0.1*mesh->info.hmax);
606 } else {
607 mesh->info.hmin = 0.1*(*hsiz);
608 }
609 }
610
611 /* Set hmax */
612 if ( !mesh->info.sethmax ) {
613 if ( mesh->info.sethmin ) {
614 mesh->info.hmax = MG_MAX(10.*(*hsiz),10.*mesh->info.hmin);
615 } else {
616 mesh->info.hmax = 10.*(*hsiz);
617 }
618 }
619
620 if ( mesh->info.ddebug ) {
621 /* print unscaled values for debug purpose */
622 fprintf(stdout," After hsiz computation: hmin %lf (user setted %d)\n"
623 " hmax %lf (user setted %d)\n",
626 }
627
628 return 1;
629}
630
631/* Useful tools to manage C strings */
632char *MMG5_Get_basename(char *path) {
633 char *s = strrchr(path, '/');
634
635 if (!s)
636 return strdup(path);
637 else
638 return strdup(s + 1);
639}
640
641
643{
644 switch (ent)
645 {
646 case MMG5_Noentity:
647 return "MMG5_Noentity";
648 break;
649 case MMG5_Vertex:
650 return "MMG5_Vertex";
651 break;
652 case MMG5_Edg:
653 return "MMG5_Edg";
654 break;
655 case MMG5_Triangle:
656 return "MMG5_Triangle";
657 break;
658 case MMG5_Tetrahedron:
659 return "MMG5_Tetrahedron";
660 break;
661 default:
662 return"MMG5_Unknown";
663 }
664}
665const char* MMG5_Get_typeName(enum MMG5_type typ)
666{
667 switch (typ)
668 {
669 case MMG5_Notype:
670 return "MMG5_Notype";
671 break;
672 case MMG5_Scalar:
673 return "MMG5_Scalar";
674 break;
675 case MMG5_Vector:
676 return "MMG5_Vector";
677 break;
678 case MMG5_Tensor:
679 return "MMG5_Tensor";
680 break;
681 default:
682 return "MMG5_Unknown";
683 }
684}
685
686const char* MMG5_Get_tagName(int tag)
687{
688 static char tags_name[1024];
689
690 if ( !tag )
691 {
692 return "No tag";
693 }
694
695 if ( tag & MG_NUL ) {
696 return "Removed";
697 }
698
699 strcpy(tags_name, "\0");
700
701 if ( tag & MG_REF ) {
702 strcat(tags_name,"Reference ");
703 }
704
705 if ( tag & MG_GEO) {
706 strcat(tags_name,"Ridge ");
707 }
708
709 if ( tag & MG_REQ) {
710 strcat(tags_name,"Required ");
711 }
712
713 if ( tag & MG_NOM) {
714 strcat(tags_name,"Non-manifold ");
715 }
716
717 if ( tag & MG_BDY) {
718 strcat(tags_name,"Boundary ");
719 }
720
721 if ( tag & MG_CRN) {
722 strcat(tags_name,"Corner ");
723 }
724
725 if ( tag & MG_NOSURF) {
726 strcat(tags_name,"Nosurf ");
727 }
728
729 if ( tag & MG_OPNBDY) {
730 strcat(tags_name,"Opnbdy ");
731 }
732
733 if ( tag & MG_OLDPARBDY) {
734 strcat(tags_name,"Old-parbdy ");
735 }
736
737 if ( tag & MG_PARBDYBDY) {
738 strcat(tags_name,"Parbdybdy ");
739 }
740
741 if ( tag & MG_PARBDY) {
742 strcat(tags_name,"Parbdy ");
743 }
744 strcat(tags_name,"tag(s).");
745
746 return tags_name;
747}
748
760int MMG5_Get_format( char *ptr, int fmt ) {
761 /* Default is the Medit file format or a format given as input */
762 int defFmt = fmt;
763
764 if ( !ptr ) return defFmt;
765
766 if ( !strncmp ( ptr,".meshb",strlen(".meshb") ) ) {
768 }
769 else if ( !strncmp( ptr,".mesh",strlen(".mesh") ) ) {
770 return MMG5_FMT_MeditASCII;
771 }
772 else if ( !strncmp( ptr,".mshb",strlen(".mshb") ) ) {
773 return MMG5_FMT_GmshBinary;
774 }
775 else if ( !strncmp( ptr,".msh",strlen(".msh") ) ) {
776 return MMG5_FMT_GmshASCII;
777 }
778 else if ( !strncmp ( ptr,".pvtu",strlen(".pvtu") ) ) {
779 return MMG5_FMT_VtkPvtu;
780 }
781 else if ( !strncmp ( ptr,".vtu",strlen(".vtu") ) ) {
782 return MMG5_FMT_VtkVtu;
783 }
784 else if ( !strncmp ( ptr,".pvtp",strlen(".pvtu") ) ) {
785 return MMG5_FMT_VtkPvtp;
786 }
787 else if ( !strncmp ( ptr,".vtp",strlen(".vtp") ) ) {
788 return MMG5_FMT_VtkVtp;
789 }
790 else if ( !strncmp ( ptr,".vtk",strlen(".vtk") ) ) {
791 return MMG5_FMT_VtkVtk;
792 }
793 else if ( !strncmp ( ptr,".node",strlen(".node") ) ) {
794 return MMG5_FMT_Tetgen;
795 }
796
797 return defFmt;
798}
799
808const char* MMG5_Get_formatName(enum MMG5_Format fmt)
809{
810 switch (fmt)
811 {
813 return "MMG5_FMT_MeditASCII";
814 break;
816 return "MMG5_FMT_MeditBinary";
817 break;
818 case MMG5_FMT_VtkVtu:
819 return "MMG5_FMT_VtkVtu";
820 break;
821 case MMG5_FMT_VtkVtp:
822 return "MMG5_FMT_VtkVtp";
823 break;
824 case MMG5_FMT_VtkPvtu:
825 return "MMG5_FMT_VtkPvtu";
826 break;
827 case MMG5_FMT_VtkPvtp:
828 return "MMG5_FMT_VtkPvtp";
829 break;
830 case MMG5_FMT_VtkVtk:
831 return "MMG5_FMT_VtkVtk";
832 break;
834 return "MMG5_FMT_GmshASCII";
835 break;
837 return "MMG5_FMT_GmshBinary";
838 break;
839 case MMG5_FMT_Tetgen:
840 return "MMG5_FMT_Tetgen";
841 break;
842 default:
843 return "MMG5_Unknown";
844 }
845}
846
857 const char pathsep='/';
858 char *dot,*lastpath;
859
860 if ( !filename ) {
861 return NULL;
862 }
863
864 dot = strrchr(filename, '.');
865 lastpath = (pathsep == 0) ? NULL : strrchr (filename, pathsep);
866
867 if ( (!dot) || dot == filename || (lastpath>dot) || (!strcmp(dot,".o")) ) {
868 /* No extension */
869 return filename + strlen(filename);
870 }
871
872 return dot;
873}
874
883char *MMG5_Get_path(char *path) {
884 char *lastpath,*retpath;
885 int len;
886
887 if ( path == NULL) return NULL;
888
889 lastpath = (MMG5_PATHSEP == 0) ? NULL : strrchr (path, MMG5_PATHSEP);
890
891 if ( !lastpath ) {
892 return NULL;
893 }
894
895
896 len = 0;
897 while ( path+len != lastpath ) {
898 ++len;
899 }
900
901 MMG5_SAFE_MALLOC(retpath,len+1,char,return NULL);
902
903 /* Copy the string without the extension and add \0 */
904 strncpy ( retpath, path, len );
905 retpath[len] = '\0';
906
907 return retpath;
908}
909
918char *MMG5_Remove_ext (char* path,char *ext) {
919 int len;
920 char *retpath, *lastext, *lastpath;
921 char *extloc;
922
923 /* Default extension if not provided */
924 if ( (!ext) || !*ext ) {
925 extloc = ".";
926 }
927 else {
928 extloc = ext;
929 }
930
931 /* Error checks and string allocation. */
932 if ( path == NULL) return NULL;
933
934 /* Find the relevant characters and the length of the string without
935 * extension */
936 lastext = strstr (path, extloc);
937 lastpath = (MMG5_PATHSEP == 0) ? NULL : strrchr (path, MMG5_PATHSEP);
938
939 if ( lastext == NULL || (lastpath != NULL && lastpath > lastext) ) {
940 /* No extension or the extension is left from a separator (i.e. it is not an
941 * extension) */
942 len = strlen(path);
943 }
944 else {
945 /* An extension is found */
946 len = 0;
947 while ( path+len != lastext ) {
948 ++len;
949 }
950 }
951
952 MMG5_SAFE_MALLOC(retpath,len+1,char,return NULL);
953
954 /* Copy the string without the extension and add \0 */
955 strncpy ( retpath, path, len );
956 retpath[len] = '\0';
957
958 return retpath;
959}
const char * MMG5_Get_typeName(enum MMG5_type typ)
int MMG5_Compute_constantSize(MMG5_pMesh mesh, MMG5_pSol met, double *hsiz)
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)
Definition: API_functions.c:51
const char * MMG5_Get_tagName(int tag)
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 * meshin
MMG5_pMesh * mesh
MMG5_pMesh char * filename
MMG5_type
Type of solutions.
Definition: libmmgtypes.h:211
@ MMG5_Vector
Definition: libmmgtypes.h:214
@ MMG5_Tensor
Definition: libmmgtypes.h:215
@ MMG5_Scalar
Definition: libmmgtypes.h:213
@ MMG5_Notype
Definition: libmmgtypes.h:212
MMG5_Format
Type of supported file format.
Definition: libmmgtypes.h:234
@ MMG5_FMT_MeditBinary
Definition: libmmgtypes.h:236
@ MMG5_FMT_Tetgen
Definition: libmmgtypes.h:244
@ MMG5_FMT_VtkVtk
Definition: libmmgtypes.h:243
@ MMG5_FMT_GmshBinary
Definition: libmmgtypes.h:238
@ MMG5_FMT_VtkPvtp
Definition: libmmgtypes.h:239
@ MMG5_FMT_Unknown
Definition: libmmgtypes.h:245
@ MMG5_FMT_GmshASCII
Definition: libmmgtypes.h:237
@ MMG5_FMT_MeditASCII
Definition: libmmgtypes.h:235
@ MMG5_FMT_VtkVtp
Definition: libmmgtypes.h:242
@ MMG5_FMT_VtkPvtu
Definition: libmmgtypes.h:240
@ MMG5_FMT_VtkVtu
Definition: libmmgtypes.h:241
#define MG_ISO
Definition: libmmgtypes.h:65
MMG5_entities
Type of mesh entities.
Definition: libmmgtypes.h:222
@ MMG5_Noentity
Definition: libmmgtypes.h:223
@ MMG5_Vertex
Definition: libmmgtypes.h:224
@ MMG5_Tetrahedron
Definition: libmmgtypes.h:227
@ MMG5_Edg
Definition: libmmgtypes.h:225
@ MMG5_Triangle
Definition: libmmgtypes.h:226
#define MG_REQ
#define MMG5_BITWIZE_MB_TO_B
#define MG_GEO
#define MMG5_SAFE_CALLOC(ptr, size, type, law)
#define MMG5_HGRADREQ
#define MMG5_NONSET
size_t MMG5_memSize(void)
Definition: tools.c:852
#define MMG5_NONSET_HMIN
#define MG_OPNBDY
#define MG_NUL
#define MG_PARBDY
#define MMG5_LAG
#define MG_MIN(a, b)
#define MG_MAX(a, b)
#define MMG5_GAP
#define MMG5_ADD_MEM(mesh, size, message, law)
#define MMG5_SAFE_REALLOC(ptr, prevSize, newSize, type, message, law)
#define MMG5_HGRAD
#define MMG5_HMAXCOE
#define MG_OLDPARBDY
#define MMG5_NONSET_MEM
#define MMG5_PATHSEP
#define MMG5_MEMPERCENT
#define MMG5_NONSET_HMAX
#define MMG5_MEMMAX
#define MG_VOK(ppt)
#define MMG5_OFF
#define MMG5_HMINCOE
#define MG_CRN
#define MG_BDY
#define MMG5_ANGEDG
#define MMG5_SAFE_MALLOC(ptr, size, type, law)
#define MMG5_NONSET_HSIZ
#define MG_NOSURF
#define MG_NOM
#define MMG5_HAUSD
int MMG5_check_setted_hminhmax(MMG5_pMesh mesh)
Definition: scalem.c:116
#define MG_REF
#define MG_PARBDYBDY
#define MMG5_DEL_MEM(mesh, ptr)
Store input parameters of the run.
Definition: libmmgtypes.h:516
int8_t iso
Definition: libmmgtypes.h:534
int8_t ddebug
Definition: libmmgtypes.h:532
double delta
Definition: libmmgtypes.h:519
double hsiz
Definition: libmmgtypes.h:518
int8_t sethmin
Definition: libmmgtypes.h:544
uint8_t noswap
Definition: libmmgtypes.h:546
double rmc
Definition: libmmgtypes.h:519
double hmin
Definition: libmmgtypes.h:518
MMG5_pMat mat
Definition: libmmgtypes.h:554
double hgrad
Definition: libmmgtypes.h:518
uint8_t noinsert
Definition: libmmgtypes.h:546
MMG5_int isoref
Definition: libmmgtypes.h:521
double hmax
Definition: libmmgtypes.h:518
uint8_t nomove
Definition: libmmgtypes.h:546
int8_t lag
Definition: libmmgtypes.h:540
MMG5_InvMat invmat
Definition: libmmgtypes.h:555
int8_t sethmax
Definition: libmmgtypes.h:545
uint8_t nosizreq
Definition: libmmgtypes.h:546
MMG5_pPar par
Definition: libmmgtypes.h:517
double dhd
Definition: libmmgtypes.h:518
double hgradreq
Definition: libmmgtypes.h:518
double hausd
Definition: libmmgtypes.h:518
int * lookup
Definition: libmmgtypes.h:508
MMG mesh structure.
Definition: libmmgtypes.h:605
size_t memCur
Definition: libmmgtypes.h:607
MMG5_Info info
Definition: libmmgtypes.h:651
MMG5_pPoint point
Definition: libmmgtypes.h:641
char * nameout
Definition: libmmgtypes.h:653
MMG5_int * adja
Definition: libmmgtypes.h:624
size_t memMax
Definition: libmmgtypes.h:606
MMG5_pxPoint xpoint
Definition: libmmgtypes.h:642
double gap
Definition: libmmgtypes.h:608
MMG5_pTria tria
Definition: libmmgtypes.h:647
MMG5_int np
Definition: libmmgtypes.h:612
MMG5_pEdge edge
Definition: libmmgtypes.h:649
char * namein
Definition: libmmgtypes.h:652
MMG5_int * adjt
Definition: libmmgtypes.h:628
Structure to store points of a MMG mesh.
Definition: libmmgtypes.h:270
char * nameout
Definition: libmmgtypes.h:674
char * namein
Definition: libmmgtypes.h:673
double * m
Definition: libmmgtypes.h:671