1 2 3 /*----------------------------------------------------------*/ 4 /* */ 5 /* LIBMESH V 7.12 */ 6 /* */ 7 /*----------------------------------------------------------*/ 8 /* */ 9 /* Description: handle .meshb file format I/O */ 10 /* Author: Loic MARECHAL */ 11 /* Creation date: dec 08 2015 */ 12 /* Last modification: may 20 2015 */ 13 /* */ 14 /*----------------------------------------------------------*/ 15 16 /* [Bruno] get int64_t and PRINTF_INT64_MODIFIER */ 17 #include <geogram/third_party/pstdint.h> 18 19 /*----------------------------------------------------------*/ 20 /* Defines */ 21 /*----------------------------------------------------------*/ 22 23 #define GmfStrSiz 1024 24 #define GmfMaxTyp 1000 25 #define GmfMaxKwd GmfLastKeyword - 1 26 #define GmfMshVer 1 27 #define GmfRead 1 28 #define GmfWrite 2 29 #define GmfSca 1 30 #define GmfVec 2 31 #define GmfSymMat 3 32 #define GmfMat 4 33 #define GmfFloat 1 34 #define GmfDouble 2 35 #define GmfInt 3 36 #define GmfLong 4 37 #define GmfDoubleTable 5 38 #define GmfFloatTable 6 39 40 enum GmfKwdCod 41 { 42 GmfReserved1, \ 43 GmfVersionFormatted, \ 44 GmfReserved2, \ 45 GmfDimension, \ 46 GmfVertices, \ 47 GmfEdges, \ 48 GmfTriangles, \ 49 GmfQuadrilaterals, \ 50 GmfTetrahedra, \ 51 GmfPrisms, \ 52 GmfHexahedra, \ 53 GmfIterationsAll, \ 54 GmfTimesAll, \ 55 GmfCorners, \ 56 GmfRidges, \ 57 GmfRequiredVertices, \ 58 GmfRequiredEdges, \ 59 GmfRequiredTriangles, \ 60 GmfRequiredQuadrilaterals, \ 61 GmfTangentAtEdgeVertices, \ 62 GmfNormalAtVertices, \ 63 GmfNormalAtTriangleVertices, \ 64 GmfNormalAtQuadrilateralVertices, \ 65 GmfAngleOfCornerBound, \ 66 GmfTrianglesP2, \ 67 GmfEdgesP2, \ 68 GmfSolAtPyramids, \ 69 GmfQuadrilateralsQ2, \ 70 GmfISolAtPyramids, \ 71 GmfSubDomainFromGeom, \ 72 GmfTetrahedraP2, \ 73 GmfFault_NearTri, \ 74 GmfFault_Inter, \ 75 GmfHexahedraQ2, \ 76 GmfExtraVerticesAtEdges, \ 77 GmfExtraVerticesAtTriangles, \ 78 GmfExtraVerticesAtQuadrilaterals, \ 79 GmfExtraVerticesAtTetrahedra, \ 80 GmfExtraVerticesAtPrisms, \ 81 GmfExtraVerticesAtHexahedra, \ 82 GmfVerticesOnGeometricVertices, \ 83 GmfVerticesOnGeometricEdges, \ 84 GmfVerticesOnGeometricTriangles, \ 85 GmfVerticesOnGeometricQuadrilaterals, \ 86 GmfEdgesOnGeometricEdges, \ 87 GmfFault_FreeEdge, \ 88 GmfPolyhedra, \ 89 GmfPolygons, \ 90 GmfFault_Overlap, \ 91 GmfPyramids, \ 92 GmfBoundingBox, \ 93 GmfBody, \ 94 GmfPrivateTable, \ 95 GmfFault_BadShape, \ 96 GmfEnd, \ 97 GmfTrianglesOnGeometricTriangles, \ 98 GmfTrianglesOnGeometricQuadrilaterals, \ 99 GmfQuadrilateralsOnGeometricTriangles, \ 100 GmfQuadrilateralsOnGeometricQuadrilaterals, \ 101 GmfTangents, \ 102 GmfNormals, \ 103 GmfTangentAtVertices, \ 104 GmfSolAtVertices, \ 105 GmfSolAtEdges, \ 106 GmfSolAtTriangles, \ 107 GmfSolAtQuadrilaterals, \ 108 GmfSolAtTetrahedra, \ 109 GmfSolAtPrisms, \ 110 GmfSolAtHexahedra, \ 111 GmfDSolAtVertices, \ 112 GmfISolAtVertices, \ 113 GmfISolAtEdges, \ 114 GmfISolAtTriangles, \ 115 GmfISolAtQuadrilaterals, \ 116 GmfISolAtTetrahedra, \ 117 GmfISolAtPrisms, \ 118 GmfISolAtHexahedra, \ 119 GmfIterations, \ 120 GmfTime, \ 121 GmfFault_SmallTri, \ 122 GmfCoarseHexahedra, \ 123 GmfComments, \ 124 GmfPeriodicVertices, \ 125 GmfPeriodicEdges, \ 126 GmfPeriodicTriangles, \ 127 GmfPeriodicQuadrilaterals, \ 128 GmfPrismsP2, \ 129 GmfPyramidsP2, \ 130 GmfQuadrilateralsQ3, \ 131 GmfQuadrilateralsQ4, \ 132 GmfTrianglesP3, \ 133 GmfTrianglesP4, \ 134 GmfEdgesP3, \ 135 GmfEdgesP4, \ 136 GmfIRefGroups, \ 137 GmfDRefGroups, \ 138 GmfLastKeyword 139 }; 140 141 142 /*----------------------------------------------------------*/ 143 /* Public procedures */ 144 /*----------------------------------------------------------*/ 145 146 extern int64_t GmfOpenMesh(char *, int, ...); 147 extern int GmfCloseMesh(int64_t); 148 extern int64_t GmfStatKwd(int64_t, int, ...); 149 extern int GmfSetKwd(int64_t, int, ...); 150 extern int GmfGotoKwd(int64_t, int); 151 extern int GmfGetLin(int64_t, int, ...); 152 extern int GmfSetLin(int64_t, int, ...); 153 extern int GmfGetBlock(int64_t, int, void *, ...); 154 extern int GmfSetBlock(int64_t, int, void *, ...); 155 156 157 /*----------------------------------------------------------*/ 158 /* Transmesh private API */ 159 /*----------------------------------------------------------*/ 160 161 #ifdef TRANSMESH 162 163 extern int GmfMaxRefTab[ GmfMaxKwd + 1 ]; 164 extern const char *GmfKwdFmt[ GmfMaxKwd + 1 ][4]; 165 extern int GmfCpyLin(int64_t, int64_t, int); 166 167 #endif 168