GeMA
The GeMA main application
Cell geometry object methods

Cell geometry objects are responsible for providing metadata information for each GeMA cell / element types. Cell geometry objects are obtained in the orchestration from a cell object by calling the cell:geometry() method. They can also be created from the cell type by calling the CellGeometry() function.

Example:

-- Get a geometry object from the cell type
local g = CellGeometry('tet4')
-- Get the geometry object for the first mesh cell
local m = modelData:mesh('myMeshName')
local c = m:cell(1) -- Get a reference for the first mesh cell
local g = c:geometry()

Index:

Creating a cell geometry object

CellGeometry(cellType)
Description: Returns the cell geometry object associated with the given cell type.
Parameters: cellType - A string with the cell type ("quad4", "tri3", ...). See the Element types page for a list of available cell types.
Returns: Returns the cell geometry object.

Example:

-- Get a geometry object from the cell type
local g = CellGeometry('tet4')


Geometry related methods

geometry:type()
Description: Returns the cell type associated with this geometry object.
Parameters: None.
Returns: Returns a string with the cell type ("quad4", "tri3", ...). See the Element types page for a list of available cell types.

Example:

local type = g:type()


geometry:family()
Description: Returns the type family associated with this geometry object.
Parameters: None.
Returns: Returns a string with the type family ("bar", "quad", "tri", "hex", "tet", ...). See the Element types page for a list of available family types.

Example:

local family = g:family()


geometry:order()
Description: Returns the cell interpolation order (1 = linear, 2 = quadratic, 3 = cubic, ...).
Parameters: None.
Returns: Returns the interpolation order.

Example:

local interpOrder = g:order()


geometry:isLine()
Description: Checks if this type is a 1D "line".
Parameters: None.
Returns: Returns true if this cell type is a 1D line, false otherwise.

Example:

if g:isLine() then
...
end


geometry:isSurface()
Description: Checks if this type is a 2D "surface".
Parameters: None.
Returns: Returns true if this cell type is a 2D surface, false otherwise.

Example:

if g:isSurface() then
...
end


geometry:isSolid()
Description: Checks if this type is a 3D "solid".
Parameters: None.
Returns: Returns true if this cell type is a 3D solid, false otherwise.

Example:

if g:isSolid() then
...
end


geometry:isInterface()
Description: Checks if this type is an interface element.
Parameters: None.
Returns: Returns true if this cell type is an interface element, false otherwise.

Example:

if g:isInterface() then
...
end


geometry:isHierarchical()
Description: Checks if this type is an hierarchical element, like "hquadp", "dghex", etc.
Parameters: None.
Returns: Returns true if this cell type is an hierarchical element, false otherwise.

Example:

if g:isHierarchical() then
...
end


geometry:linearElement()
Description: Returns the equivalent linear type for this geometry type. For example, for a "quad8" element, returns "quad4". For linear elements, returns the same as geometry:type()
Parameters: None.
Returns: Returns the equivalent linear type as a string.

Example:

print(CellGeometry('hex27'):linearElement()) -- Prints 'hex8'


geometry:length(X)
Description: Returns the length of a bar element with nodes defined by the given X coordinate matrix. Can also be used for calculating the length of a 2D interface element (the length is calculated at the average "plane" between the interface element edges). Returns 0.0 for other 2D (non interface) and 3D elements. The length of linear elements is calculated geometrically while the length of quadratic elements is calculated by numeric integration using the element's default integration rule.
Parameters: X - A matrix with the element's node coordinates. Should be organized as a d x n matrix where d is the coordinate dimension (as returned by geometry:numCoord()) and n is the number of nodes in the cell (as returned by geometry:numNodes()). Can be filled either manually or by a call to cell:nodeMatrix(coordAccessor, true) or to cell:deformedNodeMatrix(coordAccessor, true) to take node deformation in consideration (needed for mid plane interface element calculations).
Returns: Returns the calculated length.

Example:

local coordAc = mesh:nodeCoordAccessor()
local c = mesh:cell(1) -- Get a reference for the first mesh cell
local X = c:nodeMatrix(coordAc, true) -- Get the first mesh cell's coordinate matrix
local length = c:geometry():length(X)


