Element, Face, Edge and Node Data
Overview
The ElementData class is designed to provide a sparse storage mechanism for scalar, vector, tensor (symmetric tensor) and general tensor data based at elements, element faces, element edges or element nodes. The data may be located at the element face and edge centroids or face and edge nodes. This feature makes the ElementData class useful for holding finite element load condition information such as uniform or varying distributed tractions and line loads. In addition, accurate element face normals may be computed and maintained for rendering purposes. The functions associated with a ElementData object are the following.
- Definition and options
define()- Define parent and child entitiesinquire()- Inquire parent and child entitiessetDoubleParameter()- Set floating point parameterssetIntegerParameter()- Set integer parameterssetPrecision()- Specify precision of element datagetPrecision()- Query precision of element datasetComplexMode()- Set mode for complex datagetComplexMode()- Get mode for complex datasetMeshInterface()- Set pointers to a MeshInterface objectgetMeshInterface()- Get pointers to a MeshInterface object
- Set, manipulate and compute data
setData()- Set element face or edge datagetData()- Get element data for an elementgetDataStatus()- Query data statushasComplexData()- Query for complex data existencegetListOfElementEntities()- Derive list of element entitiescomputeAccurateNodeFaceNormals()- Compute accurate element face normalsclear()- Clear any set element data
- General functions
getErrorCode()- Return the current error codeprint()- Print object informationcopy()- Copy an ElementData
Once a ElementData
object is instanced, the user may specify the precision used to maintain
the element data using setPrecision().
By default, element data is held in single precision. Define element
parent and child entity types and element size using define().
The function is also used to specify the data type (scalar, vector,
etc.) of the element data to be maintained by the ElementData
object. Use setData() to initially enter element data into a
ElementData object and clear()
to clear (unset) all element data.
Complex valued element data may be specified. The real and imaginary
parts of a complex value may be specified one at a time or together
depending upon the state of the complex mode of ElementData.
The user sets the complex mode using setComplexMode().
See section Complex Numbers
for a description of the general usage of complex valued data.
Use getData()
to query for element data at an element. The function getDataStatus()
may be used to query for the elements, element faces or element edges
that have had data set. The function computeAccurateNodeFaceNormals()
computes accurate element face normals for smooth shaded rendering. The
function getListOfElementEntities() can be used to derive an
IdTranslator
indicating the elements, element edges or faces for which data has been
set.
MeshInterface member
A ElementData class uses a MeshInterface member to access finite element data from the host application. The MeshInterface is required.
The ElementData object calls the following MeshInterface functions set in the MeshInterface member.
getCoordinates()getAdjacentElements()(Only incomputeAccurateNodeFaceNormals())getElementEntityConnectivity()getElementEntityConnectionNumbers()getElementNodes()getElementEntityCount()getElementEntityTopology()getMaxElementCountConnectedToNode()(Only incomputeAccurateNodeFaceNormals())getEntityCount()getTopology()
Class Members Descriptions
The currently available ElementData enumerations and functions are described in detail in this section.
-
class
ElementData Element Data management.
Public Types
-
enum class
GroupOperation Group Operation types.
Values:
-
enumerator
EDGES_WITH_DATA Edges at which data has been set.
-
enumerator
Public Functions
-
ErrorCode
getErrorCode() Return the current
ErrorCodeof the ElementData object.Returns: ErrorCode- The current error code, orNONEif no error.
-
Status
setPrecision(Precision precision) Specify the precision used to maintain element data. The function should be called before
define(). By default, element data are held in single precision.See Also
getPrecision()Parameters: precision – Precisionof dataReturns: Status
-
Status
getPrecision(Precision *precision) Get precision used to maintain element data.
See Also
setPrecision()Parameters: precision – [out] Precisionof dataReturns: Status
-
Status
setMeshInterface(MeshInterface *functions) Set a pointer to a MeshInterface member. All finite element topology, connectivity, node coordinate and node and element association queries are made through the MeshInterface member.
See Also
getMeshInterface()Parameters: functions – Pointer to the MeshInterface to be set. Returns: Status
-
Status
getMeshInterface(MeshInterfacePtr &functions) Get pointer to MeshInterface member.
See Also
setMeshInterface()Parameters: functions – [out] Pointer to the MeshInterface Returns: Status
-
Status
define(int entityCount, EntityType parentType, EntityType childType, DataLayout layout) Specify the number of elements and type of element parent and child entities and data type. If purely element, element face or element edge centroid data are to be managed, then childType should be set to
NONE.See Also
inquire()- Errors
Parameters: - entityCount – Number of elements
- parentType –
EntityTypeof element parent entity - childType –
EntityTypeof element child entity - layout –
DataLayouttype
Returns:
-
Status
inquire(int *entityCount, EntityType *parentType, EntityType *childType, DataLayout *layout) Inquire of defined entityCount, parentType, childType and dataType as output arguments.
See Also
define()Parameters: - entityCount – [out] Number of elements
- parentType – [out]
EntityTypeof parent entity - childType – [out]
EntityTypeof child entity - layout – [out]
DataLayouttype
Returns:
-
Status
setIntegerParameter(IntegerParameter parameter, int value) Set integer parameters.
The parameter
LINEARIZE_NORMALStoggles the method used for computation of element face normals at midside nodes using the functioncomputeAccurateNodeFaceNormals(). If this flag is disabled, midside node normals are normal to the element face at the location of the midside node. If this flag is enabled, midside node normals are computed using the corner node normals, the midside normals are linearly interpolated from the corner node normals. By defaultLINEARIZE_NORMALSis disabled.Parameters: - type –
IntegerParameter - value – Specifies the integer value that type will be set to.
Returns: - type –
-
Status
setDoubleParameter(DoubleParameter parameter, double value) Set floating point parameters. The parameter
FEATURE_ANGLEsets the feature angle used by the functioncomputeAccurateNodeFaceNormals(). By defaultFEATURE_ANGLEis set to 30 degrees.Parameters: - type –
DoubleParameter - value – Specifies the floating value that type will be set to.
Returns: - type –
-
Status
setComplexMode(ComplexMode mode) Set complex mode. By default the complex mode is
REAL. UsegetComplexMode()to query the complex mode.Parameters: mode – ComplexModeReturns: Status
-
Status
getComplexMode(ComplexMode *mode) Get complex mode for element data.
See Also
setComplexMode()Parameters: mode – [out] ComplexModemodeReturns: Status
-
Status
hasComplexData(int *flag) Query for complex data. The flag will be returned as one if the complex mode set by
setComplexMode()is everIMAGINARYorREAL_IMAGINARY, otherwise it is returned as zero.Parameters: flag – [out] Complex data existence flag Returns: Status
-
Status
setData(int index, int entityNumber, double data[]) Set element data, data, for a specified index and face or edge number entityNumber. If the parent type is
ELEMENTthen entityNumber is ignored. UsegetData()to retrieve data. If the object manages node or element centroid data, the array data contains 1, 3, 6 or 9 values corresponding to scalar, vector, tensor or general tensor data types. If element, element face or element edge node data is managed, data contains 1, 3, 6 or 9 values for each element, element face or element edge node.See Also
getData()- Errors
-
VALUEis generated if an improper index is specified. -
NULLOBJECTis generated if a MeshInterface attribute object has not been set. -
OPERATIONis generated if the the MeshInterface attribute object returns a total number of elements which does not match the number of elements declared indefine().
-
Parameters: - index – Element index
- entityNumber – Element face or edge number
- data – Array of element data to be set
Returns:
-
Status
getData(int index, int entityNumber, double data[]) Get element data, data, for element index at face or edge entityNumber. If the parent type is
ELEMENTthen entityNumber is ignored. If no data has been set zeroes are returned in data. UsesetData()to set element data.See Also
setData()Parameters: - index – Element index
- entityNumber – Element face or edge number
- data – [out] Array of returned element data
Returns:
-
Status
clear() Clear any defined element data. This function “unsets” all element face or edge data which has been set using
setData(). All memory used to store the data is freed.Returns: Status
-
Status
getDataStatus(int index, int entityNumber, int *status) Get data status for element index at face or edge entityNumber indicating which element entities have had data set. The data status will be 1 if the data for a given entity has been defined. If the parent type is element then entityNumber is ignored.
Parameters: - index – Element index
- entityNumber – Element face or edge number
- status – [out] Returned results data status
Returns:
-
Status
computeAccurateNodeFaceNormals(Group *group) Compute accurate element face normals for a set of element faces. Element face normals are determined by averaging normals at nodes contributed by connected element faces across element face edges. Normals are not averaged across an edge if the angles between element face normals of adjacent element faces exceed a specified feature angle. The feature angle is set using
setDoubleParameter().- Errors
-
VALUEis generated if group is not an element face group. -
NULLOBJECTis generated if the MeshInterface has not been set. -
OPERATIONis generated if the ElementData object is not defined for element face vectors.
-
Parameters: group – Pointer to Group object of element faces. If NULL, then all element faces are assumed. Returns: Status
-
Status
getListOfElementEntities(GroupOperation operation, IdTranslator *list) Derive an IdTranslator of element entities. The output list will be overwritten by this function. The entity type of the output IdTranslator will be set to
ELEMENT. ForELEMENTparent types the IdTranslator entity type and subtype will match the ElementData parent type and child type. ForFACEandEDGEparent types, the IdTranslator entity type will beELEMENTand the subtype will be the parent type.- Errors
-
NULLOBJECTis generated if the MeshInterface has not been set.
-
Parameters: - operation –
GroupOperation - list – [out] Pointer to derived IdTranslator object of element entities.
Returns:
-
Status
copy(ElementData *from) Copy element data from another ElementData.
Parameters: from – Pointer to the source ElementData to copy from. Returns: Status
-
Status
print() Print the ElementData object information to standard output.
Returns: Status
-
enum class