📄 tetgen.h
字号:
// be -1 if it is a ray, in this case, the unit normal of this ray is // given in 'vnormal'. typedef struct { int v1, v2; REAL vnormal[3]; } voroedge; // A 'vorofacet' is an facet of the Voronoi diagram. It corresponds to a // Delaunay edge. Each Voronoi facet is a convex polygon formed by a // list of Voronoi edges, it may not be closed. 'c1' and 'c2' are two // indices pointing into the list of Voronoi cells, i.e., the two cells // share this facet. 'elist' is an array of indices pointing into the // list of Voronoi edges, 'elist[0]' saves the number of Voronoi edges // (including rays) of this facet. typedef struct { int c1, c2; int *elist; } vorofacet; // The periodic boundary condition group data structure. A "pbcgroup" // contains the definition of a pbc and the list of pbc point pairs. // 'fmark1' and 'fmark2' are the facetmarkers of the two pbc facets f1 // and f2, respectively. 'transmat' is the transformation matrix which // maps a point in f1 into f2. An array of pbc point pairs are saved // in 'pointpairlist'. The first point pair is at indices [0] and [1], // followed by remaining pairs. Two integers per pair. typedef struct { int fmark1, fmark2; REAL transmat[4][4]; int numberofpointpairs; int *pointpairlist; } pbcgroup; public: // Items are numbered starting from 'firstnumber' (0 or 1), default is 0. int firstnumber; // Dimension of the mesh (2 or 3), default is 3. int mesh_dim; // Does the lines in .node file contain index or not, default is TRUE. bool useindex; // 'pointlist': An array of point coordinates. The first point's x // coordinate is at index [0] and its y coordinate at index [1], its // z coordinate is at index [2], followed by the coordinates of the // remaining points. Each point occupies three REALs. // 'pointattributelist': An array of point attributes. Each point's // attributes occupy 'numberofpointattributes' REALs. // 'pointmtrlist': An array of metric tensors at points. Each point's // tensor occupies 'numberofpointmtr' REALs. // `pointmarkerlist': An array of point markers; one int per point. REAL *pointlist; REAL *pointattributelist; REAL *pointmtrlist; int *pointmarkerlist; int numberofpoints; int numberofpointattributes; int numberofpointmtrs; // `elementlist': An array of element (triangle or tetrahedron) corners. // The first element's first corner is at index [0], followed by its // other corners in counterclockwise order, followed by any other // nodes if the element represents a nonlinear element. Each element // occupies `numberofcorners' ints. // `elementattributelist': An array of element attributes. Each // element's attributes occupy `numberofelementattributes' REALs. // `elementconstraintlist': An array of constraints, i.e. triangle's // area or tetrahedron's volume; one REAL per element. Input only. // `neighborlist': An array of element neighbors; 3 or 4 ints per // element. Output only. int *tetrahedronlist; REAL *tetrahedronattributelist; REAL *tetrahedronvolumelist; int *neighborlist; int numberoftetrahedra; int numberofcorners; int numberoftetrahedronattributes; // `facetlist': An array of facets. Each entry is a structure of facet. // `facetmarkerlist': An array of facet markers; one int per facet. facet *facetlist; int *facetmarkerlist; int numberoffacets; // `holelist': An array of holes. The first hole's x, y and z // coordinates are at indices [0], [1] and [2], followed by the // remaining holes. Three REALs per hole. REAL *holelist; int numberofholes; // `regionlist': An array of regional attributes and volume constraints. // The first constraint's x, y and z coordinates are at indices [0], // [1] and [2], followed by the regional attribute at index [3], foll- // owed by the maximum volume at index [4]. Five REALs per constraint. // Note that each regional attribute is used only if you select the `A' // switch, and each volume constraint is used only if you select the // `a' switch (with no number following). REAL *regionlist; int numberofregions; // `facetconstraintlist': An array of facet maximal area constraints. // Two REALs per constraint. The first one is the facet marker (cast // it to int), the second is its maximum area bound. // Note the 'facetconstraintlist' is used only for the 'q' switch. REAL *facetconstraintlist; int numberoffacetconstraints; // `segmentconstraintlist': An array of segment max. length constraints. // Three REALs per constraint. The first two are the indices (pointing // into 'pointlist') of the endpoints of the segment, the third is its // maximum length bound. // Note the 'segmentconstraintlist' is used only for the 'q' switch. REAL *segmentconstraintlist; int numberofsegmentconstraints; // 'pbcgrouplist': An array of periodic boundary condition groups. pbcgroup *pbcgrouplist; int numberofpbcgroups; // `trifacelist': An array of triangular face endpoints. The first // face's endpoints are at indices [0], [1] and [2], followed by the // remaining faces. Three ints per face. // `adjtetlist': An array of adjacent tetrahedra to the faces of // trifacelist. Each face has at most two adjacent tets, the first // face's adjacent tets are at [0], [1]. Two ints per face. A '-1' // indicates outside (no adj. tet). This list is output when '-nn' // switch is used. // `trifacemarkerlist': An array of face markers; one int per face. int *trifacelist; int *adjtetlist; int *trifacemarkerlist; int numberoftrifaces; // `edgelist': An array of edge endpoints. The first edge's endpoints // are at indices [0] and [1], followed by the remaining edges. Two // ints per edge. // `edgemarkerlist': An array of edge markers; one int per edge. int *edgelist; int *edgemarkerlist; int numberofedges; // 'vpointlist': An array of Voronoi vertex coordinates (like pointlist). // 'vedgelist': An array of Voronoi edges. Each entry is a 'voroedge'. // 'vfacetlist': An array of Voronoi facets. Each entry is a 'vorofacet'. // 'vcelllist': An array of Voronoi cells. Each entry is an array of // indices pointing into 'vfacetlist'. The 0th entry is used to store // the length of this array. REAL *vpointlist; voroedge *vedgelist; vorofacet *vfacetlist; int **vcelllist; int numberofvpoints; int numberofvedges; int numberofvfacets; int numberofvcells; public: // Initialize routine. void initialize(); void deinitialize(); // Input & output routines. bool load_node_call(FILE* infile, int markers, char* nodefilename); bool load_node(char* filename); bool load_pbc(char* filename); bool load_var(char* filename); bool load_mtr(char* filename); bool load_poly(char* filename); bool load_off(char* filename); bool load_ply(char* filename); bool load_stl(char* filename); bool load_medit(char* filename); bool load_plc(char* filename, int object); bool load_tetmesh(char* filename); bool load_voronoi(char* filename); void save_nodes(char* filename); void save_elements(char* filename); void save_faces(char* filename); void save_edges(char* filename); void save_neighbors(char* filename); void save_poly(char* filename); // Read line and parse string functions. char *readline(char* string, FILE* infile, int *linenumber); char *findnextfield(char* string); char *readnumberline(char* string, FILE* infile, char* infilename); char *findnextnumber(char* string); // Constructor and destructor. tetgenio() {initialize();} ~tetgenio() {deinitialize();}};///////////////////////////////////////////////////////////////////////////////// //// tetgenbehavior Parsing command line switches and file names. //// //// It includes a list of variables corresponding to the commandline switches //// for control the behavior of TetGen. These varibales are all initialized //// to their default values. //// //// parse_commandline() provides an simple interface to set the vaules of the //// variables. It accepts the standard parameters (e.g., 'argc' and 'argv') //// that pass to C/C++ main() function. Alternatively a string which contains //// the command line options can be used as its parameter. //// //// You don't need to understand this data type. It can be implicitly called //// by the global function "tetrahedralize()" defined below. The necessary //// thing you need to know is the meaning of command line switches of TetGen. //// They are described in the third section of the user's manual. //// /////////////////////////////////////////////////////////////////////////////////class tetgenbehavior { public: // Labels define the objects which are acceptable by TetGen. They are // recognized by the file extensions. // - NODES, a list of nodes (.node); // - POLY, a piecewise linear complex (.poly or .smesh); // - OFF, a polyhedron (.off, Geomview's file format); // - PLY, a polyhedron (.ply, file format from gatech); // - STL, a surface mesh (.stl, stereolithography format); // - MEDIT, a surface mesh (.mesh, Medit's file format); // - MESH, a tetrahedral mesh (.ele). // If no extension is available, the imposed commandline switch // (-p or -r) implies the object.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -