83 fprintf(stdout,
"-3dMedit val read and write for gmsh visu: output only if val=1, input and output if val=2, input if val=3\n");
86 fprintf(stdout,
"-nofem do not force Mmg to create a finite element mesh \n");
87 fprintf(stdout,
"-nosurf no surface modifications\n");
95 fprintf(stdout,
"\n\n");
108 for ( i=1; i< argc; ++i ) {
109 if ( !strcmp(argv[i],
"-val") ) {
118 if ( *argv[i] ==
'-' ) {
124 if ( !strcmp(argv[i],
"-ar") && ++i < argc ) {
135 if ( !strcmp(argv[i],
"-default") ) {
143 if ( !strcmp(argv[i],
"-hmin") && ++i < argc ) {
148 else if ( !strcmp(argv[i],
"-hmax") && ++i < argc ) {
153 else if ( !strcmp(argv[i],
"-hsiz") && ++i < argc ) {
159 else if ( !strcmp(argv[i],
"-hausd") && ++i <= argc ) {
164 else if ( !strcmp(argv[i],
"-hgradreq") && ++i <= argc ) {
169 else if ( !strcmp(argv[i],
"-hgrad") && ++i <= argc ) {
180 if ( !strcmp(argv[i],
"-in") ) {
181 if ( ++i < argc && isascii(argv[i][0]) && argv[i][0]!=
'-') {
188 fprintf(stderr,
"Missing filname for %c%c\n",argv[i-1][1],argv[i-1][2]);
193 else if ( !strcmp(argv[i],
"-isoref") && ++i <= argc ) {
204 if ( !strcmp(argv[i],
"-lag") ) {
205 if ( ++i < argc && isdigit(argv[i][0]) ) {
209 else if ( i == argc ) {
210 fprintf(stderr,
"Missing argument option %s\n",argv[i-1]);
215 fprintf(stderr,
"Missing argument option %s\n",argv[i-1]);
220 else if ( !strcmp(argv[i],
"-ls") ) {
223 if ( ++i < argc && (isdigit(argv[i][0]) ||
224 (argv[i][0]==
'-' && isdigit(argv[i][1])) ) ) {
230 else if ( !strcmp(argv[i],
"-lssurf") ) {
233 if ( ++i < argc && (isdigit(argv[i][0]) ||
234 (argv[i][0]==
'-' && isdigit(argv[i][1])) ) ) {
242 if ( !strcmp(argv[i],
"-met") ) {
244 fprintf(stderr,
"No metric structure allocated for %c%c%c option\n",
245 argv[i-1][1],argv[i-1][2],argv[i-1][3]);
248 if ( ++i < argc && isascii(argv[i][0]) && argv[i][0]!=
'-' ) {
253 fprintf(stderr,
"Missing filname for %c%c%c\n",argv[i-1][1],argv[i-1][2],argv[i-1][3]);
258 else if (!strcmp(argv[i],
"-m") ) {
259 if ( ++i < argc && isdigit(argv[i][0]) ) {
264 fprintf(stderr,
"Missing argument option %c\n",argv[i-1][1]);
271 if ( !strcmp(argv[i],
"-nofem") ) {
275 if ( !strcmp(argv[i],
"-nreg") ) {
279 else if ( !strcmp(argv[i],
"-nr") ) {
283 else if ( !strcmp(argv[i],
"-nsd") ) {
284 if ( ++i < argc && isdigit(argv[i][0]) ) {
289 fprintf(stderr,
"Missing argument option %c\n",argv[i-1][1]);
293 }
else if ( !strcmp(argv[i],
"-noswap") ) {
297 else if( !strcmp(argv[i],
"-noinsert") ) {
301 else if( !strcmp(argv[i],
"-nomove") ) {
305 else if( !strcmp(argv[i],
"-nosurf") ) {
309 else if( !strcmp(argv[i],
"-nosizreq") ) {
316 if ( (!strcmp(argv[i],
"-out")) || (!strcmp(argv[i],
"-o")) ) {
317 if ( ++i < argc && isascii(argv[i][0]) && argv[i][0]!=
'-') {
321 fprintf(stderr,
"Missing filname for %c%c%c\n",
322 argv[i-1][1],argv[i-1][2],argv[i-1][3]);
327 else if ( !strcmp(argv[i],
"-opnbdy") ) {
331 else if( !strcmp(argv[i],
"-optim") ) {
337 if ( !strcmp(argv[i],
"-rmc") ) {
340 if ( ++i < argc && (isdigit(argv[i][0]) ) ) {
348 if ( !strcmp(argv[i],
"-sol") ) {
353 if ( ++i < argc && isascii(argv[i][0]) && argv[i][0]!=
'-' ) {
358 fprintf(stderr,
"Missing filname for %c%c%c\n",argv[i-1][1],argv[i-1][2],argv[i-1][3]);
366 if ( argv[i][0] ==
'-' || isdigit(argv[i][0]) ) {
374 fprintf(stderr,
"Missing argument option %c\n",argv[i-1][1]);
380 if ( !strcmp(argv[i],
"-xreg") ) {
386 if(!strcmp(argv[i],
"-3dMedit") ) {
387 if ( ++i < argc && isdigit(argv[i][0]) ) {
392 fprintf(stderr,
"Missing argument option %c\n",argv[i-1][1]);
399 fprintf(stderr,
"Unrecognized option %s\n",argv[i]);
420 fprintf(stdout,
" Argument %s ignored\n",argv[i]);
430 fprintf(stdout,
"\n -- PRINT (0 10(advised) -10) ?\n");
438 fprintf(stdout,
" -- INPUT MESH NAME ?\n");
460 if (
tmp->namein == NULL ) {
483 fprintf(stdout,
"\n\n");
498 int ret,i,j,npar,nbr,split;
499 MMG5_int ref,rin,rex,br;
510 if ( ptr ) *ptr =
'\0';
511 strcat(data,
".mmg2d");
513 in = fopen(data,
"rb");
516 sprintf(data,
"%s",
"DEFAULT.mmg2d");
517 in = fopen(data,
"rb");
523 fprintf(stdout,
"\n %%%% %s OPENED\n",data);
527 while ( !feof(in) ) {
528 ret = fscanf(in,
"%255s",data);
529 if ( !ret || feof(in) )
break;
530 for (i=0; (size_t)i<strlen(data); i++) data[i] = tolower(data[i]);
533 if ( !strcmp(data,
"lsreferences") ) {
534 ret = fscanf(in,
"%d",&npar);
536 fprintf(stderr,
" %%%% Wrong format for lsreferences: %d\n",npar);
545 fgetpos(in,&position);
549 if ( strcmp(data,
"nosplit") ) {
550 fsetpos(in,&position);
561 else if ( !strcmp(data,
"parameters") ) {
562 ret = fscanf(in,
"%d",&npar);
565 fprintf(stderr,
" %%%% Wrong format for parameters: %d\n",npar);
569 fprintf(stderr,
" %%%% Too many local parameters %d. Abort\n",npar);
579 ret = fscanf(in,
"%" MMG5_PRId
" %255s",&ref,data);
580 if ( ret ) ret = fscanf(in,
"%f %f %f",&fp1,&fp2,&fp3);
583 fprintf(stderr,
" %%%% Wrong format: %s\n",data);
587 for (j=0; (size_t)j<strlen(data); j++) data[j] = tolower(data[j]);
588 if ( !strcmp(data,
"triangles") || !strcmp(data,
"triangle") ) {
593 else if ( !strcmp(data,
"edges") || !strcmp(data,
"edge") ) {
599 fprintf(stderr,
" %%%% Wrong format: %s\n",data);
606 else if ( !strcmp(data,
"lsbasereferences") ) {
619 fprintf(stderr,
" %%%% Wrong format: %s\n",data);
640 MMG5_int *adja,k,i,j,i1,i2,iel;
647 fprintf(stderr,
"\n ## Error: %s: unable to create "
648 "adjacency table.\n",__func__);
654 for ( k=1; k<=
mesh->
nt; k++ ) {
656 if ( !
MG_EOK(pt) )
continue;
660 for ( i=0; i<3; i++ ) {
666 if ( (!iel) || (pt->
ref != pt1->
ref) ||
682 printf(
" Exit program.\n");
685 MMG5_Edge,
"non bdy edges arrray",
return 0);
689 printf(
" Exit program.\n");
692 MMG5_Edge,
"non bdy edges arrray",
return 0);
696 for ( k=1; k<=
mesh->
nt; k++ ) {
698 if ( !
MG_EOK(pt) )
continue;
702 for ( i=0; i<3; i++ ) {
710 if ( (!iel) || (pt->
ref != pt1->
ref) ||
736 fprintf(stderr,
"\n ## Error: %s: edge array is not allocated.\n"
737 " Please, call the MMG2D_Get_numberOfNonBdyEdges function"
738 " before the %s one.\n",
743 ptr_c = ptr_c-
sizeof(size_t);
744 na_tot = *((
size_t*)ptr_c);
747 fprintf(stderr,
"\n ## Error: %s: no internal edge.\n"
748 " Please, call the MMG2D_Get_numberOfNonBdyEdges function"
749 " before the %s one and check that the number of internal"
750 " edges is non null.\n",
755 if (
mesh->
namax+idx > (MMG5_int)na_tot ) {
756 fprintf(stderr,
"\n ## Error: %s: Can't get the internal edge of index %" MMG5_PRId
"."
757 " Index must be between 1 and %"MMG5_PRId
".\n",
758 __func__,idx,(MMG5_int)na_tot-
mesh->
namax);
781 listri[0] =
mesh->
adja[3*(kel-1)+1]/3;
782 listri[1] =
mesh->
adja[3*(kel-1)+2]/3;
783 listri[2] =
mesh->
adja[3*(kel-1)+3]/3;
795 if ( !start )
return 0;
804 MMG5_int prevk,k,*adja,nbpoi;
808 for ( iploc=0; iploc<3; ++iploc ) {
809 if ( pt->
v[iploc] == ip )
break;
819 fprintf(stderr,
"\n ## Warning: %s: unable to compute adjacent"
820 " vertices of the vertex %" MMG5_PRId
":\nthe ball of point contain too many"
821 " elements.\n",__func__,ip);
834 while ( k && k != start );
836 if ( k > 0 )
return nbpoi;
840 fprintf(stderr,
"\n ## Warning: %s: unable to compute adjacent vertices of the"
841 " vertex %" MMG5_PRId
":\nthe ball of point contain too many elements.\n",
859 fprintf(stderr,
"\n ## Warning: %s: unable to compute adjacent vertices of the"
860 " vertex %" MMG5_PRId
":\nthe ball of point contain too many elements.\n",
882 fprintf(stderr,
" ## Error: %s: the main fonction of the Mmg library must be"
883 " called before this function.\n",__func__);
899 MMG5_int ia0,ib0,ia1,ib1;
902 ktri[0] = ktri[1] = 0;
907 if ( !
ier )
return 0;
914 itri =
mesh->
adja[3*(*ktri-1) + *ied + 1 ];
927 assert ( ( (ia0 == ia1) && (ib0 == ib1) ) ||
928 ( (ia0 == ib1) && (ib0 == ia1) ) );
970 for ( k=1; k<=
mesh->
np; ++k ) {
int MMG5_Compute_constantSize(MMG5_pMesh mesh, MMG5_pSol met, double *hsiz)
void MMG5_Set_constantSize(MMG5_pMesh mesh, MMG5_pSol met, double hsiz)
char * MMG5_Get_filenameExt(char *filename)
int MMG2D_Set_lsBaseReference(MMG5_pMesh mesh, MMG5_pSol sol, MMG5_int br)
int MMG2D_Set_iparameter(MMG5_pMesh mesh, MMG5_pSol sol, int iparam, MMG5_int val)
int MMG2D_Set_solSize(MMG5_pMesh mesh, MMG5_pSol sol, int typEntity, MMG5_int np, int typSol)
int MMG2D_Set_inputSolName(MMG5_pMesh mesh, MMG5_pSol sol, const char *solin)
int MMG2D_Set_inputMeshName(MMG5_pMesh mesh, const char *meshin)
int MMG2D_Set_localParameter(MMG5_pMesh mesh, MMG5_pSol sol, int typ, MMG5_int ref, double hmin, double hmax, double hausd)
int MMG2D_Set_dparameter(MMG5_pMesh mesh, MMG5_pSol sol, int dparam, double val)
int MMG2D_Set_multiMat(MMG5_pMesh mesh, MMG5_pSol sol, MMG5_int ref, int split, MMG5_int rin, MMG5_int rout)
int MMG2D_Set_outputMeshName(MMG5_pMesh mesh, const char *meshout)
int MMG2D_Set_outputSolName(MMG5_pMesh mesh, MMG5_pSol sol, const char *solout)
MMG5_pMesh MMG5_pSol * sol
if(!ier) exit(EXIT_FAILURE)
int MMG5_gradsizreq_ani(MMG5_pMesh mesh, MMG5_pSol met)
int MMG5_compute_meanMetricAtMarkedPoints_ani(MMG5_pMesh mesh, MMG5_pSol met)
int MMG2D_defsiz_ani(MMG5_pMesh mesh, MMG5_pSol met)
int MMG5_eigensym(double m[3], double lambda[2], double vp[2][2])
int MMG2D_hashTria(MMG5_pMesh mesh)
int MMG2D_intmet_iso(MMG5_pMesh mesh, MMG5_pSol met, MMG5_int k, int8_t i, MMG5_int ip, double s)
int MMG2D_intmet_ani(MMG5_pMesh mesh, MMG5_pSol met, MMG5_int k, int8_t i, MMG5_int ip, double s)
int MMG5_gradsiz_iso(MMG5_pMesh mesh, MMG5_pSol met)
int MMG5_compute_meanMetricAtMarkedPoints_iso(MMG5_pMesh mesh, MMG5_pSol met)
int MMG5_gradsizreq_iso(MMG5_pMesh mesh, MMG5_pSol met)
int MMG2D_defsiz_iso(MMG5_pMesh mesh, MMG5_pSol met)
double MMG2D_lencurv_iso(MMG5_pMesh mesh, MMG5_pSol met, MMG5_int ip1, MMG5_int ip2)
double MMG2D_lencurv_ani(MMG5_pMesh mesh, MMG5_pSol met, MMG5_int ip1, MMG5_int ip2)
API headers for the mmg2d library.
@ MMG2D_IPARAM_numsubdomain
@ MMG2D_IPARAM_numberOfLocalParam
@ MMG2D_IPARAM_numberOfLSBaseReferences
@ MMG2D_IPARAM_numberOfMat
@ MMG2D_DPARAM_angleDetection
LIBMMG2D_EXPORT int(* MMG2D_doSol)(MMG5_pMesh mesh, MMG5_pSol met)
MMG5_int MMG2D_findTria(MMG5_pMesh, MMG5_int)
int lissmet_ani(MMG5_pMesh mesh, MMG5_pSol sol)
double MMG2D_caltri_ani(MMG5_pMesh mesh, MMG5_pSol sol, MMG5_pTria)
int MMG2D_doSol_iso(MMG5_pMesh mesh, MMG5_pSol sol)
int MMG2D_doSol_ani(MMG5_pMesh mesh, MMG5_pSol sol)
double MMG2D_caltri_iso(MMG5_pMesh mesh, MMG5_pSol sol, MMG5_pTria)
#define MMG5_MMAT_NoSplit
#define MMG5_ADD_MEM(mesh, size, message, law)
static const uint8_t MMG5_iprv2[3]
static const uint8_t MMG5_inxt2[6]
#define MMG5_FILESTR_LGTH
#define MMG_FSCANF(stream, format,...)
#define MMG5_DEL_MEM(mesh, ptr)
#define MMG5_SAFE_RECALLOC(ptr, prevSize, newSize, type, message, law)
Structure to store edges of a MMG mesh.