geometry:area(X)
Description: Returns the area of a surface element with nodes defined by the given X coordinate matrix. Can also be used for calculating the area of a 3D interface element (the area is calculated at the average "plane" between the interface element faces). Returns 0.0 for 1D and other 3D (non interface) elements. The area of linear elements is calculated geometrically while the area of quadratic elements is calculated by numeric integration using the element's default integration rule.
Parameters: X - A matrix with the element's node coordinates. Should be organized as a d x n matrix where d is the coordinate dimension (as returned by geometry:numCoord()) and n is the number of nodes in the cell (as returned by geometry:numNodes()). Can be filled either manually or by a call to cell:nodeMatrix(coordAccessor, true) or to cell:deformedNodeMatrix(coordAccessor, true) to take node deformation in consideration (needed for mid plane interface element calculations).
Returns: Returns the calculated area.

Example:

local coordAc = mesh:nodeCoordAccessor()
local c = mesh:cell(1) -- Get a reference for the first mesh cell
local X = c:nodeMatrix(coordAc, true) -- Get the first mesh cell's coordinate matrix
local area = c:geometry():area(X)


geometry:volume(X)
Description: Returns the volume of a (non interfcae) solid element with nodes defined by the given X coordinate matrix. Returns 0.0 for 1D, 2D and 3D interface elements. The area of linear elements is calculated geometrically while the area of quadratic elements is calculated by numeric integration using the element's default integration rule.
Parameters: X - A matrix with the element's node coordinates. Should be organized as a d x n matrix where d is the coordinate dimension (as returned by geometry:numCoord()) and n is the number of nodes in the cell (as returned by geometry:numNodes()). Can be filled either manually or by a call to cell:nodeMatrix(coordAccessor, true) or to cell:deformedNodeMatrix(coordAccessor, true) to take node deformation in consideration.
Returns: Returns the calculated volume.

Example:

local coordAc = mesh:nodeCoordAccessor()
local c = mesh:cell(1) -- Get a reference for the first mesh cell
local X = c:nodeMatrix(coordAc, true) -- Get the first mesh cell's coordinate matrix
local volume = c:geometry():volume(X)


geometry:characteristicLength(X)
Description: Returns the characteristic length of the element with nodes defined by the given X coordinate matrix. It is defined as the length for bar and surface interface elements, the square root of the area for (non iterface) surface and solid interface elements and the cubic root of the volume for (non interface) solid elements.
Parameters: X - A matrix with the element's node coordinates. Should be organized as a d x n matrix where d is the coordinate dimension (as returned by geometry:numCoord()) and n is the number of nodes in the cell (as returned by geometry:numNodes()). Can be filled either manually or by a call to cell:nodeMatrix(coordAccessor, true) or to cell:deformedNodeMatrix(coordAccessor, true) to take node deformation in consideration.
Returns: Returns the calculated characteristic length.

Example:

local coordAc = mesh:nodeCoordAccessor()
local c = mesh:cell(1) -- Get a reference for the first mesh cell
local X = c:nodeMatrix(coordAc, true) -- Get the first mesh cell's coordinate matrix
local clength = c:geometry():characteristicLength(X)


geometry:characteristicDimension(X)
Description: Re Returns the characteristic dimension of the element with nodes defined by the given X coordinate matrix. It is defined as the length for bar and surface interface elements, the area for (non iterface) surface and solid interface elements and the volume for (non interface) solid elements.
Parameters: X - A matrix with the element's node coordinates. Should be organized as a d x n matrix where d is the coordinate dimension (as returned by geometry:numCoord()) and n is the number of nodes in the cell (as returned by geometry:numNodes()). Can be filled either manually or by a call to cell:nodeMatrix(coordAccessor, true) or to cell:deformedNodeMatrix(coordAccessor, true) to take node deformation in consideration.
Returns: Returns the calculated characteristic dimension.

Example:

local coordAc = mesh:nodeCoordAccessor()
local c = mesh:cell(1) -- Get a reference for the first mesh cell
local X = c:nodeMatrix(coordAc, true) -- Get the first mesh cell's coordinate matrix
local cdim = c:geometry():characteristicDimension(X)


geometry:centroidCartesian(X)
Description: Returns a vector with the cartesian coordinates for the centroid of the element with nodes defined by the given X coordinate matrix. Whenever possible, the calculations are done geometrically. For quadratic elements, it is done by numerical integration. For interface elements it is done at the element's "middle plane".
Parameters: X - A matrix with the element's node coordinates. Should be organized as a d x n matrix where d is the coordinate dimension (as returned by geometry:numCoord()) and n is the number of nodes in the cell (as returned by geometry:numNodes()). Can be filled either manually or by a call to cell:nodeMatrix(coordAccessor, true) or to cell:deformedNodeMatrix(coordAccessor, true) to take node deformation in consideration.
Returns: Returns a vector object with the cell centroid in cartesian coordinates.

