Rigid Body

Overview

This class manages rigid bodies. A rigid body may be defined by a set of elements, element faces or edges or an analytic surface. A set of nodes may be added. It is possible to omit the element entities or analytic surface, in which case the rigid body motion is defined over a set of nodes. The overall motion of the rigid body follows the motion of a single reference node.

The functions associated with a RigidBody object are the following.

Set basic entity types using define(). Either an element entity or analytic surface must be specified. Nodes may be added to the basic entity type. However it is entirely possible for the rigid body to contain only nodes by not specifying any element entities or an analytic surface.

If element entities are specified a GridFun object must be set as an attribute object using setMeshInterface() so that the RigidBody object can access finite element model information and verify element entity specifications. Element entities are specified using setElementEntity(). An analytic surface is specified using setAnalyticSurfaceId(). Node entities are added using setNode(). The rigid body reference node is defined using setReferenceNode().

Generate a face list of element face entities using getListOfFaces(). Generate an edge list of element edge entities using getListOfEdges(). Generate a node list of node entities using getListOfNodes().

A set of property types is supported for a rigid body. Specify integer valued properties using setPropertyIntegerValue(). Each property type is identified by a defined constant. The number of components associated with a property type is queried using getPropertyInformation(). A long descriptive name which is hard-wired to each property type may be queried using getPropertyName(). Finally, the property values themselves may be recovered using getPropertyIntegerValue(). The function getPropertyFlag() is used to determine how a property has been defined, if at all.

Class Members Descriptions

The currently available RigidBody enumerations and functions are described in detail in this section.

class RigidBody

Rigid body class for defining rigid body entities and constraints.

Public Types

enum class NodeType

Node constraint type.

Values:

enumerator TIE

Tied node (all DOFs constrained)

enumerator PIN

Pinned node (only translational DOFs constrained)

enum class PropertyFlag

Property definition flag.

Values:

enumerator UNDEFINED

Property not defined.

enumerator VALUE

Property defined as value.

enumerator CURVE

Property defined as curve.

enum class IntegerProperty

Rigid body property integer type identifiers.

Values:

enumerator PROPERTY_ID

Property ID for mass properties.

enum class DoubleProperty

Rigid body property double type identifiers.

Values:

enumerator ROTATION_AXIS

Rotation axis definition.

Public Functions

ErrorCode getErrorCode()

Return the current ErrorCode of the RigidBody object.

Returns: ErrorCode - The current error code, or NONE if no error.
Status define(EntityType entityType)

Set the basic entity types. The entity type may be an element, element edge or face or an analytic surface. Element entities are specified using setElementEntity() . Analytic surface entities are specified using setAnalyticSurfaceId() . Nodes may be added using setNode() .

See Also inquire()

Parameters:entityType EntityType
Returns:Status
Status inquire(EntityType *entityType)

Inquire of defined entityType as an output argument

See Also define()

Parameters:entityType[out] EntityType
Returns:Status
Status setMeshInterface(MeshInterface *functions)

Set a pointer to an attribute object (MeshInterface).

Parameters:functions – Pointer to the MeshInterface object to be set.
Returns:Status
Status setName(const char *name)

Set a name string. The name string can contain up to 81 characters including the terminating NULL. If the name is not specified it is returned as a single NULL character using getName() .

See Also getName()

Parameters:name – Name string
Returns:Status
Status getName(char name[])

Get name string

See Also setName()

Parameters:name[out] Name string
Returns:Status
Status setElementEntity(int elementIndex, int entityNumber)

Set element elementIndex and face or edge number, entityNumber. A face or edge number of zero indicates that the entire element is specified.

Errors
VALUE is generated if an improper elementIndex or entityNumber is specified.

Parameters:
  • elementIndex – Element index
  • entityNumber – Element edge or face number
Returns:

Status

Status isElementEntityDefined(int index, int *elementFlag, int *elementEntityBitFlag)

Return element edge or face flags given an element index. If the entity is defined the elementFlag argument is return as 1 otherwise 0.

Errors
VALUE is generated if an improper index is specified.

Parameters:
  • index – Element index
  • elementFlag[out] Element defined flag
  • elementEntityBitFlag[out] Element edge or face flags
Returns:

Status

Status setNode(int index, NodeType type)

Set node index and type.

