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;
70 ptr = strstr(data,
".mesh");
73 strcat(data,
".meshb");
74 if( !(inm = fopen(data,
"rb")) ) {
76 ptr = strstr(data,
".mesh");
79 if( !(inm = fopen(data,
"rb")) ) {
87 ptr = strstr(data,
".meshb");
89 if( !(inm = fopen(data,
"rb")) ) {
96 fprintf(stdout,
" %%%% %s OPENED\n",data);
101 while(fscanf(inm,
"%127s",&chaine[0])!=EOF && strncmp(chaine,
"End",strlen(
"End")) ) {
102 if ( chaine[0] ==
'#' ) {
106 if(!strncmp(chaine,
"MeshVersionFormatted",strlen(
"MeshVersionFormatted"))) {
109 }
else if(!strncmp(chaine,
"Dimension",strlen(
"Dimension"))) {
112 fprintf(stderr,
"BAD DIMENSION : %d\n",
mesh->
dim);
116 }
else if(!strncmp(chaine,
"Vertices",strlen(
"Vertices"))) {
120 }
else if(!strncmp(chaine,
"RequiredVertices",strlen(
"RequiredVertices"))) {
122 posnpreq = ftell(inm);
124 }
else if(!strncmp(chaine,
"Triangles",strlen(
"Triangles"))) {
129 else if(!strncmp(chaine,
"RequiredTriangles",strlen(
"RequiredTriangles"))) {
131 posntreq = ftell(inm);
133 }
else if(!strncmp(chaine,
"Quadrilaterals",strlen(
"Quadrilaterals"))) {
137 }
else if(!strncmp(chaine,
"Corners",strlen(
"Corners"))) {
139 posncor = ftell(inm);
141 }
else if(!strncmp(chaine,
"Edges",strlen(
"Edges"))) {
145 }
else if(!strncmp(chaine,
"RequiredEdges",strlen(
"RequiredEdges"))) {
147 posnedreq = ftell(inm);
149 }
else if(!strncmp(chaine,
"Ridges",strlen(
"Ridges"))) {
153 }
else if(!ng && !strncmp(chaine,
"Normals",strlen(
"Normals"))) {
155 posnormal = ftell(inm);
157 }
else if(!strncmp(chaine,
"NormalAtVertices",strlen(
"NormalAtVertices"))) {
170 fprintf(stdout,
"BAD FILE ENCODING\n");
174 while(fread(&binch,
MMG5_SW,1,inm)!=0 && binch!=54 ) {
177 if(!bdim && binch==3) {
184 fprintf(stderr,
"BAD MESH DIMENSION : %d\n",
mesh->
dim);
188 }
else if(!
mesh->
npi && binch==4) {
195 fseek(inm,bpos,SEEK_SET);
197 }
else if(binch==15) {
201 if(iswp) npreq=MMG5_SWAPBIN(npreq);
202 posnpreq = ftell(inm);
204 fseek(inm,bpos,SEEK_SET);
206 }
else if(!
mesh->
nti && binch==6) {
213 fseek(inm,bpos,SEEK_SET);
215 }
else if(binch==17) {
219 if(iswp) ntreq=MMG5_SWAPBIN(ntreq);
220 posntreq = ftell(inm);
222 fseek(inm,bpos,SEEK_SET);
224 }
else if(binch==7) {
228 if(iswp) nq=MMG5_SWAPBIN(nq);
231 fseek(inm,bpos,SEEK_SET);
233 }
else if(!ncor && binch==13) {
237 if(iswp) ncor=MMG5_SWAPBIN(ncor);
238 posncor = ftell(inm);
240 fseek(inm,bpos,SEEK_SET);
242 }
else if(!
mesh->
na && binch==5) {
249 fseek(inm,bpos,SEEK_SET);
251 }
else if(binch==16) {
255 if(iswp) nedreq=MMG5_SWAPBIN(nedreq);
256 posnedreq = ftell(inm);
258 fseek(inm,bpos,SEEK_SET);
260 }
else if(binch==14) {
264 if(iswp) nri=MMG5_SWAPBIN(nri);
267 fseek(inm,bpos,SEEK_SET);
269 }
else if(!ng && binch==60) {
273 if(iswp) ng=MMG5_SWAPBIN(ng);
274 posnormal = ftell(inm);
276 fseek(inm,bpos,SEEK_SET);
278 }
else if(binch==20) {
285 fseek(inm,bpos,SEEK_SET);
291 fseek(inm,bpos,SEEK_SET);
297 fprintf(stdout,
" ** MISSING DATA\n");
309 fseek(inm,posnp,SEEK_SET);
310 for (k=1; k<=
mesh->
np; k++) {
314 for (i=0 ; i<3 ; i++) {
316 ppt->
c[i] = (double) fc;
320 for (i=0 ; i<3 ; i++) {
323 ppt->
c[i] = (double) fc;
326 if(iswp) ppt->
ref=MMG5_SWAPBIN(ppt->
ref);
330 MMG_FSCANF(inm,
"%lf %lf %lf %" MMG5_PRId
"",&ppt->
c[0],&ppt->
c[1],&ppt->
c[2],&ppt->
ref);
333 for (i=0 ; i<3 ; i++) {
338 if(iswp) ppt->
ref=MMG5_SWAPBIN(ppt->
ref);
341 if ( ppt->
ref < 0 ) {
351 fseek(inm,posnt,SEEK_SET);
355 MMG_FSCANF(inm,
"%" MMG5_PRId
" %" MMG5_PRId
" %" MMG5_PRId
" %" MMG5_PRId
"",&pt1->
v[0],&pt1->
v[1],&pt1->
v[2],&pt1->
ref);
358 for (i=0 ; i<3 ; i++) {
360 if(iswp) pt1->
v[i]=MMG5_SWAPBIN(pt1->
v[i]);
363 if(iswp) pt1->
ref=MMG5_SWAPBIN(pt1->
ref);
365 for (i=0; i<3; i++) {
373 fseek(inm,posntreq,SEEK_SET);
374 for (k=1; k<=ntreq; k++) {
383 fprintf(stderr,
"\n ## Warning: %s: required triangle number %8d"
384 " ignored.\n",__func__,i);
398 fseek(inm,posnq,SEEK_SET);
400 printf(
" ## Warning: %s: quadrangles automatically converted into"
401 " triangles\n.",__func__);
403 for (k=1; k<=nq; k++) {
410 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);
413 for (i=0 ; i<3 ; i++) {
415 if(iswp) pt1->
v[i]=MMG5_SWAPBIN(pt1->
v[i]);
418 if(iswp) pt2->
v[2]=MMG5_SWAPBIN(pt2->
v[2]);
420 if(iswp) pt1->
ref=MMG5_SWAPBIN(pt1->
ref);
422 if ( pt1->
ref < 0 ) {
427 pt2->
v[0] = pt1->
v[0];
428 pt2->
v[1] = pt1->
v[2];
430 for (i=0; i<3; i++) {
442 fseek(inm,posncor,SEEK_SET);
443 for (k=1; k<=ncor; k++) {
452 fprintf(stderr,
"\n ## Warning: %s: corner number %8d ignored.\n",
464 fseek(inm,posnpreq,SEEK_SET);
465 for (k=1; k<=npreq; k++) {
474 fprintf(stderr,
"\n ## Warning: %s: required Vertices number %8d ignored\n",
488 fseek(inm,posned,SEEK_SET);
490 for (k=1; k<=
mesh->
na; k++) {
514 fseek(inm,posnr,SEEK_SET);
515 for (k=1; k<=nri; k++) {
521 if(iswp) ia=MMG5_SWAPBIN(ia);
523 if ( (ia>na) || (ia<0) ) {
524 fprintf(stderr,
"\n ## Warning: %s: ridge number %8" MMG5_PRId
" ignored.\n",
535 fseek(inm,posnedreq,SEEK_SET);
536 for (k=1; k<=nedreq; k++) {
542 if(iswp) ia=MMG5_SWAPBIN(ia);
544 if ( (ia>na) || (ia<0) ) {
545 fprintf(stderr,
"\n ## Warning: %s: required edge number %8" MMG5_PRId
" ignored\n",
557 fprintf(stderr,
"\n ## Warning: %s: your mesh don't contains Normals but contains"
558 " NormalAtVertices. The NormalAtVertices are deleted. \n",__func__);
566 fseek(inm,posnormal,SEEK_SET);
567 for (k=1; k<=ng; k++) {
568 n = &norm[3*(k-1)+1];
571 for (i=0 ; i<3 ; i++) {
576 for (i=0 ; i<3 ; i++) {
585 MMG_FSCANF(inm,
"%lf %lf %lf",&n[0],&n[1],&n[2]);
588 for (i=0 ; i<3 ; i++) {
594 dd = n[0]*n[0] + n[1]*n[1] + n[2]*n[2];
604 fseek(inm,posnc1,SEEK_SET);
608 MMG_FSCANF(inm,
"%" MMG5_PRId
" %" MMG5_PRId
"",&ip,&idn);
612 if(iswp) ip=MMG5_SWAPBIN(ip);
614 if(iswp) idn=MMG5_SWAPBIN(idn);
616 if ( idn > 0 && ip < mesh->np+1 )
617 memcpy(&
mesh->
point[ip].
n,&norm[3*(idn-1)+1],3*
sizeof(
double));
623 fprintf(stdout,
"\n $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ \n");
624 fprintf(stdout,
" WARNING : %" MMG5_PRId
" entities with unexpected refs (ref< 0).\n",nref);
625 fprintf(stdout,
" We take their absolute values.\n");
626 fprintf(stdout,
" $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ \n\n");
630 fprintf(stdout,
" NUMBER OF VERTICES %8" MMG5_PRId
" / %8" MMG5_PRId
" CORNERS/REQ. %" MMG5_PRId
" / %" MMG5_PRId
"\n",
mesh->
npi,
mesh->
npmax,ncor,npreq);
631 fprintf(stdout,
" NUMBER OF TRIANGLES %8" MMG5_PRId
" / %8" MMG5_PRId
"\n",
mesh->
nti,
mesh->
ntmax);
634 fprintf(stdout,
" NUMBER OF EDGES %8" MMG5_PRId
" RIDGES %6" MMG5_PRId
"\n",
mesh->
na,nri);
642 long posNodes,posElts,*posNodeData;
643 int ier,bin,iswp,nsols;
649 &posNodes,&posElts,&posNodeData,
650 &bin,&iswp,&nelts,&nsols);
651 if (
ier < 1 )
return (
ier);
654 fprintf(stderr,
"Error: SEVERAL SOLUTIONS FOUND (%d)\n",nsols);
669 fprintf(stderr,
" ** MISSING DATA.\n");
670 fprintf(stderr,
" Check that your mesh contains triangles.\n");
671 fprintf(stderr,
" Exit program.\n");
685 posNodes,posElts,posNodeData,
686 bin,iswp,nelts,nsols);
689 fprintf(stderr,
" ** ERROR WHEN PARSING THE INPUT FILE\n");
703 long posNodes,posElts,*posNodeData;
704 int ier,bin,iswp,nsols;
710 &posNodes,&posElts,&posNodeData,
711 &bin,&iswp,&nelts,&nsols);
712 if (
ier < 1 )
return (
ier);
717 printf(
" Exit program.\n"); fclose(inm);
731 fprintf(stderr,
" ** MISSING DATA.\n");
732 fprintf(stderr,
" Check that your mesh contains triangles.\n");
733 fprintf(stderr,
" Exit program.\n");
747 posNodes,posElts,posNodeData,
748 bin,iswp,nelts,nsols);
751 fprintf(stderr,
" ** ERROR WHEN PARSING THE INPUT FILE\n");
761 const char *filenameptr,*solnameptr;
778 fprintf(stderr,
" ## Error: %s: please provide input file name"
779 " (either in the mesh structure or as function argument).\n",
785 strcpy(
tmp,filenameptr);
811 if (
ier < 1 ) {
break; }
816 strcpy(soltmp,solnameptr);
819 fprintf(stderr,
"\n ## ERROR: WRONG DATA TYPE OR WRONG SOLUTION NUMBER.\n");
842 MMG5_int k,np,nt,nc,ng,nn,nr,nre,ntreq,bpos;
854 ptr = strstr(data,
".mesh");
856 strcat(data,
".meshb");
857 if( !(inm = fopen(data,
"wb")) ) {
858 ptr = strstr(data,
".mesh");
860 strcat(data,
".mesh");
861 if( !(inm = fopen(data,
"w")) ) {
870 ptr = strstr(data,
".meshb");
873 if( !(inm = fopen(data,
"wb")) ) {
874 fprintf(stderr,
" ** UNABLE TO OPEN %s.\n",data);
879 if( !(inm = fopen(data,
"w")) ) {
880 fprintf(stderr,
" ** UNABLE TO OPEN %s.\n",data);
887 fprintf(stdout,
" %%%% %s OPENED\n",data);
892 strcpy(&chaine[0],
"MeshVersionFormatted 2\n");
893 fprintf(inm,
"%s",chaine);
894 strcpy(&chaine[0],
"\n\nDimension 3\n");
895 fprintf(inm,
"%s ",chaine);
910 np = nc = ng = nn = nre = 0;
911 for (k=1; k<=
mesh->
np; k++) {
924 strcpy(&chaine[0],
"\n\nVertices\n");
925 fprintf(inm,
"%s",chaine);
926 fprintf(inm,
"%" MMG5_PRId
"\n",np);
934 for (k=1; k<=
mesh->
np; k++) {
938 fprintf(inm,
"%.15lg %.15lg %.15lg %" MMG5_PRId
"\n",ppt->
c[0],ppt->
c[1],ppt->
c[2],MMG5_abs(ppt->
ref));
940 fwrite((
unsigned char*)&ppt->
c[0],
MMG5_SD,1,inm);
941 fwrite((
unsigned char*)&ppt->
c[1],
MMG5_SD,1,inm);
942 fwrite((
unsigned char*)&ppt->
c[2],
MMG5_SD,1,inm);
943 ppt->
ref = MMG5_abs(ppt->
ref);
944 fwrite((
unsigned char*)&ppt->
ref,
MMG5_SW,1,inm);
951 for (k=1; k<=
mesh->
nt; k++) {
953 if ( !
MG_EOK(pt) )
continue;
960 strcpy(&chaine[0],
"\n\nCorners\n");
961 fprintf(inm,
"%s",chaine);
962 fprintf(inm,
"%" MMG5_PRId
"\n",nc);
970 for (k=1; k<=
mesh->
np; k++) {
974 fprintf(inm,
"%" MMG5_PRId
"\n",ppt->
tmp);
983 strcpy(&chaine[0],
"\n\nRequiredVertices\n");
984 fprintf(inm,
"%s",chaine);
985 fprintf(inm,
"%" MMG5_PRId
"\n",nre);
993 for (k=1; k<=
mesh->
np; k++) {
997 fprintf(inm,
"%" MMG5_PRId
"\n",ppt->
tmp);
1008 strcpy(&chaine[0],
"\n\nEdges\n");
1009 fprintf(inm,
"%s",chaine);
1010 fprintf(inm,
"%" MMG5_PRId
"\n",
mesh->
na);
1019 for (k=1; k<=
mesh->
na; k++) {
1021 fprintf(inm,
"%" MMG5_PRId
" %" MMG5_PRId
" %" MMG5_PRId
"\n",
1034 strcpy(&chaine[0],
"\n\nRidges\n");
1035 fprintf(inm,
"%s",chaine);
1036 fprintf(inm,
"%" MMG5_PRId
"\n",nr);
1044 for (k=1; k<=
mesh->
na; k++) {
1047 fprintf(inm,
"%" MMG5_PRId
"\n",k);
1056 strcpy(&chaine[0],
"\n\nRequiredEdges\n");
1057 fprintf(inm,
"%s",chaine);
1058 fprintf(inm,
"%" MMG5_PRId
"\n",nre);
1066 for (k=1; k<=
mesh->
na; k++)
1069 fprintf(inm,
"%" MMG5_PRId
"\n",k);
1080 strcpy(&chaine[0],
"\n\nTriangles\n");
1081 fprintf(inm,
"%s",chaine);
1082 fprintf(inm,
"%" MMG5_PRId
"\n",nt);
1092 for (k=1; k<=
mesh->
nt; k++) {
1096 fprintf(inm,
"%" MMG5_PRId
" %" MMG5_PRId
" %" MMG5_PRId
" %" MMG5_PRId
"\n",
mesh->
point[pt->
v[0]].
tmp,
mesh->
point[pt->
v[1]].
tmp
1102 pt->
ref = MMG5_abs(pt->
ref);
1113 strcpy(&chaine[0],
"\n\nRequiredTriangles\n");
1114 fprintf(inm,
"%s",chaine);
1115 fprintf(inm,
"%" MMG5_PRId
"\n",ntreq);
1123 for (k=0; k<=
mesh->
nt; k++) {
1127 fprintf(inm,
"%" MMG5_PRId
"\n",k);
1141 strcpy(&chaine[0],
"\n\nNormals\n");
1142 fprintf(inm,
"%s",chaine);
1143 fprintf(inm,
"%" MMG5_PRId
"\n",nn);
1151 for (k=1; k<=
mesh->
np; k++) {
1153 if ( !
MG_VOK(ppt) )
continue;
1158 fprintf(inm,
"%.15lg %.15lg %.15lg \n",go->
n1[0],go->
n1[1],go->
n1[2]);
1160 fwrite((
unsigned char*)&go->
n1[0],
MMG5_SD,1,inm);
1161 fwrite((
unsigned char*)&go->
n1[1],
MMG5_SD,1,inm);
1162 fwrite((
unsigned char*)&go->
n1[2],
MMG5_SD,1,inm);
1167 fprintf(inm,
"%.15lg %.15lg %.15lg \n",ppt->
n[0],ppt->
n[1],ppt->
n[2]);
1169 fwrite((
unsigned char*)&ppt->
n[0],
MMG5_SD,1,inm);
1170 fwrite((
unsigned char*)&ppt->
n[1],
MMG5_SD,1,inm);
1171 fwrite((
unsigned char*)&ppt->
n[2],
MMG5_SD,1,inm);
1177 strcpy(&chaine[0],
"\n\nNormalAtVertices\n");
1178 fprintf(inm,
"%s",chaine);
1179 fprintf(inm,
"%" MMG5_PRId
"\n",nn);
1188 for (k=1; k<=
mesh->
np; k++) {
1192 fprintf(inm,
"%" MMG5_PRId
" %" MMG5_PRId
"\n",ppt->
tmp,++nn);
1226 strcpy(&chaine[0],
"\n\nTangents\n");
1227 fprintf(inm,
"%s",chaine);
1228 fprintf(inm,
"%" MMG5_PRId
"\n",ng);
1236 for (k=1; k<=
mesh->
np; k++) {
1240 fprintf(inm,
"%.15lg %.15lg %.15lg \n",ppt->
n[0],ppt->
n[1],ppt->
n[2]);
1242 fwrite((
unsigned char*)&ppt->
n[0],
MMG5_SD,1,inm);
1243 fwrite((
unsigned char*)&ppt->
n[1],
MMG5_SD,1,inm);
1244 fwrite((
unsigned char*)&ppt->
n[2],
MMG5_SD,1,inm);
1249 strcpy(&chaine[0],
"\n\nTangentAtVertices\n");
1250 fprintf(inm,
"%s",chaine);
1251 fprintf(inm,
"%" MMG5_PRId
"\n",ng);
1260 for (k=1; k<=
mesh->
np; k++) {
1264 fprintf(inm,
"%" MMG5_PRId
" %" MMG5_PRId
"\n",ppt->
tmp,++ng);
1275 fprintf(stdout,
" NUMBER OF VERTICES %8" MMG5_PRId
" CORNERS %6" MMG5_PRId
"\n",np,nc);
1276 fprintf(stdout,
" NUMBER OF TRIANGLES %8" MMG5_PRId
"\n",nt);
1279 fprintf(stdout,
" NUMBER OF EDGES %8" MMG5_PRId
" RIDGES %6" MMG5_PRId
"\n",
mesh->
na,nr);
1281 fprintf(stdout,
" NUMBER OF NORMALS %8" MMG5_PRId
" TANGENTS %6" MMG5_PRId
"\n",nn,ng);
1285 strcpy(&chaine[0],
"\n\nEnd\n");
1286 fprintf(inm,
"%s",chaine);
1311 int iswp,
ier,*type,ver,bin,nsols,dim;
1318 if (
ier < 1 )
return ier;
1321 fprintf(stderr,
"Error: SEVERAL SOLUTIONS FOUND (%d)\n",nsols);
1328 fprintf(stderr,
" ** MISMATCHES DATA: THE NUMBER OF VERTICES IN "
1329 "THE MESH (%" MMG5_PRId
") DIFFERS FROM THE NUMBER OF VERTICES IN "
1330 "THE SOLUTION (%" MMG5_PRId
") \n",
mesh->
np,np);
1352 if ( ver ) met->
ver = ver;
1358 fseek(inm,posnp,SEEK_SET);
1361 if ( met->
ver == 1 ) {
1363 for (k=1; k<=
mesh->
np; k++) {
1369 for (k=1; k<=
mesh->
np; k++) {
1386 int iswp,
ier,*type,ver,bin,nsols,dim;
1389 static char mmgWarn = 0;
1394 if (
ier < 1 )
return ier;
1397 fprintf(stderr,
" ** MISMATCHES DATA: THE NUMBER OF VERTICES IN "
1398 "THE MESH (%" MMG5_PRId
") DIFFERS FROM THE NUMBER OF VERTICES IN "
1399 "THE SOLUTION (%" MMG5_PRId
") \n",
mesh->
np,np);
1409 fprintf(stderr,
"\n ## Error: %s: unexpected number of data (%d).\n",
1418 printf(
" Exit program.\n"); fclose(inm);
1423 for ( j=0; j<nsols; ++j ) {
1428 sprintf(data,
"sol_%" MMG5_PRId
"",j);
1432 fprintf(stderr,
"\n ## Warning: %s: unable to set solution name for"
1433 " at least 1 solution.\n",__func__);
1444 if ( ver ) psl->
ver = ver;
1450 fseek(inm,posnp,SEEK_SET);
1452 if ( (*
sol)[0].ver == 1 ) {
1454 for (k=1; k<=
mesh->
np; k++) {
1455 for ( j=0; j<nsols; ++j ) {
1463 for (k=1; k<=
mesh->
np; k++) {
1464 for ( j=0; j<nsols; ++j ) {
1485 fprintf(stderr,
"\n ## Warning: %s: no metric data to save.\n",__func__);
1494 if (
ier < 1 )
return ier;
1496 for (k=1; k<=
mesh->
np; k++) {
1498 if ( !
MG_VOK(ppt) )
continue;
1506 fprintf(inm,
"\n\nEnd\n");
1519 int binch,bin,
ier,npointSols,ncellSols;
1520 int *type,*entities,j,*size;
1523 if ( !(*
sol)[0].m )
return -1;
1543 printf(
"\n ## Warning: %s: unexpected entity type for solution %" MMG5_PRId
": %s."
1548 type[k] = (*sol)[k].type;
1549 size[k] = (*sol)[k].size;
1550 entities[k] = (*sol)[k].entities;
1557 if (
ier < 1 )
return ier;
1559 for (k=1; k<=
mesh->
np; k++) {
1561 if ( !
MG_VOK(ppt) )
continue;
1574 ncellSols,entities,type,size );
1576 for (k=1; k<=
mesh->
nt; k++) {
1578 if ( !
MG_EOK(ptt) )
continue;
1595 fprintf(inm,
"\n\nEnd\n");
1606 const char *filenameptr,*solnameptr;
1623 fprintf(stderr,
" ## Error: %s: please provide input file name"
1624 " (either in the mesh structure or as function argument).\n",
1630 strcpy(
tmp,filenameptr);
1636 int8_t savesolFile = 0;
1657 if (
ier && savesolFile ) {
1661 strcpy(soltmp,solnameptr);
1664 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)
int MMGS_Set_solSize(MMG5_pMesh mesh, MMG5_pSol sol, int typEntity, MMG5_int np, int typSol)
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_loadGenericMesh(MMG5_pMesh mesh, MMG5_pSol sol, const char *filename)
int MMGS_loadSol(MMG5_pMesh mesh, MMG5_pSol met, const char *filename)
int MMGS_loadAllSols(MMG5_pMesh mesh, MMG5_pSol *sol, const char *filename)
int MMGS_loadMshMesh(MMG5_pMesh mesh, MMG5_pSol sol, const char *filename)
int MMGS_saveMesh(MMG5_pMesh mesh, const char *filename)
int MMGS_saveMshMesh(MMG5_pMesh mesh, MMG5_pSol sol, const char *filename)
int MMGS_saveGenericMesh(MMG5_pMesh mesh, MMG5_pSol sol, const char *filename)
int MMGS_saveMshMesh_and_allData(MMG5_pMesh mesh, MMG5_pSol *sol, const char *filename)
int MMGS_loadMshMesh_and_allData(MMG5_pMesh mesh, MMG5_pSol *sol, const char *filename)
int MMGS_saveSol(MMG5_pMesh mesh, MMG5_pSol met, const char *filename)
int MMGS_loadMesh(MMG5_pMesh mesh, const char *filename)
int MMGS_saveAllSols(MMG5_pMesh mesh, MMG5_pSol *sol, const char *filename)
int MMGS_loadVtpMesh(MMG5_pMesh mesh, MMG5_pSol sol, const char *filename)
int MMGS_loadVtuMesh(MMG5_pMesh mesh, MMG5_pSol sol, const char *filename)
int MMGS_saveVtuMesh(MMG5_pMesh mesh, MMG5_pSol sol, const char *filename)
int MMGS_loadVtkMesh(MMG5_pMesh mesh, MMG5_pSol sol, const char *filename)
int MMGS_saveVtkMesh(MMG5_pMesh mesh, MMG5_pSol sol, const char *filename)
int MMGS_saveVtpMesh(MMG5_pMesh mesh, MMG5_pSol sol, const char *filename)
API headers 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 points of a MMG mesh.
Structure to store surface points of a MMG mesh.