Example:

local coordAc = mesh:nodeCoordAccessor()
local c = mesh:cell(1) -- Get a reference for the first mesh cell
local X = c:nodeMatrix(coordAc, true) -- Get the first mesh cell's coordinate matrix
local centroid = c:geometry():centroidCartesian(X)


Node related methods

geometry:numNodes()
Description: Returns the number of nodes for this cell type.
Parameters: None.
Returns: Returns the number of nodes.

Example:

local nnodes = g:numNodes()


geometry:numVertices()
Description: Returns the number of vertices for this cell type. Vertices are the cell "corner" (or linear) nodes and exclude center edge and face nodes. A "quad4" cell, for example, has 4 nodes and 4 vertices while a "quad9" cell has 9 nodes and 4 vertices.
The number of vertices also excludes additional dof nodes. In practice, for linear elements, numNodes() == numVertices() + numExtraDofNodes(). Also, if the element is not linear, its number of vertices should be the same as the number of vertices for its equivalent linear element. At present, this is also expected for the number of extra dof nodes.
Parameters: None.
Returns: Returns the number of vertices.

Example:

local nvertices = g:numVertices()

geometry:numExtraDofNodes()
Description: Returns the number of extra degrees of freedom (dof) nodes. This is usually 0, except for some kinds of interface elements. See also the comments for geometry:numVertices().
Parameters: None.
Returns: Returns the number of extra dof nodes.

Example:

local nextra = g:numExtraDofNodes()


geometry:numCoord()
Description: Returns the number of cartesian coordinates used by a node for this cell type. Returns, for example, 2 for a "quad4" and 3 for a "quad3d4".
Parameters: None.
Returns: Returns the number of cartesian coordinates.

Example:

local nvertices = g:numCoord()


geometry:numIncidenceNodes(nodeIndex)
Description: Returns the number of cell nodes incident to the given local node index.
Parameters: nodeIndex - The local node number (between 1 and geometry:numNodes()). See the Element types page for the node organization for each cell type.
Returns: Returns the number of nodes incident to a cell node.

Example:

local nincident = g:numIncidenceNodes(1)


geometry:incidenceNode(nodeIndex, i)
Description: Returns the local cell index for the i'th incident node to the given local node index.
Parameters: nodeIndex The local node number (between 1 and geometry:numNodes()). See the Element types page for the node organization for each cell type.
i The node index inside the incidence list (between 1 and geometry:numIncidenceNodes(nodeIndex)).
Returns: Returns the local node number of the i'th incident node to nodeIndex.

Example:

-- Print the set of incident nodes to the fourth node of a 'hex8' cell
local g = CellGeometry('hex8')
for i = 1, g:numIncidenceNodes(4) do
print(g:incidenceNode(4, i)
end


Edge related methods

geometry:numEdges()
Description: Returns the number of edges for this cell type.
Parameters: None.
Returns: Returns the number of edges.

Example:

local nedges = g:numEdges()


geometry:numEdgeNodes(edgeIndex)
Description: Returns the number of nodes in the given edge.
Parameters: edgeIndex - The edge number (between 1 and geometry:numEdges()). See the Element types page for the edge organization for each cell type.
Returns: Returns the number of nodes in the edge.

Example:

-- Returns the number of nodes in the first edge for the geometry type
local nedgeNodes= g:numEdgeNodes(1)


geometry:edgeNode(edgeIndex, i)
Description: Returns the local cell index for the i'th node belonging to the given edge. For the "quad8" element on the image below, edgeNode(2, 1) returns 2, edgeNode(2, 2) returns 6 and edgeNode(2, 3) returns 3.
Parameters: edgeIndex The cell edge number (between 1 and geometry:numEdges()). See the Element types page for the edge organization for each cell type.
elementWithEdges.png
i The node index inside the edge (between 1 and geometry:numEdgeNodes(edgeIndex)). Extremes (i == 1 and i == numEdgeNodes(edgeIndex)) are the edge vertices.
Returns: Returns the local cell node number.

Example:

-- Prints the global mesh index for all the nodes on the edges of cell 'c'
local g = c:geometry()
for edgeIndex = 1, g:numEdges() do
for i = 1, g:numEdgeNodes(edgeIndex) do
local localIndex = g:edgeNode(edgeIndex, i)
local globalIndex = c:nodeIndex(localIndex)
print(globalIndex)
end
end


geometry:firstEdgeNode(edgeIndex)
Description: Returns the local cell index for the first node belonging to the given edge. Equivalent to a call to geometry:edgeNode(edgeIndex, 1).
Parameters: edgeIndex - The edge number (between 1 and geometry:numEdges()). See the Element types page for the edge organization for each cell type.
Returns: Returns the local cell node number.

Example:

-- Prints the global mesh index for the first node on the edges of cell 'c'
local g = c:geometry()
for edgeIndex = 1, g:numEdges() do
local localIndex = g:firstEdgeNode(edgeIndex)
local globalIndex = c:nodeIndex(localIndex)
print(globalIndex)
end


geometry:lastEdgeNode(edgeIndex)
Description: Returns the local cell index for the last node belonging to the given edge. Equivalent to a call to geometry:edgeNode(edgeIndex, geometry:numEdgeNodes(edgeIndex)).
Parameters: edgeIndex - The edge number (between 1 and geometry:numEdges()). See the Element types page for the edge organization for each cell type.
Returns: Returns the local cell node number.

Example:

-- Prints the global mesh index for the last node on the edges of cell 'c'
local g = c:geometry()
for edgeIndex = 1, g:numEdges() do
local localIndex = g:lastEdgeNode(edgeIndex)
local globalIndex = c:nodeIndex(localIndex)
print(globalIndex)
end


geometry:nodeOnEdge(nodeIndex, edgeIndex)
Description: Returns true if the given local node index belongs to the given edge set of nodes, false otherwise.
Parameters: nodeIndex The cell node number (between 1 and geometry:numNodes()). See the Element types page for the node organization for each cell type.
edgeIndex The cell edge number (between 1 and geometry:numEdges()). See the Element types page for the edge organization for each cell type.
Returns: Returns true if the node belongs to the given edge, false otherwise.

Example:

-- Check if node 2 belongs to edge 6 of an hex8 element
local g = CellGeometry('hex8')
if g:nodeOnEdge(2, 6) then
-- Do something
end


geometry:edgeFromNodes(nodeIndex1, nodeIndex2)
Description: Returns the local number for the edge that contains the given set of nodes, in any order, as its first and last nodes. Returns nil if the cell type has no edge starting and ending with the given nodes.
Parameters: nodeIndex1 The first cell node number (between 1 and geometry:numNodes()). See the Element types page for the node organization for each cell type.
nodeIndex2 The second cell node number (between 1 and geometry:numNodes()). See the Element types page for the node organization for each cell type.
Returns: Returns the edge number (between 1 and geometry:numEdges()) or nil if the nodes don't form a valid cell edge.

Example:

-- Find the hex8 element edge staring with node 3 and ending with node 7 or
-- staring with 7 and ending with 3.
local g = CellGeometry('hex8')
local edge = g:edgeFromNodes(3, 7)


geometry:edgeElement(edgeIndex)
Description: Returns the type of the equivalent "bar" element (with either 2D or 3D coordinates) for a 2D or 3D element's edge.
Parameters: edgeIndex - The edge number (between 1 and geometry:numEdges()). See the Element types page for the edge organization for each cell type.
Returns: Returns the edge type (as a string) or nil if the edge has no valid equivalent type. This can happend, for example, for bar elements or for the "side edges" of an interface element.

Example:

-- Returns the edge type for the first edge of a quad8 and an hex20 elements
local edgeType1 = CellGeometry('quad8'):edgeElement(1) -- edgeType1 will be equal to 'bar3'
local edgeType2 = CellGeometry('hex20'):edgeElement(1) -- edgeType2 will be equal to 'bar3d3'


geometry:edgeElementNode(edgeIndex, i)
Description: Returns the local cell index for the i'th node belonging to the given edge, using the equivalent "bar" element type (as returned by geometry:edgeElement(edgeIndex)) node ordering. Keep in mind that the number of nodes follows the bar element type definition (usually equal to the original element's edge number of nodes).
Parameters: edgeIndex The edge number (between 1 and geometry:numEdges()). See the Element types page for the edge organization for each cell type.
i The node index inside the edge's equivalent bar element (between 1 and CellGeometry(geometry:edgeElement(edgeIndex)):numNodes()).
Returns: Returns the local node number of the i'th edge node, using the equivalent bar type node ordering. Raises an error if there is no equivalent bar element for the given edge (geometry:edgeElement(edgeIndex) returns nil).

Example:

-- Print the set of local nodes for the equivalent bar3 element associated with an hex20 element's first edge
local g = CellGeometry('hex20')
for i = 1, 3 do
print(g:edgeElementNode(1, i))
end