Errors
VALUE is generated if an improper index is specified.

Parameters:
  • index – Node index
  • type NodeType
Returns:

Status

Status getNode(int index, NodeType *type)

Get node type. If the node entity type has been defined, the type will be returned. If it has not been defined, zero is returned.

Errors
VALUE is generated if an improper index is specified.

Parameters:
  • index – Node number
  • type[out] NodeType
Returns:

Status

Status hasRigidBodyEntitySpecified(int *flag)

Query if any element, node or analytic surface specifications of any type have been made. The return value, flag, will be zero only if no entity of any type have been specified.

Parameters:flag[out] Flag indicating if element, analytic or node specified
Returns:Status
Status setReferenceNode(int index)

Set reference node

See Also getReferenceNode()

Errors
VALUE is generated if an improper index is specified.

Parameters:index – Reference node index
Returns:Status
Status getReferenceNode(int *index)

Get reference node

See Also setReferenceNode()

Parameters:index[out] Reference node index
Returns:Status
Status setPropertyIntegerValue(IntegerProperty type, int value)

Set an integer valued property. Use getPropertyIntegerValue() to return integer valued properties.

Parameters:
Returns:

Status

Status setPropertyDoubleValue(DoubleProperty type, double *value)

Set a double valued property. Use getPropertyDoubleValue() to return double valued properties.

Parameters:
Returns:

Status

Status getPropertyFlag(IntegerProperty type, PropertyFlag *flag)

Query for an integer valued property definition. If a property value is not defined, UNDEFINED is returned, if the property has been defined by value then VALUE is returned.

Parameters:
Returns:

Status

Status getPropertyFlag(DoubleProperty type, PropertyFlag *flag)

Query for a real valued property definition. If a property value is not defined, UNDEFINED is returned, if the property has been defined by value then VALUE is returned.

Parameters:
Returns:

Status

Status getPropertyInformation(IntegerProperty type, int *componentCount)

Query for the number of components of a value associated with an integer property type.

Parameters:
Returns:

Status

Status getPropertyInformation(DoubleProperty type, int *componentCount)

Query for the number of components of a value associated with a real property type.

Parameters:
  • type DoubleProperty
  • componentCount[out] Number of components
Returns:

Status

Status getPropertyName(IntegerProperty type, char name[])

Query for the built-in name associated with an integer property type. The character string will not exceed 64 characters including the terminating NULL character.

Parameters:
Returns:

Status

Status getPropertyName(DoubleProperty type, char name[])

Query for the built-in name associated with a real property type. The character string will not exceed 64 characters including the terminating NULL character.

Parameters:
Returns:

Status

Status getPropertyDoubleValue(DoubleProperty type, double value[])

Return a defined double valued property. If the value has not been defined or the value type is not double, nothing is returned.

Parameters:
Returns:

Status

Status getPropertyIntegerValue(IntegerProperty type, int value[])

Return a defined integer valued property. If the value has not been defined or the value type is not integer, nothing is returned.

Parameters:
Returns:

Status

Status getListOfFaces(IdTranslator *idtranslator)

Derive a list of element faces which have been defined. Note that idtranslator is not cleared by this function, the derived element face entities are added to any existing element faces in the output idtranslator.

Parameters:idtranslator[out] Pointer to derived IdTranslator object of element faces.
Returns:Status
Status getListOfEdges(IdTranslator *idtranslator)

Derive a list of element edges which have been defined. Note that idtranslator is not cleared by this function, the derived element edge entities are added to any existing element edges in the output idtranslator.

Parameters:idtranslator[out] Pointer to derived IdTranslator object of element edges.
Returns:Status
Status getListOfNodes(NodeType type, IdTranslator *idtranslator)

Derive a list of nodes which have been defined with the specified type. Note that idtranslator is not cleared by this function, the derived node entities are added to any existing node in the output idtranslator.

Parameters:
Returns:

Status

Status setAnalyticSurfaceId(int id)

Set analytic surface id.

See Also getAnalyticSurfaceId()

Errors
VALUE is generated if an improper id is specified.

Parameters:id – Analytic surface index
Returns:Status
Status getAnalyticSurfaceId(int *id)

Inquire of analytic surface id as an output argument

See Also setAnalyticSurfaceId()

Parameters:id[out] Analytic surface index
Returns:Status