Mesh Interface
Overview
The MeshInterface class implements a query interface between Mesh objects and finite element data. Function pointers are used to query finite element model and results data. If a MeshInterface object interfaces to finite element data maintained by the host application, it is the responsibility of the user to implement the appropriate query functions. If a Mesh object maintains the finite element data, then the MeshInterface function pointers are set automatically.
The functions associated with a MeshInterface object are the following.
- Initialize and manage interface
initialize()- Initialize function pointerscopy()- Copy interface from another objectgetErrorCode()- Get error code
- Set and query function pointers
setFunction()- Set function pointergetFunction()- Get function pointersetFunctionError()- Set error handling function pointer
- Query mesh topology and counts
getEntityCount()- Get number of entities (nodes/elements)getTopology()- Get element topologygetMaxElementNodes()- Get maximum nodes in any elementgetElementNodeCount()- Get node count for an element
- Query element and node data
getElementNodes()- Get node indices for an elementgetCoordinates()- Get node coordinates
- Query element entities (faces/edges)
getElementEntityCount()- Get entity count in an elementgetElementEntityConnectivity()- Get entity node connectivitygetElementEntityConnectionNumbers()- Get entity connection numbersgetElementEntityCornerConnectionNumbers()- Get corner connection numbersgetElementEntityTopology()- Get entity topology
- Query associations (element/node/faces/edges)
getElementAssociation()- Get element associationsgetNodeAssociation()- Get node associationsgetElementEntityAssociation()- Get element entity association
- Query reverse connectivity
getMaxElementCountConnectedToNode()- Get maximum elements connected to nodegetElementsConnectedToNode()- Get get elements connected to a nodegetAdjacentElements()- Get elements adjacent to a given elementgetElementCountConnectedToNode()- Get number of elements connected to nodegetElementsAdjacentToNodes()- Get elements adjacent to nodes
- Query part data
getPartName()- Get part name stringgetPartNameCount()- Get number of partnamesgetPartInformation()- Get specific partname
- Miscellaneous
getExtent()- Get node coordinate extentgetDimension()- Get the spatial dimensiongetIntegrationPointCount()- Get number of element integration points
Initialize the interface using initialize().
This sets all function pointers to NULL. The query functions such as getEntityCount(),
getTopology(), and
getCoordinates() are used to retrieve mesh data.
These functions internally call the registered callback functions to access the data.
For interfaces to application-maintained data, the user must implement and register all necessary callback functions. If using a Mesh object to store data, the mesh automatically registers the appropriate callbacks.
Class Members Descriptions
The currently available MeshInterface functions are described in detail in this section.
-
class
MeshInterface Interface for accessing mesh data from external sources.
Public Types
-
enum class
Function Function type identifiers for mesh interface.
Values:
-
enumerator
GET_ENTITY_COUNT Get the number of entities (nodes/elements)
-
enumerator
GET_TOPOLOGY Get element topology information.
-
enumerator
GET_ELEMENT_NODES Get node indices for an element.
-
enumerator
GET_MAX_ELEMENT_NODES Get maximum number of nodes in any element.
-
enumerator
GET_COORDINATES Get node coordinates (float precision)
-
enumerator
GET_NODE_ASSOCIATION Get node association information.
-
enumerator
GET_ELEMENT_ASSOCIATION Get element association information.
-
enumerator
GET_ELEMENT_ENTITY_COUNT Get number of entities (faces/edges/nodes) in an element.
-
enumerator
GET_ELEMENT_ENTITY_CONNECTIVITY Get node connectivity for an element entity.
-
enumerator
GET_ELEMENT_ENTITY_TOPOLOGY Get topology of an element entity.
-
enumerator
GET_ADJACENT_ELEMENTS Get elements adjacent to a specified element.
-
enumerator
GET_MAX_ELEMENT_COUNT_CONNECTED_TO_NODE Get maximum number of elements connected to any node.
-
enumerator
GET_ELEMENTS_CONNECTED_TO_NODE Get elements connected to a node.
-
enumerator
GET_EXTENT Get spatial extent (float precision)
-
enumerator
GET_ELEMENT_ENTITY_CONNECTION_NUMBERS Get connection numbers for an element entity.
-
enumerator
GET_ELEMENTS_ADJACENT_TO_NODE Get elements adjacent to a set of nodes.
-
enumerator
GET_COORDINATES_DOUBLE_PRECISION Get node coordinates (double precision)
-
enumerator
SET_ERROR Set error handling function.
-
enumerator
GET_ELEMENT_NODE_COUNT Get number of nodes in an element.
-
enumerator
GET_ELEMENT_COUNT_CONNECTED_TO_NODE Get number of elements connected to a node.
-
enumerator
GET_ELEMENT_ENTITY_CORNER_CONNECTION_NUMBERS Get corner connection numbers for an element entity.
-
enumerator
GET_DIMENSION Get dimensionality of the model.
-
enumerator
GET_EXTENT_DOUBLE_PRECISION Get spatial extent (double precision)
-
enumerator
GET_ELEMENT_ENTITY_ASSOCIATION Get association for an element entity.
-
enumerator
GET_INTEGRATION_POINT_COUNT Get number of integration points in an element.
-
enumerator
GET_PARTNAME Get name of a part.
-
enumerator
GET_PARTNAME_COUNT Get number of named parts.
-
enumerator
GET_PART_INFORMATION Get part information by index.
-
enumerator
Public Functions
-
ErrorCode
getErrorCode() Return the current
ErrorCodeof the MeshInterface object.Returns: ErrorCode- The current error code, orNONEif no error.
-
Status
setFunction(Function functionType, Vfunc *function) Set pointer to grid function. The function descriptions are identical to the associated Mesh functions.
See Also
getFunction()Parameters: - functionType – Function type being set
- function – Pointer to grid function
Returns:
-
Status
getFunction(Function functionType, Vfunc **function) Get pointer to grid function.
See Also
setFunction()Parameters: - functionType –
Function - function – [out] Pointer to grid function
Returns: - functionType –
-
Status
copy(MeshInterface *from) Make a copy of a MeshInterface object. The private data from the from object is copied to this object. Any previous private data in this object is lost.
Parameters: from – MeshInterface object to copy from Returns: Status
-
Status
getEntityCount(EntityType type, int *count) Return the number of entities of the requested type.
See Also
getEntityCountParameters: - type –
EntityTypeEntity type (node or element) - count – [out] Number of entities of specified type
Returns: - type –
-
Status
getTopology(int index, int *shape, int *maxi, int *maxj, int *maxk) Get element topology for a specified element index.
See Also
getTopologyParameters: - index – Element index
- shape – [out] Element shape type
- maxi – [out] Maximum index in i-direction
- maxj – [out] Maximum index in j-direction
- maxk – [out] Maximum index in k-direction
Returns:
-
Status
getMaxElementNodes(int *max) Get the maximum number of nodes connected to any element.
See Also
getMaxElementNodesParameters: max – [out] Maximum number of nodes per element Returns: Status
-
Status
getElementNodes(int index, int *nodeCount, int nodeIndexes[]) Get the node indices connected to an element.
See Also
getElementNodesParameters: - index – Element index
- nodeCount – [out] Number of nodes in the element
- nodeIndexes – [out] Array of node indices
Returns:
-
Status
getCoordinates(int indexCount, int indexes[], float coordinates[][3]) Gather node coordinates for a set of nodes.
See Also
getCoordinatesParameters: - indexCount – Number of nodes
- indexes – Array of node indices
- coordinates – [out] Array of node coordinates [indexCount][3]
Returns:
-
Status
getCoordinates(int indexCount, int indexes[], double coordinates[][3]) Gather node coordinates in double precision.
See Also
getCoordinatesParameters: - indexCount – Number of nodes
- indexes – Array of node indices
- coordinates – [out] Array of node coordinates [indexCount][3]
Returns:
-
Status
getNodeAssociation(NodeAssociationType type, int indexCount, int indexes[], int associations[]) Get node associations, associations, for a set of specified nodes indexes.
See Also
getNodeAssociationParameters: - type –
NodeAssociationType - indexCount – Number of node indices to get associations
- indexes – Array of node indices
- associations – [out] Array of node associations
Returns: - type –
-
Status
getElementAssociation(ElementAssociationType type, int indexCount, int indexes[], int associations[]) Get element associations, associations, for a set of specified elements indexes.
See Also
getElementAssociationParameters: - type –
ElementAssociationType - indexCount – Number of element indices to get associations
- indexes – Array of element indices
- associations – [out] Array of element associations
Returns: - type –
-
Status
getMaxElementCountConnectedToNode(int *max) Get the maximum number of elements connected to any node. The number of elements connected to any node may only be queried after the node-element adjacency has been computed.
See Also
getMaxElementCountConnectedToNode- Errors
-
OPERATIONis generated if node-element adjacency has not been previously computed.
Parameters: max – [out] Maximum number of elements connected to any node Returns: Status
-
Status
getElementsConnectedToNode(int nodeIndex, int *elementCount, int elementIndexes[]) Get the element indices connected to a node. This function returns the number of elements and element indices. The number of elements connected to a node will never exceed the maximum number of elements connected to any node as returned by
getMaxElementCountConnectedToNode().See Also
getElementsConnectedToNodeParameters: - nodeIndex – Node index to get connected elements
- elementCount – [out] Number of elements connected to node
- elementIndexes – [out] Array of connected element indices
Returns:
-
Status
getAdjacentElements(EntityType entityType, int elementIndex, int entityNumber, int *elementCount, int elementIndexes[]) Get the element indices connected to a specified element. This function returns elements adjacent to (connected to) a specified element across an element face, edge or node. The type of element feature across which adjacent elements are requested is specified by entityType. The element is specified by elementIndex and the element face, edge or node is specified by entityNumber. The number of connected elements, elementCount, and the vector of connected elements, elementIndexes, do not contain the element elementIndex. The number of elements connected to a specified element will never exceed the maximum number of elements connected to any node as returned by
getMaxElementCountConnectedToNode().See Also
getAdjacentElementsParameters: Returns:
-
Status
getElementEntityCount(EntityType entityType, int index, int *count) Get the number of faces, edges or nodes in an element.
See Also
getElementEntityCountParameters: - entityType –
EntityType - index – Element index
- count – [out] Number of entities in the element
Returns: - entityType –
-
Status
getElementEntityConnectivity(EntityType entityType, int index, int entityNumber, int *nodeCount, int nodeIndexes[]) Get the node indices defining an entity on an element.
See Also
getElementEntityConnectivityParameters: - entityType –
EntityType - index – Element index
- entityNumber – Entity number on the element
- nodeCount – [out] Number of nodes defining the entity
- nodeIndexes – [out] Array of node indices
Returns: - entityType –
-
Status
getElementEntityConnectionNumbers(EntityType entityType, int index, int entityNumber, int *nodeCount, int connectionNumbers[]) Get the connection numbers for an entity on an element.
See Also
getElementEntityConnectionNumbersParameters: - entityType –
EntityType - index – Element index
- entityNumber – Entity number on the element
- nodeCount – [out] Number of connection numbers
- connectionNumbers – [out] Array of connection numbers
Returns: - entityType –
-
Status
getElementEntityTopology(EntityType entityType, int index, int entityNumber, int *shape, int *maxi, int *maxj) Get the topological shape of an entity on an element.
See Also
getElementEntityTopologyParameters: - entityType –
EntityType - index – Element index
- entityNumber – Entity number on the element
- shape – [out] Entity shape type
- maxi – [out] Maximum index in i-direction
- maxj – [out] Maximum index in j-direction
Returns: - entityType –
-
Status
getExtent(Group *group, float extent[2][3]) Return the coordinates of two points defining the world coordinate extent box of a set of nodes. The point extent[0] is the minimum and the point extent[1] is the maximum. If no node point coordinates have been specified, then the contents of extent are undefined.
See Also
getExtent- Errors
-
VALUEis generated if group is not a node group.
Parameters: - group – Pointer to Group object of nodes. If NULL, then all nodes are assumed.
- extent – [out] World coordinates of points at minimum x,y,z and maximum x,y,z.
Returns:
-
Status
getExtent(Group *group, double extent[2][3]) Return the coordinates of two points defining the world coordinate extent box of a set of nodes in double precision. The point extent[0] is the minimum and the point extent[1] is the maximum. If no node point coordinates have been specified, then the contents of extent are undefined.
See Also
getExtent()- Errors
-
VALUEis generated if group is not a node group.
Parameters: - group – Pointer to Group object of nodes. If NULL, then all nodes are assumed.
- extent – [out] World coordinates of points at minimum x,y,z and maximum x,y,z.
Returns:
-
Status
getElementNodeCount(int index, int *count) Get the number of nodes in an element.
See Also
getElementNodeCountParameters: - index – Element index
- count – [out] Number of nodes in the element
Returns:
-
Status
getElementCountConnectedToNode(int nodeIndex, int *count) Get the number of elements connected to a node. The number of elements connected to a node will never exceed the maximum number of elements connected to any node as returned by
getMaxElementCountConnectedToNode().See Also
getElementCountConnectedToNodeParameters: - nodeIndex – Node index to get connected element count
- count – [out] Number of elements connected to node
Returns:
-
Status
getElementsAdjacentToNodes(int nodeIndexCount, int nodeIndexes[], int *elementIndexCount, int elementIndexes[]) Get the element indices connected to a set of nodes. Each returned element will contain the complete set of input nodes in its node connectivity. The number of elements connected to a set of nodes will never exceed the maximum number of elements connected to any node as returned by
getMaxElementCountConnectedToNode().See Also
getElementsAdjacentToNodesParameters: - nodeIndexCount – Number of node indices
- nodeIndexes – Array of node indices
- elementIndexCount – [out] Number of elements connected to specified nodes
- elementIndexes – [out] Array of connected element indices
Returns:
-
Status
getElementEntityCornerConnectionNumbers(EntityType entityType, int index, int entityNumber, int *nodeCount, int connectionNumbers[]) Get the corner node connection numbers of a specified element face or edge. Node corner connection numbers specify positions of nodes in the element node connectivity list. The first position in the element node connectivity has a node connection number of 1.
See Also
getElementEntityCornerConnectionNumbersParameters: - entityType –
EntityType - index – Element index to get corner node connection numbers
- entityNumber – Element face or edge number
- nodeCount – [out] Number of corner nodes
- connectionNumbers – [out] Array of corner node connection numbers
Returns: - entityType –
-
Status
getDimension(int *count) Determine dimensionality of finite element model. If count = 2 the finite element model is a 2 dimensional model. This is used for 2D planar or 2D axisymmetric models. If count = 3 the finite element model is a full 3 dimensional model.
See Also
getDimensionParameters: count – [out] Number of spatial dimensions Returns: Status
-
Status
getElementEntityAssociation(ElementAssociationType type, EntityType entityType, int index, int entityNumber, int *association) Get element entity association, association, for a specified element edge or face. Element face and edge numbers are 1 based. If an element entity association has not been defined, zero is returned.
See Also
getElementEntityAssociationParameters: - type –
ElementAssociationType - entityType –
- index – Element index
- entityNumber – Element face or edge number
- association – [out] Element entity association
Returns: - type –
-
Status
getIntegrationPointCount(int index, int *count) Query for the number of element integration points at a specified element, index. If the number of element integration points at an element has not been set, then zero is returned.
See Also
getIntegrationPointCount- Errors
-
VALUEis generated if an improper element index is specified.
Parameters: - index – Element index
- count – [out] Number of element integration points
Returns:
-
Status
getPartName(int partId, char name[]) Get the name string associated with partId.
See Also
getPartNameCount(),getPartInformation()Parameters: - partId – Part identifier
- name – [out] Name string
Returns:
-
Status
getPartNameCount(int *count) Get the number of part names defined. Use
getPartInformation()to get a specific part name and associated part identifier.See Also
getPartName(),getPartInformation()Parameters: count – [out] Number of part names Returns: Status
-
Status
getPartInformation(int index, int *partId, char name[]) Get a specific part name and the associated part identifier. Use
getPartNameCount()to get the number of part names.See Also
getPartName(),getPartNameCount()Parameters: - index – Index of part name, 1 <= index <= count
- partId – [out] Part identifier
- name – [out] Name string
Returns:
-
Status
setFunctionError(UnaryIntFunction *function) Set user error function.
Parameters: function – Pointer to error handling function Returns: Status
-
Status
setFunctionGetEntityCount(GetEntityCountFunction *function) Set the function pointer for querying entity counts.
See Also
getEntityCount()Parameters: function – Pointer to entity count function Returns: Status
-
Status
setFunctionGetTopology(GetTopologyFunction *function) Set the function pointer for querying element topology.
See Also
getTopology()Parameters: function – Pointer to topology function Returns: Status
-
Status
setFunctionGetMaxElementNodes(GetMaxElementNodesFunction *function) Set the function pointer for querying the maximum number of nodes connected to any element.
See Also
getMaxElementNodes()Parameters: function – Pointer to max element nodes function Returns: Status
-
Status
setFunctionGetElementNodes(GetElementNodesFunction *function) Set the function pointer for querying the node indices connected to an element.
See Also
getElementNodes()Parameters: function – Pointer to element nodes function Returns: Status
-
Status
setFunctionGetCoordinatesFloat(GetCoordinatesFloatFunction *function) Set the function pointer for gathering node coordinates in single precision.
See Also
getCoordinates()Parameters: function – Pointer to float coordinates function Returns: Status
-
Status
setFunctionGetCoordinatesDouble(GetCoordinatesDoubleFunction *function) Set the function pointer for gathering node coordinates in double precision.
See Also
getCoordinates()Parameters: function – Pointer to double coordinates function Returns: Status
-
Status
setFunctionGetNodeAssociation(GetNodeAssociationFunction *function) Set the function pointer for querying node associations.
See Also
getNodeAssociation()Parameters: function – Pointer to node association function Returns: Status
-
Status
setFunctionGetElementAssociation(GetElementAssociationFunction *function) Set the function pointer for querying element associations.
See Also
getElementAssociation()Parameters: function – Pointer to element association function Returns: Status
-
Status
setFunctionGetMaxElementCountConnectedToNode(GetMaxElementCountConnectedToNodeFunction *function) Set the function pointer for querying the maximum number of elements connected to any node.
See Also
getMaxElementCountConnectedToNode()Parameters: function – Pointer to max node-element count function Returns: Status
-
Status
setFunctionGetElementsConnectedToNode(GetElementsConnectedToNodeFunction *function) Set the function pointer for querying the elements connected to a node.
See Also
getElementsConnectedToNode()Parameters: function – Pointer to node-element connectivity function Returns: Status
-
Status
setFunctionGetAdjacentElements(GetAdjacentElementsFunction *function) Set the function pointer for querying elements adjacent to a given element.
See Also
getAdjacentElements()Parameters: function – Pointer to element adjacency function Returns: Status
-
Status
setFunctionGetElementEntityCount(GetElementEntityCountFunction *function) Set the function pointer for querying the number of faces, edges or nodes in an element.
See Also
getElementEntityCount()Parameters: function – Pointer to element entity count function Returns: Status
-
Status
setFunctionGetElementEntityConnectivity(GetElementEntityConnectivityFunction *function) Set the function pointer for querying the node indices defining an entity on an element.
See Also
getElementEntityConnectivity()Parameters: function – Pointer to element entity connectivity function Returns: Status
-
Status
setFunctionGetElementEntityConnectionNumbers(GetElementEntityConnectionNumbersFunction *function) Set the function pointer for querying the connection numbers for an entity on an element.
See Also
getElementEntityConnectionNumbers()Parameters: function – Pointer to element entity connection numbers function Returns: Status
-
Status
setFunctionGetElementEntityTopology(GetElementEntityTopologyFunction *function) Set the function pointer for querying the topological shape of an entity on an element.
See Also
getElementEntityTopology()Parameters: function – Pointer to element entity topology function Returns: Status
-
Status
setFunctionGetExtentFloat(GetExtentFloatFunction *function) Set the function pointer for computing the node coordinate extent in single precision.
See Also
getExtent()Parameters: function – Pointer to float extent function Returns: Status
-
Status
setFunctionGetExtentDouble(GetExtentDoubleFunction *function) Set the function pointer for computing the node coordinate extent in double precision.
See Also
getExtent()Parameters: function – Pointer to double extent function Returns: Status
-
Status
setFunctionGetElementNodeCount(GetElementNodeCountFunction *function) Set the function pointer for querying the number of nodes in an element.
See Also
getElementNodeCount()Parameters: function – Pointer to element node count function Returns: Status
-
Status
setFunctionGetElementCountConnectedToNode(GetElementCountConnectedToNodeFunction *function) Set the function pointer for querying the number of elements connected to a node.
See Also
getElementCountConnectedToNode()Parameters: function – Pointer to node-element count function Returns: Status
-
Status
setFunctionGetElementsAdjacentToNodes(GetElementsAdjacentToNodesFunction *function) Set the function pointer for querying elements adjacent to a set of nodes.
See Also
getElementsAdjacentToNodes()Parameters: function – Pointer to node adjacency function Returns: Status
-
Status
setFunctionGetElementEntityCornerConnectionNumbers(GetElementEntityCornerConnectionNumbersFunction *function) Set the function pointer for querying the corner node connection numbers of an element entity.
See Also
getElementEntityCornerConnectionNumbers()Parameters: function – Pointer to element entity corner connection numbers function Returns: Status
-
Status
setFunctionGetDimension(GetDimensionFunction *function) Set the function pointer for determining the spatial dimensionality of the finite element model.
See Also
getDimension()Parameters: function – Pointer to dimension function Returns: Status
-
Status
setFunctionGetElementEntityAssociation(GetElementEntityAssociationFunction *function) Set the function pointer for querying element entity associations.
See Also
getElementEntityAssociation()Parameters: function – Pointer to element entity association function Returns: Status
-
Status
setFunctionGetIntegrationPointCount(GetIntegrationPointCountFunction *function) Set the function pointer for querying the number of element integration points.
See Also
getIntegrationPointCount()Parameters: function – Pointer to integration point count function Returns: Status
-
Status
setFunctionGetPartName(GetPartNameFunction *function) Set the function pointer for querying a part name string by part identifier.
See Also
getPartName()Parameters: function – Pointer to part name function Returns: Status
-
Status
setFunctionGetPartNameCount(GetPartNameCountFunction *function) Set the function pointer for querying the number of part names.
See Also
getPartNameCount()Parameters: function – Pointer to part name count function Returns: Status
-
Status
setFunctionGetPartInformation(GetPartInformationFunction *function) Set the function pointer for querying a specific part name and its associated part identifier by index.
See Also
getPartInformation()Parameters: function – Pointer to part information function Returns: Status
-
Status
setFunctionSetError(SetErrorFunction *function) Set the function pointer for reporting errors from within mesh interface callback functions.
See Also
setFunctionError()Parameters: function – Pointer to error reporting function Returns: Status
-
enum class