geometry:edgeLinearElement(edgeIndex)
Description: Returns the type of the equivalent linear "bar" element (with either 2D or 3D coordinates) for a 2D or 3D element's edge.
Parameters: edgeIndex - The edge number (between 1 and geometry:numEdges()). See the Element types page for the edge organization for each cell type.
Returns: Returns the edge linear type (as a string) or nil if the edge has no valid equivalent type. This happends whenever a call to geometry:edgeElement(edgeIndex) returns nil itself, for example, for bars or for the "side edges" of an interface element.

Example:

-- Returns the edge linear type for the first edge of a quad8 and an hex20 elements
local edgeType1 = CellGeometry('quad8'):edgeLinearElement(1) -- edgeType1 will be equal to 'bar2'
local edgeType2 = CellGeometry('hex20'):edgeLinearElement(1) -- edgeType2 will be equal to 'bar2d2'


Face related methods

geometry:numFaces()
Description: Returns the number of faces for this cell type (0 for "bar" like (1D) cells).
Parameters: None.
Returns: Returns the number of faces.

Example:

local nfaces = g:numFaces()


geometry:numFaceNodes(faceIndex)
Description: Returns the number of nodes in the given face.
Parameters: faceIndex - The face number (between 1 and geometry:numFaces()). See the Element types page for the face organization for each cell type.
Returns: Returns the number of nodes in the face.

Example:

-- Returns the number of nodes in the first face for the geometry type
local nfaceNodes = g:numFaceNodes(1)


geometry:numFaceBoundaryNodes(faceIndex)
Description: Returns the number of nodes in the boundary (edges) of the given face. Will be different from the value returned by geometry:numFaceNodes(faceIndex) if the face has internal, "mid face", nodes.
Parameters: faceIndex - The face number (between 1 and geometry:numFaces()). See the Element types page for the face organization for each cell type.
Returns: Returns the number of border nodes in the face.

Example:

-- Returns the number of boundary nodes in the first face for the geometry type
local nfaceNodes = g:numFaceBoundaryNodes(1)


geometry:faceNode(faceIndex, i)
Description: Returns the local cell index for the i'th node belonging to the given face. For the "hex20" element on the image below, faceNode(6, 1) returns 5, faceNode(6, 2) returns 17, faceNode(6, 3) returns 6 and so on, cycling the top face in an order so that the normal points outwards.
Parameters: faceIndex The cell face number (between 1 and geometry:numFaces()). See the Element types page for the face organization for each cell type.
elementWithFaces.png
i The node index inside the face (between 1 and geometry:numFaceNodes(faceIndex)). Border nodes are always enumerated first, so this function can be used to traverse all nodes or only nodes in the face boundary.
Returns: Returns the local cell node number.

Example:

-- Prints the global mesh index for all the nodes on the faces of cell 'c'
local g = c:geometry()
for faceIndex = 1, g:numFaces() do
for i = 1, g:numFaceNodes(faceIndex) do
local localIndex = g:faceNode(faceIndex, i)
local globalIndex = c:nodeIndex(localIndex)
print(globalIndex)
end
end


geometry:numFaceEdges(faceIndex)
Description: Returns the number of edges in the given face.
Parameters: faceIndex - The face number (between 1 and geometry:numFaces()). See the Element types page for the face organization for each cell type.
Returns: Returns the number of edges in the face.

Example:

-- Returns the number of edges in the first face for the geometry type
local nfaceEdges = g:numFaceEdges(1)


geometry:faceEdge(faceIndex, i)
Description: Returns the edge index for the i'th edge belonging to the given face. For the "hex8" element on the image below, faceEdge(6, 1) returns 9, faceEdge(6, 2) returns 10 and so on, cycling the top face edges.
Parameters: faceIndex The cell face number (between 1 and geometry:numFaces()). See the Element types page for the face organization for each cell type.
elementWithFaceEdges.png
i The edge index inside the face (between 1 and geometry:numFaceEdges(faceIndex)).
Returns: Returns the edge number.

Example:

-- Prints the edge index for all the edges on the faces of cell 'c'
local g = c:geometry()
for faceIndex = 1, g:numFaces() do
for i = 1, g:numFaceEdges(faceIndex) do
print(g:faceEdge(faceIndex, i))
end
end


