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.

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.

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.

enum class IntegerParameter

Integer parameter types.

Values:

enumerator LINEARIZE_NORMALS

Linearize normals from corner nodes.

enum class DoubleParameter

Double precision parameter types.

Values:

enumerator FEATURE_ANGLE

Feature angle in degrees.

Public Functions

ErrorCode getErrorCode()

Return the current ErrorCode of the ElementData object.

Returns: ErrorCode - The current error code, or NONE if 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 Precision of data
Returns:Status
Status getPrecision(Precision *precision)

Get precision used to maintain element data.

See Also setPrecision()

Parameters:precision[out] Precision of data
Returns: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
  • VALUE is generated if entityCount is non positive.
  • ENUM is generated if an improper parentType and childType association or dataType is specified.

Parameters:
Returns:

Status

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] EntityType of parent entity
  • childType[out] EntityType of child entity
  • layout[out] DataLayout type
Returns:

Status

Status setIntegerParameter(IntegerParameter parameter, int value)

Set integer parameters.

The parameter LINEARIZE_NORMALS toggles the method used for computation of element face normals at midside nodes using the function computeAccurateNodeFaceNormals() . 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 default LINEARIZE_NORMALS is disabled.

Parameters:
  • type IntegerParameter
  • value – Specifies the integer value that type will be set to.
Returns:

Status

Status setDoubleParameter(DoubleParameter parameter, double value)

Set floating point parameters. The parameter FEATURE_ANGLE sets the feature angle used by the function computeAccurateNodeFaceNormals() . By default FEATURE_ANGLE is set to 30 degrees.

Parameters:
  • type DoubleParameter
  • value – Specifies the floating value that type will be set to.
Returns:

Status

Status setComplexMode(ComplexMode mode)

Set complex mode. By default the complex mode is REAL . Use getComplexMode() to query the complex mode.

Parameters:mode ComplexMode
Returns:Status
Status getComplexMode(ComplexMode *mode)

Get complex mode for element data.

See Also setComplexMode()

Parameters:mode[out] ComplexMode mode
Returns:Status
Status hasComplexData(int *flag)

Query for complex data. The flag will be returned as one if the complex mode set by setComplexMode() is ever IMAGINARY or REAL_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 ELEMENT then entityNumber is ignored. Use getData() 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
  • VALUE is generated if an improper index is specified.
  • NULLOBJECT is generated if a MeshInterface attribute object has not been set.
  • OPERATION is generated if the the MeshInterface attribute object returns a total number of elements which does not match the number of elements declared in define() .

Parameters:
  • index – Element index
  • entityNumber – Element face or edge number
  • data – Array of element data to be set
Returns:

Status

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 ELEMENT then entityNumber is ignored. If no data has been set zeroes are returned in data. Use setData() 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

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

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

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 . For ELEMENT parent types the IdTranslator entity type and subtype will match the ElementData parent type and child type. For FACE and EDGE parent types, the IdTranslator entity type will be ELEMENT and the subtype will be the parent type.

Errors

Parameters:
Returns:

Status

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