![]() |
GeMA
The GeMA main application
|
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:
Index:
geometry:
type()
geometry:
family()
geometry:
order()
geometry:
isLine()
geometry:
isSurface()
geometry:
isSolid()
geometry:
isInterface()
geometry:
isHierarchical()
geometry:
linearElement()
geometry:
length()
geometry:
area()
geometry:
volume()
geometry:
characteristicLength()
geometry:
characteristicDimension()
geometry:
centroidCartesian()
geometry:
numNodes()
geometry:
numVertices()
geometry:
numExtraDofNodes()
geometry:
numCoord()
geometry:
numIncidenceNodes()
geometry:
incidenceNode()
geometry:
numEdges()
geometry:
numEdgeNodes()
geometry:
edgeNode()
geometry:
firstEdgeNode()
geometry:
lastEdgeNode()
geometry:
nodeOnEdge()
geometry:
edgeFromNodes()
geometry:
edgeElement()
geometry:
edgeElementNode()
geometry:
edgeLinearElement()
geometry:
numFaces()
geometry:
numFaceNodes()
geometry:
numFaceBoundaryNodes()
geometry:
faceNode()
geometry:
numFaceEdges()
geometry:
faceEdge()
geometry:
numFaceTypes()
geometry:
faceType()
geometry:
faceElement()
geometry:
faceElementNode()
geometry:
faceLinearElement()
geometry:
numVolumeInternalNodes()
geometry:
volumeInternalNode()
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:
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:
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:
geometry:order() | |
---|---|
Description: | Returns the cell interpolation order (1 = linear, 2 = quadratic, 3 = cubic, ...). |
Parameters: | None. |
Returns: | Returns the interpolation order. |
Example:
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:
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:
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:
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:
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:
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:
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:
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:
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:
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:
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:
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:
geometry:numNodes() | |
---|---|
Description: | Returns the number of nodes for this cell type. |
Parameters: | None. |
Returns: | Returns the number of nodes. |
Example:
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:
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:
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:
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:
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:
geometry:numEdges() | |
---|---|
Description: | Returns the number of edges for this cell type. |
Parameters: | None. |
Returns: | Returns the number of edges. |
Example:
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:
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. | ![]() |
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:
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:
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:
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:
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:
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:
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:
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:
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:
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:
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:
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. | ![]() |
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:
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:
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. | ![]() |
i | The edge index inside the face (between 1 and geometry: numFaceEdges(faceIndex) ). | ||
Returns: | Returns the edge number. |
Example:
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:
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:
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:
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:
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:
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:
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: