47 long posnp,posnt,posne,posncor,posnq,posned,posnr;
48 long posntreq,posnpreq,posnormal,posnc1;
49 MMG5_int k,ia,nq,nri,ip,idn,ng,npreq,nref;
51 MMG5_int ncor,nedreq,ntreq,posnedreq,bpos;
52 int binch,bin,iswp,bdim;
57 posnp = posnt = posne = posncor = posnq = 0;
58 posned = posnr = posnpreq = posntreq = posnc1 = npreq = 0;
59 posnedreq = posnormal = 0;
60 ncor = nri = ng = nedreq = nq = ntreq = 0;
63 bpos = ia = idn = ip = 0;
71 ptr = strstr(data,
".mesh");
74 strcat(data,
".meshb");
75 if( !(inm = fopen(data,
"rb")) ) {
77 ptr = strstr(data,
".mesh");
80 if( !(inm = fopen(data,
"rb")) ) {
88 ptr = strstr(data,
".meshb");
90 if( !(inm = fopen(data,
"rb")) ) {
97 fprintf(stdout,
" %%%% %s OPENED\n",data);
102 while(fscanf(inm,
"%127s",&chaine[0])!=EOF && strncmp(chaine,
"End",strlen(
"End")) ) {
103 if ( chaine[0] ==
'#' ) {
107 if(s[strlen(s)-1]==
'\n')
break;
111 if(!strncmp(chaine,
"MeshVersionFormatted",strlen(
"MeshVersionFormatted"))) {
114 }
else if(!strncmp(chaine,
"Dimension",strlen(
"Dimension"))) {
117 fprintf(stderr,
"BAD DIMENSION : %d\n",
mesh->
dim);
121 }
else if(!strncmp(chaine,
"Vertices",strlen(
"Vertices"))) {
125 }
else if(!strncmp(chaine,
"RequiredVertices",strlen(
"RequiredVertices"))) {
127 posnpreq = ftell(inm);
129 }
else if(!strncmp(chaine,
"Triangles",strlen(
"Triangles"))) {
134 else if(!strncmp(chaine,
"RequiredTriangles",strlen(
"RequiredTriangles"))) {
136 posntreq = ftell(inm);
138 }
else if(!strncmp(chaine,
"Quadrilaterals",strlen(
"Quadrilaterals"))) {
142 }
else if(!strncmp(chaine,
"Corners",strlen(
"Corners"))) {
144 posncor = ftell(inm);
146 }
else if(!strncmp(chaine,
"Edges",strlen(
"Edges"))) {
150 }
else if(!strncmp(chaine,
"RequiredEdges",strlen(
"RequiredEdges"))) {
152 posnedreq = ftell(inm);
154 }
else if(!strncmp(chaine,
"Ridges",strlen(
"Ridges"))) {
158 }
else if(!ng && !strncmp(chaine,
"Normals",strlen(
"Normals"))) {
160 posnormal = ftell(inm);
162 }
else if(!strncmp(chaine,
"NormalAtVertices",strlen(
"NormalAtVertices"))) {
175 fprintf(stdout,
"BAD FILE ENCODING\n");
179 while(fread(&binch,
MMG5_SW,1,inm)!=0 && binch!=54 ) {
182 if(!bdim && binch==3) {
189 fprintf(stderr,
"BAD MESH DIMENSION : %d\n",
mesh->
dim);
193 }
else if(!
mesh->
npi && binch==4) {
200 fseek(inm,bpos,SEEK_SET);
202 }
else if(binch==15) {
207 posnpreq = ftell(inm);
209 fseek(inm,bpos,SEEK_SET);
211 }
else if(!
mesh->
nti && binch==6) {
218 fseek(inm,bpos,SEEK_SET);
220 }
else if(binch==17) {
225 posntreq = ftell(inm);
227 fseek(inm,bpos,SEEK_SET);
229 }
else if(binch==7) {
236 fseek(inm,bpos,SEEK_SET);
238 }
else if(!ncor && binch==13) {
243 posncor = ftell(inm);
245 fseek(inm,bpos,SEEK_SET);
247 }
else if(!
mesh->
na && binch==5) {
254 fseek(inm,bpos,SEEK_SET);
256 }
else if(binch==16) {
261 posnedreq = ftell(inm);
263 fseek(inm,bpos,SEEK_SET);
265 }
else if(binch==14) {
272 fseek(inm,bpos,SEEK_SET);
274 }
else if(!ng && binch==60) {
279 posnormal = ftell(inm);
281 fseek(inm,bpos,SEEK_SET);
283 }
else if(binch==20) {
290 fseek(inm,bpos,SEEK_SET);
296 fseek(inm,bpos,SEEK_SET);
302 fprintf(stdout,
" ** MISSING DATA\n");
314 fseek(inm,posnp,SEEK_SET);
315 for (k=1; k<=
mesh->
np; k++) {
319 for (i=0 ; i<3 ; i++) {
321 ppt->
c[i] = (double) fc;
325 for (i=0 ; i<3 ; i++) {
328 ppt->
c[i] = (double) fc;
335 MMG_FSCANF(inm,
"%lf %lf %lf %" MMG5_PRId
"",&ppt->
c[0],&ppt->
c[1],&ppt->
c[2],&ppt->
ref);
338 for (i=0 ; i<3 ; i++) {
346 if ( ppt->
ref < 0 ) {
356 fseek(inm,posnt,SEEK_SET);
360 MMG_FSCANF(inm,
"%" MMG5_PRId
" %" MMG5_PRId
" %" MMG5_PRId
" %" MMG5_PRId
"",&pt1->
v[0],&pt1->
v[1],&pt1->
v[2],&pt1->
ref);
363 for (i=0 ; i<3 ; i++) {
370 for (i=0; i<3; i++) {
378 fseek(inm,posntreq,SEEK_SET);
379 for (k=1; k<=ntreq; k++) {
388 fprintf(stderr,
"\n ## Warning: %s: required triangle number %8d"
389 " ignored.\n",__func__,i);
403 fseek(inm,posnq,SEEK_SET);
405 printf(
" ## Warning: %s: quadrangles automatically converted into"
406 " triangles\n.",__func__);
408 for (k=1; k<=nq; k++) {
415 MMG_FSCANF(inm,
"%" MMG5_PRId
" %" MMG5_PRId
" %" MMG5_PRId
" %" MMG5_PRId
" %" MMG5_PRId
"",&pt1->
v[0],&pt1->
v[1],&pt1->
v[2],&pt2->
v[2],&pt1->
ref);
418 for (i=0 ; i<3 ; i++) {
427 if ( pt1->
ref < 0 ) {
432 pt2->
v[0] = pt1->
v[0];
433 pt2->
v[1] = pt1->
v[2];
435 for (i=0; i<3; i++) {
447 fseek(inm,posncor,SEEK_SET);
448 for (k=1; k<=ncor; k++) {
457 fprintf(stderr,
"\n ## Warning: %s: corner number %8d ignored.\n",
469 fseek(inm,posnpreq,SEEK_SET);
470 for (k=1; k<=npreq; k++) {
479 fprintf(stderr,
"\n ## Warning: %s: required Vertices number %8d ignored\n",
493 fseek(inm,posned,SEEK_SET);
495 for (k=1; k<=
mesh->
na; k++) {
519 fseek(inm,posnr,SEEK_SET);
520 for (k=1; k<=nri; k++) {
528 if ( (ia>na) || (ia<0) ) {
529 fprintf(stderr,
"\n ## Warning: %s: ridge number %8" MMG5_PRId
" ignored.\n",
540 fseek(inm,posnedreq,SEEK_SET);
541 for (k=1; k<=nedreq; k++) {
549 if ( (ia>na) || (ia<0) ) {
550 fprintf(stderr,
"\n ## Warning: %s: required edge number %8" MMG5_PRId
" ignored\n",
562 fprintf(stderr,
"\n ## Warning: %s: your mesh don't contains Normals but contains"
563 " NormalAtVertices. The NormalAtVertices are deleted. \n",__func__);
571 fseek(inm,posnormal,SEEK_SET);
572 for (k=1; k<=ng; k++) {
573 n = &norm[3*(k-1)+1];
576 for (i=0 ; i<3 ; i++) {
581 for (i=0 ; i<3 ; i++) {
590 MMG_FSCANF(inm,
"%lf %lf %lf",&n[0],&n[1],&n[2]);
593 for (i=0 ; i<3 ; i++) {
599 dd = n[0]*n[0] + n[1]*n[1] + n[2]*n[2];
609 fseek(inm,posnc1,SEEK_SET);
613 MMG_FSCANF(inm,
"%" MMG5_PRId
" %" MMG5_PRId
"",&ip,&idn);
621 if ( idn > 0 && ip < mesh->np+1 )
622 memcpy(&
mesh->
point[ip].
n,&norm[3*(idn-1)+1],3*
sizeof(
double));
628 fprintf(stdout,
"\n $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ \n");
629 fprintf(stdout,
" WARNING : %" MMG5_PRId
" entities with unexpected refs (ref< 0).\n",nref);
630 fprintf(stdout,
" We take their absolute values.\n");
631 fprintf(stdout,
" $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ \n\n");
635 fprintf(stdout,
" NUMBER OF VERTICES %8" MMG5_PRId
" / %8" MMG5_PRId
" CORNERS/REQ. %" MMG5_PRId
" / %" MMG5_PRId
"\n",
mesh->
npi,
mesh->
npmax,ncor,npreq);
636 fprintf(stdout,
" NUMBER OF TRIANGLES %8" MMG5_PRId
" / %8" MMG5_PRId
"\n",
mesh->
nti,
mesh->
ntmax);
639 fprintf(stdout,
" NUMBER OF EDGES %8" MMG5_PRId
" RIDGES %6" MMG5_PRId
"\n",
mesh->
na,nri);
647 long posNodes,posElts,*posNodeData;
648 int ier,bin,iswp,nsols;
654 &posNodes,&posElts,&posNodeData,
655 &bin,&iswp,&nelts,&nsols);
656 if (
ier < 1 )
return (
ier);
659 fprintf(stderr,
"Error: SEVERAL SOLUTIONS FOUND (%d)\n",nsols);
674 fprintf(stderr,
" ** MISSING DATA.\n");
675 fprintf(stderr,
" Check that your mesh contains triangles.\n");
676 fprintf(stderr,
" Exit program.\n");
690 posNodes,posElts,posNodeData,
691 bin,iswp,nelts,nsols);
694 fprintf(stderr,
" ** ERROR WHEN PARSING THE INPUT FILE\n");
708 long posNodes,posElts,*posNodeData;
709 int ier,bin,iswp,nsols;
715 &posNodes,&posElts,&posNodeData,
716 &bin,&iswp,&nelts,&nsols);
717 if (
ier < 1 )
return (
ier);
722 printf(
" Exit program.\n"); fclose(inm);
736 fprintf(stderr,
" ** MISSING DATA.\n");
737 fprintf(stderr,
" Check that your mesh contains triangles.\n");
738 fprintf(stderr,
" Exit program.\n");
752 posNodes,posElts,posNodeData,
753 bin,iswp,nelts,nsols);
756 fprintf(stderr,
" ** ERROR WHEN PARSING THE INPUT FILE\n");
766 const char *filenameptr,*solnameptr;
783 fprintf(stderr,
" ## Error: %s: please provide input file name"
784 " (either in the mesh structure or as function argument).\n",
790 strcpy(
tmp,filenameptr);
816 if (
ier < 1 ) {
break; }
821 strcpy(soltmp,solnameptr);
824 fprintf(stderr,
"\n ## ERROR: WRONG DATA TYPE OR WRONG SOLUTION NUMBER.\n");
847 MMG5_int k,np,nt,nc,ng,nn,nr,nre,ntreq,bpos;
859 ptr = strstr(data,
".mesh");
861 strcat(data,
".meshb");
862 if( !(inm = fopen(data,
"wb")) ) {
863 ptr = strstr(data,
".mesh");
865 strcat(data,
".mesh");
866 if( !(inm = fopen(data,
"w")) ) {
875 ptr = strstr(data,
".meshb");
878 if( !(inm = fopen(data,
"wb")) ) {
879 fprintf(stderr,
" ** UNABLE TO OPEN %s.\n",data);
884 if( !(inm = fopen(data,
"w")) ) {
885 fprintf(stderr,
" ** UNABLE TO OPEN %s.\n",data);
892 fprintf(stdout,
" %%%% %s OPENED\n",data);
897 strcpy(&chaine[0],
"MeshVersionFormatted 2\n");
898 fprintf(inm,
"%s",chaine);
899 strcpy(&chaine[0],
"\n\nDimension 3\n");
900 fprintf(inm,
"%s ",chaine);
915 np = nc = ng = nn = nre = 0;
916 for (k=1; k<=
mesh->
np; k++) {
929 strcpy(&chaine[0],
"\n\nVertices\n");
930 fprintf(inm,
"%s",chaine);
931 fprintf(inm,
"%" MMG5_PRId
"\n",np);
939 for (k=1; k<=
mesh->
np; k++) {
943 fprintf(inm,
"%.15lg %.15lg %.15lg %" MMG5_PRId
"\n",ppt->
c[0],ppt->
c[1],ppt->
c[2],MMG5_abs(ppt->
ref));
945 fwrite((
unsigned char*)&ppt->
c[0],
MMG5_SD,1,inm);
946 fwrite((
unsigned char*)&ppt->
c[1],
MMG5_SD,1,inm);
947 fwrite((
unsigned char*)&ppt->
c[2],
MMG5_SD,1,inm);
948 ppt->
ref = MMG5_abs(ppt->
ref);
949 fwrite((
unsigned char*)&ppt->
ref,
MMG5_SW,1,inm);
956 for (k=1; k<=
mesh->
nt; k++) {
958 if ( !
MG_EOK(pt) )
continue;
965 strcpy(&chaine[0],
"\n\nCorners\n");
966 fprintf(inm,
"%s",chaine);
967 fprintf(inm,
"%" MMG5_PRId
"\n",nc);
975 for (k=1; k<=
mesh->
np; k++) {
979 fprintf(inm,
"%" MMG5_PRId
"\n",ppt->
tmp);
988 strcpy(&chaine[0],
"\n\nRequiredVertices\n");
989 fprintf(inm,
"%s",chaine);
990 fprintf(inm,
"%" MMG5_PRId
"\n",nre);
998 for (k=1; k<=
mesh->
np; k++) {
1002 fprintf(inm,
"%" MMG5_PRId
"\n",ppt->
tmp);
1013 strcpy(&chaine[0],
"\n\nEdges\n");
1014 fprintf(inm,
"%s",chaine);
1015 fprintf(inm,
"%" MMG5_PRId
"\n",
mesh->
na);
1024 for (k=1; k<=
mesh->
na; k++) {
1026 fprintf(inm,
"%" MMG5_PRId
" %" MMG5_PRId
" %" MMG5_PRId
"\n",
1039 strcpy(&chaine[0],
"\n\nRidges\n");
1040 fprintf(inm,
"%s",chaine);
1041 fprintf(inm,
"%" MMG5_PRId
"\n",nr);
1049 for (k=1; k<=
mesh->
na; k++) {
1052 fprintf(inm,
"%" MMG5_PRId
"\n",k);
1061 strcpy(&chaine[0],
"\n\nRequiredEdges\n");
1062 fprintf(inm,
"%s",chaine);
1063 fprintf(inm,
"%" MMG5_PRId
"\n",nre);
1071 for (k=1; k<=
mesh->
na; k++)
1074 fprintf(inm,
"%" MMG5_PRId
"\n",k);
1085 strcpy(&chaine[0],
"\n\nTriangles\n");
1086 fprintf(inm,
"%s",chaine);
1087 fprintf(inm,
"%" MMG5_PRId
"\n",nt);
1097 for (k=1; k<=
mesh->
nt; k++) {
1101 fprintf(inm,
"%" MMG5_PRId
" %" MMG5_PRId
" %" MMG5_PRId
" %" MMG5_PRId
"\n",
mesh->
point[pt->
v[0]].
tmp,
mesh->
point[pt->
v[1]].
tmp
1107 pt->
ref = MMG5_abs(pt->
ref);
1118 strcpy(&chaine[0],
"\n\nRequiredTriangles\n");
1119 fprintf(inm,
"%s",chaine);
1120 fprintf(inm,
"%" MMG5_PRId
"\n",ntreq);
1128 for (k=0; k<=
mesh->
nt; k++) {
1132 fprintf(inm,
"%" MMG5_PRId
"\n",k);
1146 strcpy(&chaine[0],
"\n\nNormals\n");
1147 fprintf(inm,
"%s",chaine);
1148 fprintf(inm,
"%" MMG5_PRId
"\n",nn);
1156 for (k=1; k<=
mesh->
np; k++) {
1158 if ( !
MG_VOK(ppt) )
continue;
1163 fprintf(inm,
"%.15lg %.15lg %.15lg \n",go->
n1[0],go->
n1[1],go->
n1[2]);
1165 fwrite((
unsigned char*)&go->
n1[0],
MMG5_SD,1,inm);
1166 fwrite((
unsigned char*)&go->
n1[1],
MMG5_SD,1,inm);
1167 fwrite((
unsigned char*)&go->
n1[2],
MMG5_SD,1,inm);
1172 fprintf(inm,
"%.15lg %.15lg %.15lg \n",ppt->
n[0],ppt->
n[1],ppt->
n[2]);
1174 fwrite((
unsigned char*)&ppt->
n[0],
MMG5_SD,1,inm);
1175 fwrite((
unsigned char*)&ppt->
n[1],
MMG5_SD,1,inm);
1176 fwrite((
unsigned char*)&ppt->
n[2],
MMG5_SD,1,inm);
1182 strcpy(&chaine[0],
"\n\nNormalAtVertices\n");
1183 fprintf(inm,
"%s",chaine);
1184 fprintf(inm,
"%" MMG5_PRId
"\n",nn);
1193 for (k=1; k<=
mesh->
np; k++) {
1197 fprintf(inm,
"%" MMG5_PRId
" %" MMG5_PRId
"\n",ppt->
tmp,++nn);
1231 strcpy(&chaine[0],
"\n\nTangents\n");
1232 fprintf(inm,
"%s",chaine);
1233 fprintf(inm,
"%" MMG5_PRId
"\n",ng);
1241 for (k=1; k<=
mesh->
np; k++) {
1245 fprintf(inm,
"%.15lg %.15lg %.15lg \n",ppt->
n[0],ppt->
n[1],ppt->
n[2]);
1247 fwrite((
unsigned char*)&ppt->
n[0],
MMG5_SD,1,inm);
1248 fwrite((
unsigned char*)&ppt->
n[1],
MMG5_SD,1,inm);
1249 fwrite((
unsigned char*)&ppt->
n[2],
MMG5_SD,1,inm);
1254 strcpy(&chaine[0],
"\n\nTangentAtVertices\n");
1255 fprintf(inm,
"%s",chaine);
1256 fprintf(inm,
"%" MMG5_PRId
"\n",ng);
1265 for (k=1; k<=
mesh->
np; k++) {
1269 fprintf(inm,
"%" MMG5_PRId
" %" MMG5_PRId
"\n",ppt->
tmp,++ng);
1280 fprintf(stdout,
" NUMBER OF VERTICES %8" MMG5_PRId
" CORNERS %6" MMG5_PRId
"\n",np,nc);
1281 fprintf(stdout,
" NUMBER OF TRIANGLES %8" MMG5_PRId
"\n",nt);
1284 fprintf(stdout,
" NUMBER OF EDGES %8" MMG5_PRId
" RIDGES %6" MMG5_PRId
"\n",
mesh->
na,nr);
1286 fprintf(stdout,
" NUMBER OF NORMALS %8" MMG5_PRId
" TANGENTS %6" MMG5_PRId
"\n",nn,ng);
1290 strcpy(&chaine[0],
"\n\nEnd\n");
1291 fprintf(inm,
"%s",chaine);
1316 int iswp,
ier,*type,ver,bin,nsols,dim;
1323 if (
ier < 1 )
return ier;
1326 fprintf(stderr,
"Error: SEVERAL SOLUTIONS FOUND (%d)\n",nsols);
1333 fprintf(stderr,
" ** MISMATCHES DATA: THE NUMBER OF VERTICES IN "
1334 "THE MESH (%" MMG5_PRId
") DIFFERS FROM THE NUMBER OF VERTICES IN "
1335 "THE SOLUTION (%" MMG5_PRId
") \n",
mesh->
np,np);
1357 if ( ver ) met->
ver = ver;
1363 fseek(inm,posnp,SEEK_SET);
1366 if ( met->
ver == 1 ) {
1368 for (k=1; k<=
mesh->
np; k++) {
1374 for (k=1; k<=
mesh->
np; k++) {
1391 int iswp,
ier,*type,ver,bin,nsols,dim;
1394 static char mmgWarn = 0;
1399 if (
ier < 1 )
return ier;
1402 fprintf(stderr,
" ** MISMATCHES DATA: THE NUMBER OF VERTICES IN "
1403 "THE MESH (%" MMG5_PRId
") DIFFERS FROM THE NUMBER OF VERTICES IN "
1404 "THE SOLUTION (%" MMG5_PRId
") \n",
mesh->
np,np);
1414 fprintf(stderr,
"\n ## Error: %s: unexpected number of data (%d).\n",
1423 printf(
" Exit program.\n"); fclose(inm);
1428 for ( j=0; j<nsols; ++j ) {
1433 sprintf(data,
"sol_%" MMG5_PRId
"",j);
1437 fprintf(stderr,
"\n ## Warning: %s: unable to set solution name for"
1438 " at least 1 solution.\n",__func__);
1449 if ( ver ) psl->
ver = ver;
1455 fseek(inm,posnp,SEEK_SET);
1457 if ( (*
sol)[0].ver == 1 ) {
1459 for (k=1; k<=
mesh->
np; k++) {
1460 for ( j=0; j<nsols; ++j ) {
1468 for (k=1; k<=
mesh->
np; k++) {
1469 for ( j=0; j<nsols; ++j ) {
1490 fprintf(stderr,
"\n ## Warning: %s: no metric data to save.\n",__func__);
1499 if (
ier < 1 )
return ier;
1501 for (k=1; k<=
mesh->
np; k++) {
1503 if ( !
MG_VOK(ppt) )
continue;
1511 fprintf(inm,
"\n\nEnd\n");
1524 int binch,bin,
ier,npointSols,ncellSols;
1525 int *type,*entities,j,*size;
1528 if ( !(*
sol)[0].m )
return -1;
1548 printf(
"\n ## Warning: %s: unexpected entity type for solution %" MMG5_PRId
": %s."
1553 type[k] = (*sol)[k].type;
1554 size[k] = (*sol)[k].size;
1555 entities[k] = (*sol)[k].entities;
1562 if (
ier < 1 )
return ier;
1564 for (k=1; k<=
mesh->
np; k++) {
1566 if ( !
MG_VOK(ppt) )
continue;
1579 ncellSols,entities,type,size );
1581 for (k=1; k<=
mesh->
nt; k++) {
1583 if ( !
MG_EOK(ptt) )
continue;
1600 fprintf(inm,
"\n\nEnd\n");
1611 const char *filenameptr,*solnameptr;
1628 fprintf(stderr,
" ## Error: %s: please provide input file name"
1629 " (either in the mesh structure or as function argument).\n",
1635 strcpy(
tmp,filenameptr);
1641 int8_t savesolFile = 0;
1662 if (
ier && savesolFile ) {
1666 strcpy(soltmp,solnameptr);
1669 fprintf(stderr,
"\n ## ERROR: WRONG DATA TYPE OR WRONG SOLUTION NUMBER.\n");
const char * MMG5_Get_formatName(enum MMG5_Format fmt)
const char * MMG5_Get_entitiesName(enum MMG5_entities ent)
int MMG5_Get_format(char *ptr, int fmt)
char * MMG5_Get_filenameExt(char *filename)
int MMGS_Set_inputSolName(MMG5_pMesh mesh, MMG5_pSol sol, const char *solin)
Set the name of the input solution file.
int MMGS_Set_solSize(MMG5_pMesh mesh, MMG5_pSol sol, int typEntity, MMG5_int np, int typSol)
Initialize an array of solution fields: set dimension, types and number of fields.
MMG5_pMesh MMG5_pSol * sol
MMG5_pMesh char * filename
int MMG5_readDoubleSol3D(MMG5_pSol sol, FILE *inm, int bin, int iswp, MMG5_int pos)
int MMG5_chkMetricType(MMG5_pMesh mesh, int *type, int *entities, FILE *inm)
void MMG5_printSolStats(MMG5_pMesh mesh, MMG5_pSol *sol)
float MMG5_swapf(float sbin)
int MMG5_saveSolAtTrianglesHeader(MMG5_pMesh mesh, FILE *inm, int ver, int bin, MMG5_int *bpos, int nsols, int nsolsAtTriangles, int *entities, int *type, int *size)
int MMG5_saveSolHeader(MMG5_pMesh mesh, const char *filename, FILE **inm, int ver, int *bin, MMG5_int *bpos, MMG5_int np, int dim, int nsols, int *entities, int *type, int *size)
int MMG5_loadMshMesh_part1(MMG5_pMesh mesh, const char *filename, FILE **inm, long *posNodes, long *posElts, long **posNodeData, int *bin, int *iswp, MMG5_int *nelts, int *nsols)
void MMG5_writeDoubleSol3D(MMG5_pMesh mesh, MMG5_pSol sol, FILE *inm, int bin, MMG5_int pos, int metricData)
int MMG5_readFloatSol3D(MMG5_pSol sol, FILE *inm, int bin, int iswp, int pos)
double MMG5_swapd(double sbin)
int MMG5_loadMshMesh_part2(MMG5_pMesh mesh, MMG5_pSol *sol, FILE **inm, const long posNodes, const long posElts, const long *posNodeData, const int bin, const int iswp, const MMG5_int nelts, const int nsols)
int MMG5_saveMshMesh(MMG5_pMesh mesh, MMG5_pSol *sol, const char *filename, int metricData)
void MMG5_printMetStats(MMG5_pMesh mesh, MMG5_pSol met)
int MMG5_loadSolHeader(const char *filename, int meshDim, FILE **inm, int *ver, int *bin, int *iswp, MMG5_int *np, int *dim, int *nsols, int **type, long *posnp, int imprim)
int MMG5_swapbin(int sbin)
int MMGS_loadSol(MMG5_pMesh mesh, MMG5_pSol met, const char *filename)
Load a metric field (or other solution) in medit's .sol format.
int MMGS_loadAllSols(MMG5_pMesh mesh, MMG5_pSol *sol, const char *filename)
Load one or more solutions in a solution file in medit file format.
int MMGS_loadMshMesh(MMG5_pMesh mesh, MMG5_pSol sol, const char *filename)
Load a mesh and possibly a solution in .msh format from file.
int MMGS_saveMesh(MMG5_pMesh mesh, const char *filename)
Save a mesh in .mesh or .meshb format.
int MMGS_saveMshMesh(MMG5_pMesh mesh, MMG5_pSol sol, const char *filename)
Write mesh and optionally one data field in MSH file format (.msh extension).
int MMGS_saveGenericMesh(MMG5_pMesh mesh, MMG5_pSol sol, const char *filename)
Save mesh data in a file whose format depends on the filename extension.
int MMGS_saveMshMesh_and_allData(MMG5_pMesh mesh, MMG5_pSol *sol, const char *filename)
Save a mesh and multiple data fields in MSH format, ascii or binary depending on the filename extensi...
int MMGS_loadMshMesh_and_allData(MMG5_pMesh mesh, MMG5_pSol *sol, const char *filename)
Load a mesh and all data from a file in MSH format.
int MMGS_saveSol(MMG5_pMesh mesh, MMG5_pSol met, const char *filename)
Write an isotropic or anisotropic metric in medit file format.
int MMGS_loadMesh(MMG5_pMesh mesh, const char *filename)
Load a mesh (in .mesh/.mesb format) from file.
int MMGS_saveAllSols(MMG5_pMesh mesh, MMG5_pSol *sol, const char *filename)
Save one or more solutions in a solution file in medit file format.
int MMGS_loadGenericMesh(MMG5_pMesh mesh, MMG5_pSol met, MMG5_pSol sol, const char *filename)
Load a mesh and all data from a file. The format will be guessed from the filename extension.
int MMGS_loadVtuMesh(MMG5_pMesh mesh, MMG5_pSol met, MMG5_pSol sol, const char *filename)
Load a mesh and possibly data in VTU (VTK) format from file.
int MMGS_saveVtuMesh(MMG5_pMesh mesh, MMG5_pSol sol, const char *filename)
Write mesh and optionally one data field vtu Vtk file format (.vtu extension).
int MMGS_loadVtpMesh(MMG5_pMesh mesh, MMG5_pSol met, MMG5_pSol sol, const char *filename)
Load a mesh and optionally a solution in VTP (VTK) format from file.
int MMGS_saveVtkMesh(MMG5_pMesh mesh, MMG5_pSol sol, const char *filename)
Write mesh and optionally one data field in Vtk file format (.vtk extension).
int MMGS_loadVtkMesh(MMG5_pMesh mesh, MMG5_pSol met, MMG5_pSol sol, const char *filename)
Load a mesh and possibly data in VTK format from file.
int MMGS_saveVtpMesh(MMG5_pMesh mesh, MMG5_pSol sol, const char *filename)
Save a mesh and optionally one data field in VTP format.
API headers and documentation for the mmgs library.
int MMGS_zaldy(MMG5_pMesh mesh)
#define MMG5_SAFE_CALLOC(ptr, size, type, law)
#define MMG5_ADD_MEM(mesh, size, message, law)
#define MMG_FREAD(ptr, size, count, stream)
#define MMG5_SAFE_MALLOC(ptr, size, type, law)
#define MMG5_FILESTR_LGTH
#define MMG5_SAFE_FREE(ptr)
#define MMG_FSCANF(stream, format,...)
#define MMG5_DEL_MEM(mesh, ptr)
Structure to store vertices of an MMG mesh.
Structure to store triangles of a MMG mesh.
Structure to store surface vertices of an MMG mesh.