geometry:numFaceTypes()
Description: Returns the number of distinct faces types for this cell type. Usually, all element faces are of the same type (all faces of an hexahedron are quadrilaterals, and all faces of a tetrahedron are triangles), but that can be false for certain element types like a wedge, whose faces can be quadrilaterals or triangles.
Parameters: None.
Returns: Returns the number of face types for 3D elements, 1 for 2D elements and 0 for 1D elements.

Example:

local nfacetypes = g:numFaceTypes()


geometry:faceType(faceIndex)
Description: Returns the type ("quad" or "tri") of the given face as a string.
Parameters: faceIndex - The face number (between 1 and geometry:numFaces()). See the Element types page for the face organization for each cell type.
Returns: Returns the type of the given face as a string (either "quad" or "tri").

Example:

-- Prints the face type for all faces of a "wedge" element
local g = CellGeometry('wedge6')
for faceIndex = 1, g:numFaces() do
print(g:faceType(faceIndex)) -- Will print 'tri' for faces 1 and 5 and 'quad' for faces 2, 3 and 4
end


geometry:faceElement(faceIndex)
Description: Returns the type of the equivalent surface element (with 3D node coordinates) for a 3D element's face.
Parameters: faceIndex - The face number (between 1 and geometry:numFaces()). See the Element types page for the face organization for each cell type.
Returns: Returns the face type (as a string) or nil if the face has no valid equivalent type. This can happend, for example, for the "side faces" of an interface element. It also returns nil for line or surface elements.

Example:

-- Prints the equivalent element type type for all faces of a "wedge" element
local g = CellGeometry('wedge6')
for faceIndex = 1, g:numFaces() do
print(g:faceElement(faceIndex)) -- Will print 'tri3d3' for faces 1 and 5 and 'quad3d4' for faces 2, 3 and 4
end
local g = CellGeometry('wedge15')
for faceIndex = 1, g:numFaces() do
print(g:faceElement(faceIndex)) -- Will print 'tri3d6' for faces 1 and 5 and 'quad3d8' for faces 2, 3 and 4
end


geometry:faceElementNode(faceIndex, i)
Description: Returns the local cell index for the i'th node belonging to the given face, using the equivalent surface element type (as returned by geometry:faceElement(faceIndex)) node ordering. Keep in mind that the number of nodes follows the surface element type definition (usually equal to the original element's face number of nodes).
Parameters: faceIndex The face number (between 1 and geometry:numFaces()). See the Element types page for the face organization for each cell type.
i The node index inside the face's equivalent surface element (between 1 and CellGeometry(geometry:faceElement(faceIndex)):numNodes()).
Returns: Returns the local node number of the i'th face node, using the equivalent surface type node ordering. Raises an error if there is no equivalent surface element for the given face (geometry:faceElement(faceIndex) returns nil).

Example:

-- Print the set of local nodes for the equivalent quad3d8 element associated with an hex20 element's first face
local g = CellGeometry('hex20')
for i = 1, 8 do
print(g:faceElementNode(1, i))
end


geometry:faceLinearElement(faceIndex)
Description: Returns the type of the equivalent linear surface element (with 3D node coordinates) for a 3D element's face.
Parameters: faceIndex - The face number (between 1 and geometry:numFaces()). See the Element types page for the face organization for each cell type.
Returns: Returns the face linear type (as a string) or nil if the face has no valid equivalent type. This happends whenever a call to geometry:faceElement(faceIndex) returns nil itself, for example, for the "side faces" of an interface element. It also returns nil for line or surface elements.

Example:

-- Prints the equivalent linear element type type for all faces of a "wedge15" element
local g = CellGeometry('wedge15')
for faceIndex = 1, g:numFaces() do
print(g:faceLinearElement(faceIndex)) -- Will print 'tri3d3' for faces 1 and 5 and 'quad3d4' for faces 2, 3 and 4
end


Volume related methods

geometry:numVolumeInternalNodes()
Description: Returns the number of internal nodes for this volume cell type (returns 0 for 1D/2D cell types).
Parameters: None.
Returns: Returns the number of internal nodes in the volume.

Example:

local nintNodes = g:numVolumeInternalNodes()


geometry:volumeInternalNode(i)
Description: Returns the local cell index for the i'th internal node belonging to the volume.
Parameters: i - The node index (between 1 and geometry:numVolumeInternalNodes())
Returns: Returns the local cell node number.

Example:

-- Prints the global mesh index for all the volume internal nodes of cell 'c'
local g = c:geometry()
for i = 1, g:numVolumeInternalNodes() do
local localIndex = g:volumeInternalNode(i)
local globalIndex = c:nodeIndex(localIndex)
print(globalIndex)
end