The functions associated with a TetMesh object are the following.
*vis_TetMeshBegin - create an instance of a TetMesh object vis_TetMeshEnd - destroy an instance of a TetMesh object vis_TetMeshError - return TetMesh object error flag
vis_TetMeshAbort - set abort flag vis_TetMeshDef - define number of nodes, tris. Inq - inquire number of nodes, tris. vis_TetMeshConnect - set the contents of Connect object vis_TetMeshComputeVolume - compute volume vis_TetMeshGenerate - generate finite element mesh vis_TetMeshGetConnect - get internal Connect object vis_TetMeshGetInteger - get integer mesh generation information vis_TetMeshSetEdge - set interior edge vis_TetMeshSetEdgeAssoc - set interior edge associations vis_TetMeshSetEdgeStat - set interior edge status vis_TetMeshSetFunction - set a call back function vis_TetMeshSetParami - set mesh generation parameters GetParami - get mesh generation parameters vis_TetMeshSetParamd - set mesh generation parameters GetParamd - get mesh generation parameters vis_TetMeshRefine - refine a tetrahedral mesh vis_TetMeshSetElem - set an orphan mesh for refinement vis_TetMeshSetGeomSizing - specify sizing within geometric shape vis_TetMeshSetNode - define a node vis_TetMeshSetNodeAssoc - define a node association vis_TetMeshSetNodeSizing - set node sizing vis_TetMeshSetNodeStat - set node status vis_TetMeshSetTri - define a triangle vis_TetMeshSetTriAssoc - define a triangle association vis_TetMeshSetTriSizing - set sizing within a region vis_TetMeshSetTriDepthSizing - set sizing within a depth in a region vis_TetMeshSetTriStat - set triangle status vis_TetMeshWrite - write mesh description to file vis_TetMeshRead - read mesh description from file
As a convenience, the function vis_TetMeshConnect will take the contents of a Connect object and set it as the geometric input to TetMesh. The typical case is using the Connect object which contains the mesh generated by a previous call to vis_SurfMeshGenerate or vis_SurfMeshRefine. The function assumes certain "best practices" conventions have been used with respect to the node and element associations which have been set to identify the underlying geometry entities.
The function vis_TetMeshSetParami is used to set integer parameters which affect the mesh generation process. It is possible to specify parabolic or cubic tetrahedra to be produced if the input triangles are linear. In this case nodes are added to the edges lying on the input surface triangulation to create the higher order tetrahedra throughout. By default the output tetrahedra are the same order as the input triangles. If parabolic or cubic triangles are input, then only parabolic or cubic tetrahedra respectively are generated. Also the sense of the normals of the input triangles may be changed so that normals are expected to point into the volume. The function vis_TetMeshSetParamd is used to set real double precision parameters which control the quality and size of the generated tetrahedra. A global target edge length for interior elements may be prescribed. Specific, location dependent, sizes may be set at input nodes using vis_TetMeshSetNodeSizing and for regions using vis_TetMeshSetTriSizing.
By default, all input nodes must be connected to input boundary triangles and interior edges and faces. If unconnected nodes are to be inserted in the interior then the user must call vis_TetMeshSetParami to enable parameter type TETMESH_UNCONNECT.
The user is able to define integer associations at nodes and triangles which will be assigned to the node and elements generated on the respective entity. These associations are useful for identifying nodes and elements in the output mesh for the application of loads, boundary conditions, material properties, etc. The function vis_TetMeshSetNodeAssoc is used to set associations at nodes generated at input points. The function vis_TetMeshSetNodeAssoc may be called any number of times for a single node with the same association type. The association values are accumulated as multiple association on the node. The function vis_TetMeshSetTriAssoc is used to set associations which will be attached to nodes generated along triangle edges or on triangle faces. These associations will also be generated as element entity associations along the respective tetrahedron edges and faces connected to the input triangles. The element associations are useful for tagging tetrahedra generated with an enclosed boundary, etc.
Finally the function vis_TetMeshGenerate generates the nodes and elements and enters them into a Connect object. The mesh generation process may fail due to errors in the surface triangles or failure of the tetrahedralization procedure. Use vis_TetMeshGetInteger to query for detailed information concerning errors in the surface triangles, etc.
During the mesh generation process, the input surface triangulation and triangle corner node locations (by default) remain unchanged. However, the midside node locations may be perturbed under certain circumstances to satisfy quality constraints in the output tetrahedra. The function vis_TetMeshSetParami is used to set the parameter VIS_MESH_MIDSIDEQUAL which controls the overall movement of midside nodes. By default all midside nodes are susceptible to movement.
The function vis_TetMeshWrite is provided to write a complete description of the defined input surface mesh and meshing parameters to a file. The primary use of this file is to encapsulate cases in which the TetMesh module should fail in some respect. This output file can then be made available to Visual Kinematics for failure diagnosis of TetMesh meshing algorithms.
The TetMesh module provides for a monitor callback function to be specified which is called intermittently during the mesh generation process in vis_TetMeshGenerate. The primary purpose of this function is to allow the user to interrupt or interrogate the on-going mesh generation process for any reason. If mesh generation is to be terminated, call vis_TetMeshAbort. This call will set an internal flag which will cause vis_TetMeshGenerate to terminate the mesh generation process and return. In addition, a user defined sizing callback function may be set. Set callback functions using vis_TetMeshSetFunction.
The following code fragment illustrates the basic framework of using the TetMesh module to generate linear tetrahedral finite elements in a volume bounded by the surface defined by a set of linear triangular facets.
/* declare objects */ vis_TetMesh *tetmesh; vis_Connect *connect; /* input surface triangles */ Vint numnode, numtris; Vdouble xpnt[][3] = { ... }; Vint ixtri[][3] = { ... }; Vint ierr; /* create tetmesh object */ tetmesh = vis_TetMeshBegin (); vis_TetMeshDef (tetmesh,numnode,numtris,2); /* define nodes and triangles */ for (i = 0; i < numnode; i++) { vis_TetMeshSetNode (tetmesh,i+1,xpnt[i]); } for (i = 0; i < numtris; i++) { vis_TetMeshSetTri (tetmesh,i+1,ixtri[i]); } /* create empty connect object to hold generated mesh */ connect = vis_ConnectBegin (); vis_ConnectDef (connect,0,0); /* generate mesh */ vis_TetMeshGenerate (tetmesh,connect); /* process any errors */ ierr = vis_TetMeshError (tetmesh); if(ierr) { ... } /* access generated nodes and elements from Connect */ ... /* delete objects */ vis_ConnectEnd (connect); vis_TetMeshEnd (tetmesh);Table of Contents
The geometry input to the TetMesh module consists of nodes, boundary triangles and enforced edges and faces. All input nodes are considered to be hard points and by default are not moved. All boundary triangles are input using vis_TetMeshSetTri and may include external boundary triangles (including the boundaries of voids) and internal boundary triangles representing inclusions and other internal surfaces. All triangles representing internal surfaces must be "double backed", ie for each triangle there must be an associated coincident triangle with opposite connectivity sense. Boundary triangles are subject to change during refinement operations. Internal hard edges which are enforced in the final mesh are input using vis_TetMeshSetEdge.
During refinement existing nodes are not moved. Refinement is performed by splitting edges and performing allowable swaps. All corner node identifiers are retained, midside node identifiers are, in general, reassigned. Additional nodes are generated to satisfy the refinement requirements. Any input triangle or interior edge is not swapped, any triangle edge with a specified association is not swapped. By default all boundary triangles and edges may be subdivided by the refinement process. Use the functions vis_TetMeshSetTriStat and vis_TetMeshSetEdgeStat. to mark entities which are not to be subdivided.
Mesh refinement is supported both for meshes generated with vis_TetMeshGenerate or for orphan meshes. In the case of orphan meshes, in addition to specifying the triangle-discretized boundary and its associations, the orphan mesh is specified by entering each original element with vis_TetMeshSetElem.
*vis_TetMeshBegin - create an instance of a TetMesh object
vis_TetMesh *vis_TetMeshBegin ()
None
Destroy an instance of a TetMesh object using
void vis_TetMeshEnd (vis_TetMesh *tetmesh)
Return the current value of a TetMesh object error flag using
Vint vis_TetMeshError (vis_TetMesh *tetmesh)
vis_TetMeshDef - define number of nodes, tris.
void vis_TetMeshDef (vis_TetMesh *tetmesh, Vint numnode, Vint numtris, Vint maxi)
tetmesh Pointer to TetMesh object. numnode Number of nodes on input surface mesh numtris Number of triangles on input surface mesh maxi Number of nodes on triangle edge =2 Linear surface triangles =3 Parabolic surface triangles =4 Cubic surface triangles
None
Inquire of defined numnode, numtris and maxi as output arguments using
void vis_TetMeshInq (vis_TetMesh *tetmesh, Vint *numnode, Vint *numtris, Vint *maxi)
vis_TetMeshAbort - set abort flag
void vis_TetMeshAbort (vis_TetMesh *tetmesh)
tetmesh Pointer to TetMesh object.
None
vis_TetMeshConnect - set the contents of Connect object
void vis_TetMeshConnect (vis_TetMesh *tetmesh, vis_Connect *connect)
tetmesh Pointer to TetMesh object. connect Pointer to Connect object to receive generated mesh
None
vis_TetMeshComputeVolume - compute volume C
INPUT ARGUMENTSvoid vis_TetMeshComputeVolume (vis_TetMesh *tetmesh, Vdouble *volume)
OUTPUT ARGUMENTStetmesh Pointer to TetMesh object.
volume Computed volume
vis_TetMeshGenerate - generate finite element mesh
void vis_TetMeshGenerate (vis_TetMesh *tetmesh, vis_Connect *connect)
tetmesh Pointer to TetMesh object. connect Pointer to Connect object to receive generated mesh
None
vis_TetMeshGetConnect - get internal Connect object
void vis_TetMeshGetConnect (vis_TetMesh *tetmesh, vis_Connect **connect)
tetmesh Pointer to TetMesh object.
connect Pointer to Connect object.
vis_TetMeshGetInteger - get integer mesh generation information
void vis_TetMeshGetInteger (vis_TetMesh *tetmesh, Vint type, Vint iparam[])
tetmesh Pointer to TetMesh object. type Type of integer information to query =TETMESH_NUMBOUNDINSERT Number of nodes inserted on boundary =TETMESH_BOUNDINSERT Nodes inserted on boundary =TETMESH_NUMFREEEDGE Number of surface triangle free edges =TETMESH_FREEEDGE Free edge surface triangles =TETMESH_NUMINCONS Number of inconsistent triangles =TETMESH_INCONS Inconsistent surface triangles =TETMESH_NUMINTERSECT Number of intersecting triangles =TETMESH_INTERSECT Intersecting triangles =TETMESH_NUMINTERSECTPAIR No. of intersecting triangle pairs =TETMESH_INTERSECTPAIR Intersecting triangle pairs =TETMESH_NUMNONMAN Number of non manifold triangles =TETMESH_NONMAN Non manifold surface triangles =TETMESH_NUMNEGJAC Number of negative Jacobians =TETMESH_NUMUNCONN Number of unconnected nodes =TETMESH_UNCONN Unconnected nodes =TETMESH_NUMTRIZEROANG Number of zero angle triangles =TETMESH_TRIZEROANG Zero angle triangles =TETMESH_NUMUNREC Number of unrecovered triangles =TETMESH_UNREC Unrecovered triangles =TETMESH_NUMNODEINSERT Number of nodes not inserted =TETMESH_NODEINSERT Not inserted nodes =VIS_MESH_PROGRESS Current meshing progress
iparam Returned integer information
The query type TETMESH_NUMBOUNDINSERT returns the number of nodes inserted on the boundary during mesh generation. This number is generally zero and will only be non-zero in the rare case that a node needed to be inserted on the boundary as a last resort during the boundary recovery phase. The query TETMESH_BOUNDINSERT will return the list of nodes inserted on the boundary.
The query type TETMESH_NUMNONMAN returns the number of improper non-manifold boundary triangles detected in the input. This number will only include those triangles detected on the first non-manifold edge encountered, it will not generally include all non-manifold triangles. The query TETMESH_NONMAN will return the list of non-manifold triangles detected.
The query type TETMESH_NUMINCONS returns the number of inconsistent triangles detected in the input. This number will only include those triangles detected on the first inconsistent edge encountered, it will not generally include all inconsistent triangles. The query TETMESH_INCONS will return the list of inconsistent triangles detected.
The query type TETMESH_NUMNEGJAC returns the number of elements with negative corner Jacobians. This check is only performed if it is enabled using vis_TetMeshSetParami.
The query type TETMESH_NUMUNCONN returns the number of unconnected nodes detected in the input. The query TETMESH_UNCONN will return the list of unconnected nodes.
The query type TETMESH_NUMTRIZEROANG returns the number of input triangles with zero angle detected in the input. The query TETMESH_TRIZEROANG will return the list of zero angle triangles.
The query type TETMESH_NUMINTERSECT returns the number of input faces which intersect. The query TETMESH_INTERSECT will return the list of intersecting triangles.
The query type TETMESH_NUMINTERSECTPAIR returns the number of pairs of intersecting triangles. The query TETMESH_INTERSECTPAIR will return the list of pairs of intersecting triangles. Note that the array of triangles returned needs large enough to hold 2 times the number of triangle pairs triangles.
The query type TETMESH_NUMUNREC returns the number of input faces which were unable to be recovered. The query TETMESH_UNREC will return the list of unrecovered triangles.
The query type TETMESH_NUMNODEINSERT returns the number of input nodes which were unable to be inserted. The query TETMESH_NODEINSERT will return the list of nodes which were not inserted.
The query type VIS_MESH_PROGRESS returns information about the current state of the meshing process. This function is most useful when called from the monitor function. The following four integer values are returned.
iparam[0] Meshing phase Phase 1 - Pre-processing boundary data Phase 2 - Boundary recovery Phase 3 - Generating interior points Phase 4 - Mesh cleanup Phase 5 - Mesh quality improvement Phase 101 - Refine Pre-processing Phase 102 - Refine point insertion Phase 103 - Refine Mesh quality improvement iparam[1] Current number of nodes iparam[2] Current number of elements iparam[3] Estimate percent completion
vis_TetMeshSetEdge - set interior edge
void vis_TetMeshSetEdge (vis_TetMesh *tetmesh, Vint id, Vint ix[])
tetmesh Pointer to TetMesh object. id Edge id ix Edge connectivity
None
vis_TetMeshSetEdgeAssoc - set interior edge associations
void vis_TetMeshSetEdgeAssoc (vis_TetMesh *tetmesh, Vint type, Vint id, Vint aid)
tetmesh Pointer to TetMesh object. type Type of association id Edge id aid Association value
None
vis_TetMeshSetEdgeStat - set interior edge status
void vis_TetMeshSetEdgeStat (vis_TetMesh *tetmesh, Vint id, Vint stat)
tetmesh Pointer to TetMesh object. id Edge id stat Status, bitwise OR =VIS_MESH_BIT_GENSPLIT Split during generation =VIS_MESH_BIT_GENSWAP Swap during generation =VIS_MESH_BIT_REFSPLIT Split during refinement =VIS_MESH_BIT_REFSWAP Swap during refinement
None
vis_TetMeshSetFunction - set a call back function
void vis_TetMeshSetFunction (vis_TetMesh *tetmesh, Vint funtype, void (*function)(), Vobject *object)
tetmesh Pointer to TetMesh object. funtype Type of callback function to set =SYS_FUNCTION_MONITOR Monitor callback =SYS_FUNCTION_SIZING Sizing callback =SYS_FUNCTION_ASIZING Anisotropic sizing callback function Pointer to callback function object Pointer to the object to be returned as function argument
None
The monitor callback function prototype is
void function (vis_TetMesh *tetmesh, Vobject *object)The first argument is the TetMesh object, tetmesh, and the second is a user defined object, object.
The sizing callback function prototype is
void function (vis_TetMesh *tetmesh, Vobject *object, Vdouble x[3], Vdouble *s)The first argument is the TetMesh object, tetmesh, the second is a user defined object, object, the third is the coordinate location x and the fourth is the returned size s.
The anisotropic sizing callback function prototype is
void function (vis_TetMesh *tetmesh, Vobject *object, Vdouble x[3], Vdouble s[3][3])The first argument is the TetMesh object, tetmesh, the second is a user defined object, object, the third is the coordinate location x and the fourth is the returned anisotropic scaled orthogonal direction vectors. The first 3 components are the first size scaled direction, the next 3 components are the second size scaled direction, the next 3 components are the third size scaled direction.
vis_TetMeshSetParami - set mesh generation parameters
void vis_TetMeshSetParami (vis_TetMesh *tetmesh, Vint ptype, Vint iparam)
tetmesh Pointer to TetMesh object. ptype Type of display parameter to set =VIS_MESH_MAXI Order of generated elements =VIS_MESH_INWARD Inward normal triangle flag. =VIS_MESH_DELAUNAY Delaunay mesh flag =VIS_MESH_INTERREFINE Interior refinement flag =VIS_MESH_MIDSIDEQUAL Quality midside node adjustment =VIS_MESH_POINTSET Delaunay tetrahedralization of point set =VIS_MESH_REPAIRINCONS Repair inconsistent input =TETMESH_UNCONNECT Toggle unconnected interior nodes iparam Specifies the integer value that ptype will be set to. =SYS_OFF Disable =SYS_ON Enable
None
The parameter VIS_MESH_MAXI sets the order of the generated tetrahedral elements by specifying the number of nodes to generate along an edge. A value of 2 generates linear tetrahedra, a value of 3 generates parabolic tetrahedra and a value of 4 generates cubic tetrahedra. By default VIS_MESH_MAXI is set to the order of the input surface triangles defined by vis_TetMeshDef. Note that the order of the generated tetrahedra can only be changed from the default if linear input surface triangles are input.
The parameter VIS_MESH_INWARD sets the normal convention of the input triangles to point into the volume. By default VIS_MESH_INWARD is set to SYS_OFF, that is, the triangle normals are expected to point out of the volume.
The parameter VIS_MESH_DELAUNAY requests that the final mesh satisfy the Delaunay criterion. By default VIS_MESH_DELAUNAY is set to SYS_OFF.
The parameter VIS_MESH_INTERREFINE enables the refinement of the interior. If this parameter is disabled, the generation of zero interior points is not guaranteed. The placement of zero interior points is impossible in some cases. By default VIS_MESH_INTERREFINE is set to SYS_ON.
The parameter VIS_MESH_MIDSIDEQUAL toggles the adjustment of midside nodes of parabolic and cubic elements to satisfy specified quality constraints. The midside nodes are adjusted to ensure that all node Jacobians are positive and that the Jacobian ratio in any element is less than the specified upper Jacobian ratio bound. This bound is specified using vis_TetMeshSetParamd. This procedure normally moves the midside node location of interior edges to satisfy quality constraints. It may move midside nodes on the surface triangulation in rare cases. By default VIS_MESH_MIDSIDEQUAL is set to SYS_ON.
The parameter VIS_MESH_POINTSET requests a Delaunay tetrahedralization of the input points. The mesh boundary is the convex hull of the point set. By default VIS_MESH_POINTSET is set to SYS_OFF.
The parameter VIS_MESH_REPAIRINCONS toggles the repair of inconsistent connectivity of input triangles. If enabled, all input triangle connectivities are checked for consistent sense and enclosing positive total volume. The connectivities are then selectively reversed to enforce consistency and total positive volume. By default VIS_MESH_REPAIRINCONS is set to SYS_OFF.
By default, all input nodes must be connected to input boundary triangles and interior edges and faces. If unconnected nodes are to be inserted in the interior then parameter TETMESH_UNCONNECT must be enabled. By default TETMESH_UNCONNECT is set to SYS_OFF.
Inquire of defined integer parameters as output arguments using
void vis_TetMeshGetParami (vis_TetMesh *tetmesh, Vint ptype, Vint *iparam)
vis_TetMeshSetParamd - set mesh generation parameters
void vis_TetMeshSetParamd (vis_TetMesh *tetmesh, Vint ptype, Vdouble dparam)
tetmesh Pointer to TetMesh object. ptype Type of display parameter to set =VIS_MESH_EDGELENGTH Target edge length =VIS_MESH_GROWTHRATE Maximum growth rate =VIS_MESH_MAXEDGELENGTH Maximum edge length =VIS_MESH_MAXEDGEALT Maximum edge altitude ratio =VIS_MESH_MAXANGLE Maximum dihedral angle =VIS_MESH_REFINEFACTOR Control refine element count dparam Specifies the value that ptype will be set to.
None
The parameter VIS_MESH_EDGELENGTH specifies a target edge length of generated tetrahedra. The edge length constraint may not be satisfied for tetrahedra generated near the surface mesh due to surface mesh sizing. By default VIS_MESH_EDGELENGTH is set to 1.
The parameter VIS_MESH_GROWTHRATE specifies a maximum growth rate. The growth rate governs the rate at which the size of adjacent elements can grow. The ratio of edge lengths of unconstrained adjacent elements will not exceed the specified growth rate. The growth rate must be greateer than 1.001. By default VIS_MESH_GROWTHRATE is set to 2.0
The parameter VIS_MESH_MAXEDGELENGTH specifies a maximum edge length of generated elements. The maximum edge length constraint may not be satisfied for tetrahedra generated near the surface mesh due to surface mesh sizing otherwise the maximum edge length is strictly enforced. By default VIS_MESH_MAXEDGELENGTH is set to 0. and is ignored.
The parameter VIS_MESH_MAXEDGEALT specifies an upper bound on the edge-altitude ratio of an element. The edge-altitude ratio is defined as the maximum edge length over the smallest altitude. A series of operations are performed in an attempt to satisfy the edge-altitude ratio quality. By default VIS_MESH_MAXEDGEALT is set to 100.
The parameter VIS_MESH_REFINEFACTOR controls the number of elements generated during vis_TetMeshRefine. It specifies a factor to be applied to the number of starting elements to yield the maximum number of elements to be allowed in the refinement step. By default VIS_MESH_REFINEFACTOR is set to 10.
Inquire of defined double precision parameters as output arguments using
void vis_TetMeshGetParamd (vis_TetMesh *tetmesh, Vint ptype, Vdouble *dparam)
vis_TetMeshRefine - refine a tetrahedral mesh
void vis_TetMeshRefine (vis_TetMesh *tetmesh, vis_State *state, vis_Connect *connect)
tetmesh Pointer to TetMesh object. state Pointer to State object holding new element sizes
connect Pointer to Connect object holding the refined mesh
If an orphan mesh is to be refined - i.e., a mesh not generated with TetMesh, use vis_TetMeshSetElem to set the initial tetrahedron mesh. The boundary of the orphan mesh must be specified with vis_TetMeshSetTri and, if needed, vis_TetMeshSetTriAssoc.
Since TetMesh has no knowledge of preserved edges it uses all edges with an edge association as an indication of a preserved edge.
vis_TetMeshSetElem - set an orphan mesh for refinement
void vis_TetMeshSetElem (vis_TetMesh *tetmesh, Vint id, Vint shape, Vint maxi, Vint ix[])
tetmesh Pointer to TetMesh object. id Element index shape Element shape. Only SYS_SHAPETET is supported. maxi Order of the elements in the initial mesh. ix Element connectivity
NONE
vis_TetMeshSetGeomSizing - specify sizing within geometric shape
void vis_TetMeshSetGeomSizing (vis_TetMesh *tetmesh, Vint type, Vdouble xo[3], Vdouble xa[3], Vdouble xb[3], Vdouble d[3], Vdouble h)
tetmesh Pointer to TetMesh object. type Geometry type =VIS_MESH_GEOMSPHERE Ellipsoid =VIS_MESH_GEOMCYLINDER Ellipsoidal cylinder =VIS_MESH_GEOMBOX Box xo Coordinates of geometry origin xa Coordinates of point along x' axis xb Coordinates of point in x'y' plane d Half length of geometric shape along each axis h Sizing
None
vis_TetMeshSetNodeSizing - set node sizing
void vis_TetMeshSetNodeSizing (vis_TetMesh *tetmesh, Vint id, Vdouble h)
tetmesh Pointer to TetMesh object. id Node id h Sizing.
None
vis_TetMeshSetNodeStat - set surface node status
void vis_TetMeshSetNodeStat (vis_TetMesh *tetmesh, Vint id, Vint stat)
tetmesh Pointer to TetMesh object. id Node id stat Surface node status =0 Surface node may be moved =1 Surface node may not be moved
None
vis_TetMeshSetNode - define a surface node
void vis_TetMeshSetNode (vis_TetMesh *tetmesh, Vint id, Vdouble x[3])
tetmesh Pointer to TetMesh object. id Node id x Node coordinate location
None
vis_TetMeshSetNodeAssoc - define a node association
void vis_TetMeshSetNodeAssoc (vis_TetMesh *tetmesh, Vint type, Vint id, Vint aid)
tetmesh Pointer to TetMesh object. type Type of association id Node id aid Association value
None
vis_TetMeshSetTri - define a triangle
void vis_TetMeshSetTri (vis_TetMesh *tetmesh, Vint id, Vint ix[])
tetmesh Pointer to TetMesh object. id Triangle id ix Triangle connectivity
None
vis_TetMeshSetTriAssoc - define a triangle association
void vis_TetMeshSetTriAssoc (vis_TetMesh *tetmesh, Vint type, Vint id, Vint enttype, Vint no, Vint aid)
tetmesh Pointer to TetMesh object. type Type of association id Triangle id enttype Entity type to which association is assigned =SYS_EDGE Element edge association =SYS_FACE Element face association =SYS_ELEM Element association no Triangle edge or face number aid Association value
None
vis_TetMeshSetTriSizing - set sizing within a region
void vis_TetMeshSetTriSizing (vis_TetMesh *tetmesh, Vint id, Vdouble h)
tetmesh Pointer to TetMesh object. id Triangle id h Sizing.
None
vis_TetMeshSetTriDepthSizing - set sizing within a depth in a region
void vis_TetMeshSetTriDepthSizing (vis_TetMesh *tetmesh, Vint id, Vdouble d, Vdouble h)
tetmesh Pointer to TetMesh object. id Triangle id d Depth h Sizing
None
vis_TetMeshSetTriStat - set triangle status
void vis_TetMeshSetTriStat (vis_TetMesh *tetmesh, Vint id, Vint no, Vint stat)
tetmesh Pointer to TetMesh object. id Triangle id no Triangle edge number stat Status, bitwise OR =VIS_MESH_BIT_GENSPLIT Split during generation =VIS_MESH_BIT_GENSWAP Swap during generation =VIS_MESH_BIT_REFSPLIT Split during refinement =VIS_MESH_BIT_REFSWAP Swap during refinement
None
vis_TetMeshRead - read mesh description from file
void vis_TetMeshRead (vis_TetMesh *tetmesh, Vint type, const Vchar *path)
tetmesh Pointer to TetMesh object. type File type =SYS_ASCII ASCII format =SYS_BINARY Binary format path File path
None
vis_TetMeshWrite - write mesh description from file
void vis_TetMeshWrite (vis_TetMesh *tetmesh, Vint type, const Vchar *path)
tetmesh Pointer to TetMesh object. type File type =SYS_ASCII ASCII format =SYS_BINARY Binary format path File path
None
The functions associated with a VolMesh object are the following.
*vis_VolMeshBegin - create an instance of a VolMesh object vis_VolMeshEnd - destroy an instance of a VolMesh object vis_VolMeshError - return VolMesh object error flag
vis_VolMeshAbort - set abort flag vis_VolMeshDef - define number of nodes, faces. Inq - inquire number of nodes, faces. vis_VolMeshConnect - set the contents of Connect object vis_VolMeshGenerate - generate finite element mesh vis_VolMeshGetConnect - get internal Connect object vis_VolMeshGetInteger - get integer mesh generation information vis_VolMeshSetEdge - set interior edge vis_VolMeshSetEdgeStat - set interior edge status vis_VolMeshSetFunction - set a call back function vis_VolMeshSetParami - set mesh generation parameters GetParami - get mesh generation parameters vis_VolMeshSetParamd - set mesh generation parameters GetParamd - get mesh generation parameters vis_VolMeshRefine - refine a mesh vis_VolMeshSetGeomSizing - specify sizing within geometric shape vis_VolMeshSetNode - define a node vis_VolMeshSetNodeAssoc - define a node association vis_VolMeshSetNodeSizing - set node sizing vis_VolMeshSetNodeStat - set node status vis_VolMeshSetFace - define a face vis_VolMeshSetFaceAssoc - define a face association vis_VolMeshSetFaceFill - define a bounding face fill type vis_VolMeshSetFaceSizing - set sizing within a region vis_VolMeshSetFaceDepthSizing - set sizing within a depth in a region vis_VolMeshSetFaceStat - set face status vis_VolMeshWrite - write mesh description to file vis_VolMeshRead - read mesh description from file
Each bounded region may be assigned a fill type. Currently two fill types are supported, no fill and fill with tetrahedra. The fill type is specified using the function vis_VolMeshSetFaceFill. If the boundary contains quadrilateral elements then a pyramid element is generated to transition conformally from the quadrilateral face to the interior tetrahedra. It is possible to input mixed order triangle and quadrilateral elements. For example, the input may contain linear quadrilaterals and parabolic or cubic and mixed order linear/parabolic-cubic triangles. The interior tetrahedron are parabolic or cubic and all pyramids and tetrahedra connecting to linear edges in the boundary mesh will be of mixed linear/parabolic-cubic order. Note that the order of the input surface triangles and quadrilaterals is unchanged by vis_VolMeshGenerate, ie. no nodes will be inserted on the edges of the input surface.
The function vis_VolMeshSetParami is used to set integer parameters which affect the mesh generation process. The function vis_VolMeshSetParamd is used to set real double precision parameters which control the quality and size of the generated elements. A global target edge length for interior elements may be prescribed. Specific, location dependent, sizes may be set at input nodes using vis_VolMeshSetNodeSizing and for regions using vis_VolMeshSetFaceSizing.
By default, all input nodes must be connected to input boundary faces and interior edges and faces. If unconnected nodes are to be inserted in the interior then the user must call vis_VolMeshSetParami to enable parameter type VOLMESH_UNCONNECT.
The user is able to define integer associations at nodes and faces which will be assigned to the node and elements generated on the respective entity. These associations are useful for identifying nodes and elements in the output mesh for the application of loads, boundary conditions, material properties, etc. The function vis_VolMeshSetNodeAssoc is used to set associations at nodes generated at input points. The function vis_VolMeshSetNodeAssoc may be called any number of times for a single node with the same association type. The association values are accumulated as multiple association on the node. The function vis_VolMeshSetFaceAssoc is used to set associations which will be attached to nodes generated on faces and along face edges. These associations will also be generated as element entity associations along the respective element edges and faces connected to the input faces. The element associations are useful for tagging elements generated with an enclosed boundary, etc.
Finally the function vis_VolMeshGenerate generates the nodes and elements and enters them into a Connect object. The mesh generation process may fail due to errors in the surface faces or failure of the meshing procedure. Use vis_VolMeshGetInteger to query for detailed information concerning errors in the surface faces, etc.
During the mesh generation process, the input surface faces and face corner node locations (by default) remain unchanged. However, the midside node locations may be perturbed under certain circumstances to satisfy quality constraints in the output elements. The function vis_VolMeshSetParami is used to set the parameter VIS_MESH_MIDSIDEQUAL which controls the overall movement of midside nodes. By default all midside nodes are susceptible to movement.
The function vis_VolMeshWrite is provided to write a complete description of the defined input surface mesh and meshing parameters to a file. The primary use of this file is to encapsulate cases in which the VolMesh module should fail in some respect. This output file can then be made available to Visual Kinematics for failure diagnosis of VolMesh meshing algorithms.
The VolMesh module provides for a monitor callback function to be specified which is called intermittently during the mesh generation process in vis_VolMeshGenerate. The primary purpose of this function is to allow the user to interrupt or interrogate the on-going mesh generation process for any reason. If mesh generation is to be terminated, call vis_VolMeshAbort. This call will set an internal flag which will cause vis_VolMeshGenerate to terminate the mesh generation process and return. In addition, a user defined sizing callback function may be set. Set callback functions using vis_VolMeshSetFunction.
*vis_VolMeshBegin - create an instance of a VolMesh object
vis_VolMesh *vis_VolMeshBegin ()
None
Destroy an instance of a VolMesh object using
void vis_VolMeshEnd (vis_VolMesh *volmesh)
Return the current value of a VolMesh object error flag using
Vint vis_VolMeshError (vis_VolMesh *volmesh)
vis_VolMeshDef - define number of nodes, faces.
void vis_VolMeshDef (vis_VolMesh *volmesh, Vint numnode, Vint numface)
volmesh Pointer to VolMesh object. numnode Number of nodes on input surface mesh
None
Inquire of defined numnode and numface. as output arguments using
void vis_VolMeshInq (vis_VolMesh *volmesh, Vint *numnode, Vint *numface)
vis_VolMeshAbort - set abort flag
void vis_VolMeshAbort (vis_VolMesh *volmesh)
volmesh Pointer to VolMesh object.
None
vis_VolMeshConnect - set the contents of Connect object
void vis_VolMeshConnect (vis_VolMesh *volmesh, vis_Connect *connect)
volmesh Pointer to VolMesh object. connect Pointer to Connect object to receive generated mesh
None
vis_VolMeshGenerate - generate finite element mesh
void vis_VolMeshGenerate (vis_VolMesh *volmesh, vis_Connect *connect)
volmesh Pointer to VolMesh object. connect Pointer to Connect object to receive generated mesh
None
vis_VolMeshGetConnect - get internal Connect object
void vis_VolMeshGetConnect (vis_VolMesh *volmesh, vis_Connect **connect)
volmesh Pointer to VolMesh object.
connect Pointer to Connect object.
vis_VolMeshGetInteger - get integer mesh generation information
void vis_VolMeshGetInteger (vis_VolMesh *volmesh, Vint type, Vint iparam[])
volmesh Pointer to VolMesh object. type Type of integer information to query =VOLMESH_NUMFREEEDGE Number of surface face free edges =VOLMESH_FREEEDGE Free edge surface face =VOLMESH_NUMINCONS Number of inconsistent face =VOLMESH_INCONS Inconsistent surface face =VOLMESH_NUMINTERSECT Number of intersecting face =VOLMESH_INTERSECT Intersecting face =VOLMESH_NUMNONMAN Number of non manifold face =VOLMESH_NONMAN Non manifold surface face =VOLMESH_NUMNEGJAC Number of negative Jacobians =VOLMESH_NUMUNCONN Number of unconnected nodes =VOLMESH_UNCONN Unconnected nodes =VOLMESH_NUMTRIZEROANG Number of zero angle face =VOLMESH_TRIZEROANG Zero angle face =VOLMESH_NUMUNREC Number of unrecovered face =VOLMESH_UNREC Unrecovered face =VOLMESH_NUMNODEINSERT Number of nodes not inserted =VOLMESH_NODEINSERT Not inserted nodes =VIS_MESH_PROGRESS Current meshing progress
iparam Returned integer information
The query type VOLMESH_NUMNONMAN returns the number of improper non-manifold boundary face detected in the input. This number will only include those face detected on the first non-manifold edge encountered, it will not generally include all non-manifold face. The query VOLMESH_NONMAN will return the list of non-manifold face detected.
The query type VOLMESH_NUMINCONS returns the number of inconsistent faces detected in the input. This number will only include those faces detected on the first inconsistent edge encountered, it will not generally include all inconsistent faces. The query VOLMESH_INCONS will return the list of inconsistent faces detected.
The query type VOLMESH_NUMNEGJAC returns the number of elements with negative corner Jacobians. This check is only performed if it is enabled using vis_VolMeshSetParami.
The query type VOLMESH_NUMUNCONN returns the number of unconnected nodes detected in the input. The query VOLMESH_UNCONN will return the list of unconnected nodes.
The query type VOLMESH_NUMTRIZEROANG returns the number of input faces with zero angle detected in the input. The query VOLMESH_TRIZEROANG will return the list of zero angle faces.
The query type VOLMESH_NUMINTERSECT returns the number of input faces which intersect. The query VOLMESH_INTERSECT will return the list of intersecting faces.
The query type VOLMESH_NUMUNREC returns the number of input faces which were unable to be recovered. The query VOLMESH_UNREC will return the list of unrecovered faces.
The query type VOLMESH_NUMNODEINSERT returns the number of input nodes which were unable to be inserted. The query VOLMESH_NODEINSERT will return the list of nodes which were not inserted.
The query type VIS_MESH_PROGRESS returns information about the current state of the meshing process. This function is most useful when called from the monitor function. The following four integer values are returned.
iparam[0] Meshing phase Phase 1 - Pre-processing boundary data Phase 2 - Boundary recovery Phase 3 - Generating interior points Phase 4 - Mesh cleanup Phase 5 - Mesh quality improvement iparam[1] Current number of nodes iparam[2] Current number of elements iparam[3] Estimate percent completion
vis_VolMeshSetEdge - set interior edge
void vis_VolMeshSetEdge (vis_VolMesh *volmesh, Vint id, Vint maxi, Vint ix[])
volmesh Pointer to VolMesh object. id Edge id maxi Number of edge nodes ix Edge connectivity
None
vis_VolMeshSetEdgeStat - set interior edge status
void vis_VolMeshSetEdgeStat (vis_VolMesh *volmesh, Vint id, Vint stat)
volmesh Pointer to VolMesh object. id Edge id stat Status, bitwise OR =VIS_MESH_BIT_GENSPLIT Split during generation =VIS_MESH_BIT_GENSWAP Swap during generation =VIS_MESH_BIT_REFSPLIT Split during refinement =VIS_MESH_BIT_REFSWAP Swap during refinement
None
vis_VolMeshSetFunction - set a call back function
void vis_VolMeshSetFunction (vis_VolMesh *volmesh, Vint funtype, void (*function)(), Vobject *object)
volmesh Pointer to VolMesh object. funtype Type of callback function to set =SYS_FUNCTION_MONITOR Monitor callback =SYS_FUNCTION_SIZING Sizing callback =SYS_FUNCTION_ASIZING Anisotropic sizing callback function Pointer to callback function object Pointer to the object to be returned as function argument
None
The monitor callback function prototype is
void function (vis_VolMesh *volmesh, Vobject *object)The first argument is the VolMesh object, volmesh, and the second is a user defined object, object.
The sizing callback function prototype is
void function (vis_VolMesh *volmesh, Vobject *object, Vdouble x[3], Vdouble *s)The first argument is the VolMesh object, volmesh, the second is a user defined object, object, the third is the coordinate location x and the fourth is the returned size s.
The anisotropic sizing callback function prototype is
void function (vis_VolMesh *volmesh, Vobject *object, Vdouble x[3], Vdouble s[3][3])The first argument is the VolMesh object, volmesh, the second is a user defined object, object, the third is the coordinate location x and the fourth is the returned anisotropic scaled orthogonal direction vectors. The first 3 components are the first size scaled direction, the next 3 components are the second size scaled direction, the next 3 components are the third size scaled direction.
vis_VolMeshSetParami - set mesh generation parameters
void vis_VolMeshSetParami (vis_VolMesh *volmesh, Vint ptype, Vint iparam)
volmesh Pointer to VolMesh object. ptype Type of display parameter to set =VIS_MESH_MAXI Order of generated elements =VIS_MESH_MIDSIDEQUAL Quality midside node adjustment =VIS_MESH_REPAIRINCONS Repair inconsistent input =VOLMESH_UNCONNECT Toggle unconnected interior nodes iparam Specifies the integer value that ptype will be set to. =SYS_OFF Disable =SYS_ON Enable
None
The parameter VIS_MESH_MAXI sets the order of the generated tetrahedral elements by specifying the number of nodes to generate along an edge. A value of 2 generates linear tetrahedra, a value of 3 generates parabolic tetrahedra and a value of 4 generates cubic tetrahedra. By default VIS_MESH_MAXI is set to 2.
The parameter VIS_MESH_MIDSIDEQUAL toggles the adjustment of midside nodes of parabolic and cubic elements to satisfy specified quality constraints. The midside nodes are adjusted to ensure that all node Jacobians are positive and that the Jacobian ratio in any element is less than the specified upper Jacobian ratio bound. This bound is specified using vis_VolMeshSetParamd. This procedure normally moves the midside node location of interior edges to satisfy quality constraints. It may move midside nodes on the surface face in rare cases. By default VIS_MESH_MIDSIDEQUAL is set to SYS_ON.
By default, all input nodes must be connected to input boundary faces and interior edges and faces. If unconnected nodes are to be inserted in the interior then parameter VOLMESH_UNCONNECT must be enabled. By default VOLMESH_UNCONNECT is set to SYS_OFF.
Inquire of defined integer parameters as output arguments using
void vis_VolMeshGetParami (vis_VolMesh *volmesh, Vint ptype, Vint *iparam)
vis_VolMeshSetParamd - set mesh generation parameters
void vis_VolMeshSetParamd (vis_VolMesh *volmesh, Vint ptype, Vdouble dparam)
volmesh Pointer to VolMesh object. ptype Type of display parameter to set =VIS_MESH_EDGELENGTH Target edge length =VIS_MESH_GROWTHRATE Maximum growth rate =VIS_MESH_MAXEDGELENGTH Maximum edge length =VIS_MESH_MAXEDGEALT Maximum edge-altitude ratio =VIS_MESH_MAXANGLE Maximum dihedral angle dparam Specifies the value that ptype will be set to.
None
The parameter VIS_MESH_EDGELENGTH specifies a target edge length of generated elements. The edge length constraint may not be satisfied for elements generated near the surface mesh due to surface mesh sizing. By default VIS_MESH_EDGELENGTH is set to 1.
The parameter VIS_MESH_GROWTHRATE specifies a maximum growth rate. The growth rate governs the rate at which the size of adjacent elements can grow. The ratio of edge lengths of adjacent elements will not exceed the specified growth rate. The growth rate must be greateer than 1.001. By default VIS_MESH_GROWTHRATE is set to 2.0
The parameter VIS_MESH_MAXEDGELENGTH specifies a maximum edge length of generated elements. The maximum edge length constraint may not be satisfied for elements generated near the surface mesh due to surface mesh sizing. By default VIS_MESH_MAXEDGELENGTH is set to 0. and is ignored.
The parameter VIS_MESH_MAXEDGEALT specifies an upper bound on the edge-altitude ratio of an element. The edge-altitude ratio is defined as the maximum edge length over the smallest altitude. A series of operations are performed in an attempt to satisfy the edge-altitude ratio quality. By default VIS_MESH_MAXEDGEALT is set to 100.
Inquire of defined double precision parameters as output arguments using
void vis_VolMeshGetParamd (vis_VolMesh *volmesh, Vint ptype, Vdouble *dparam)
vis_VolMeshRefine - refine a mesh
void vis_VolMeshRefine (vis_VolMesh *volmesh, vis_State *state, vis_Connect *connect)
volmesh Pointer to VolMesh object. state Pointer to State object holding new element sizes
connect Pointer to Connect object holding the refined mesh
Since VolMesh has no knowledge of preserved edges it uses all edges with an edge association as an indication of a preserved edge.
vis_VolMeshSetGeomSizing - specify sizing within geometric shape
void vis_VolMeshSetGeomSizing (vis_VolMesh *volmesh, Vint type, Vdouble xo[3], Vdouble xa[3], Vdouble xb[3], Vdouble d[3], Vdouble h)
volmesh Pointer to VolMesh object. type Geometry type =VIS_MESH_GEOMSPHERE Ellipsoid =VIS_MESH_GEOMCYLINDER Ellipsoidal cylinder =VIS_MESH_GEOMBOX Box xo Coordinates of geometry origin xa Coordinates of point along x' axis xb Coordinates of point in x'y' plane d Half length of geometric shape along each axis h Sizing
None
vis_VolMeshSetNode - define a surface node
void vis_VolMeshSetNode (vis_VolMesh *volmesh, Vint id, Vdouble x[3])
volmesh Pointer to VolMesh object. id Node id x Node coordinate location
None
vis_VolMeshSetNodeAssoc - define a node association
void vis_VolMeshSetNodeAssoc (vis_VolMesh *volmesh, Vint type, Vint id, Vint aid)
volmesh Pointer to VolMesh object. type Type of association id Node id aid Association value
None
vis_VolMeshSetNodeSizing - set node sizing
void vis_VolMeshSetNodeSizing (vis_VolMesh *volmesh, Vint id, Vdouble h)
volmesh Pointer to VolMesh object. id Node id h Sizing.
None
vis_VolMeshSetNodeStat - set surface node status
void vis_VolMeshSetNodeStat (vis_VolMesh *volmesh, Vint id, Vint stat)
volmesh Pointer to VolMesh object. id Node id stat Surface node status =0 Surface node may be moved =1 Surface node may not be moved
None
vis_VolMeshSetFace - define a face
void vis_VolMeshSetFace (vis_VolMesh *volmesh, Vint id, Vint shape, Vint maxi, Vint maxj, Vint ix[])
volmesh Pointer to VolMesh object. id Face id shape Face shape maxi Face order maxj ix Face connectivity
None
vis_VolMeshSetFaceAssoc - define a face association
void vis_VolMeshSetFaceAssoc (vis_VolMesh *volmesh, Vint type, Vint id, Vint enttype, Vint no, Vint aid)
volmesh Pointer to VolMesh object. type Type of association id Face id enttype Entity type to which association is assigned =SYS_EDGE Element edge association =SYS_FACE Element face association =SYS_ELEM Element association no Face edge number aid Association value
None
vis_VolMeshSetFaceFill - define a bounding face fill type
void vis_VolMeshSetFaceFill (vis_VolMesh *volmesh, Vint id, Vint fill)
volmesh Pointer to VolMesh object. id Face id fill Fill type =VOLMESH_FILL_TET Fill directly with tetrahedra =VOLMESH_FILL_BOUNDARY Do not volumetrically fill
None
vis_VolMeshSetFaceSizing - set sizing within a region
void vis_VolMeshSetFaceSizing (vis_VolMesh *volmesh, Vint id, Vdouble h)
volmesh Pointer to VolMesh object. id Face id h Sizing.
None
vis_VolMeshSetFaceDepthSizing - set sizing within a depth in a region
void vis_VolMeshSetTriDepthSizing (vis_VolMesh *volmesh, Vint id, Vdouble d, Vdouble h)
volmesh Pointer to VolMesh object. id Face id d Depth h Sizing
None
vis_VolMeshSetFaceStat - set face status
void vis_VolMeshSetFaceStat (vis_VolMesh *volmesh, Vint id, Vint no, Vint stat)
volmesh Pointer to VolMesh object. id Face id no Face edge number stat Status, bitwise OR =VIS_MESH_BIT_GENSPLIT Split during generation =VIS_MESH_BIT_GENSWAP Swap during generation =VIS_MESH_BIT_REFSPLIT Split during refinement =VIS_MESH_BIT_REFSWAP Swap during refinement
None
vis_VolMeshRead - read mesh description from file
void vis_VolMeshRead (vis_VolMesh *volmesh, Vint type, const Vchar *path)
volmesh Pointer to VolMesh object. type File type =SYS_ASCII ASCII format =SYS_BINARY Binary format path File path
None
vis_VolMeshWrite - write mesh description from file
void vis_VolMeshWrite (vis_VolMesh *volmesh, Vint type, const Vchar *path)
volmesh Pointer to VolMesh object. type File type =SYS_ASCII ASCII format =SYS_BINARY Binary format path File path
None