Workspace 6.21.5
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Element Class Referenceabstract

Defines a generic element class.

#include <Mesh/DataStructures/element.h>

Inheritance diagram for Element:
[legend]

Public Types

typedef std::vector< Node * > ElementNodes
 
- Public Types inherited from NumberedObject
enum  {
  flag0 , flag1 , flag2 , flag3 ,
  flag4 , flag5 , flag6 , flag7 ,
  flag8 , flag9 , flag10 , flag11 ,
  flag12 , flag13 , flag14 , flag15
}
 

Public Member Functions

virtual ~Element ()=default
 
virtual void attachElement ()=0
 
virtual void attachNodes ()=0
 
virtual void detachElement ()=0
 
Vector3d getCentroid () const
 
NodegetNode (int index) const
 
ElementNodesgetNodes ()
 
const ElementNodesgetNodes () const
 
NodenodeAfter (const Node &node) const
 
NodenodeBefore (const Node &node) const
 
unsigned numNodes () const
 
void setNode (int index, Node &n)
 
void setNodeStates (int index, const Vector3d &v)
 
void setNodeStates (int index, double v)
 
void setNodeStates (int index, int v)
 
bool usesNode (const Node &node) const
 
Deprecated functions
bool UsesNode (const Node &node) const
 
bool usesNode (long id) const
 
bool UsesNode (long id) const
 
const ElementNodesGetNodes () const
 
ElementNodesGetNodes ()
 
NodeGetNode (int index) const
 
void SetNode (int index, Node &n)
 
NodeNodeBefore (const Node &node) const
 
NodeNodeAfter (const Node &node) const
 
void setNodeFlags (unsigned flag, bool b=true)
 
void SetNodeFlags (unsigned flag, bool b=true)
 
void SetNodeStates (int index, double v)
 
void SetNodeStates (int index, const Vector3d &v)
 
Vector3d GetCentroid () const
 
- Public Member Functions inherited from Entity
long getCompID () const
 Get the ID of the component this entity belongs to.
 
void setCompID (long compID)
 
void SetCompID (long compID)
 
long GetCompID () const
 
- Public Member Functions inherited from NumberedObject
 NumberedObject (long ID)
 Create an object with the specified ID and all flags except isValid not set.
 
void clearFlag (unsigned flag)
 Clear flag. Do not use this to manipulate the isValid flag, since list managers are responsible for that.
 
void copyFlags (const NumberedObject &t)
 
long getID () const
 
long getIndex () const
 
bool isFlagSet (unsigned flag) const
 
bool isValid () const
 
void setFlag (unsigned flag, bool b=true)
 Set flag to b. Do not use this to manipulate the isValid flag, since list managers are responsible for that.
 
void setID (long ID)
 
void setIndex (long i)
 
void SetID (long ID)
 
long GetID () const
 
void SetIndex (long i)
 
long GetIndex () const
 
bool IsFlagSet (unsigned flag) const
 
void ClearFlag (unsigned flag)
 
void SetFlag (unsigned flag)
 
void setFlagTo (unsigned flag, bool b=true)
 
void SetFlagTo (unsigned flag, bool b=true)
 
bool IsValid () const
 
- Public Member Functions inherited from State
 State (unsigned stateSize, unsigned integerDataSize)
 
 ~State ()
 
void addToIntegerData (int index, long val)
 
void addToState (int index, const Vector3d &v)
 
void addToState (int index, double val)
 
void copyIntegerData (int index, const State &s)
 
void copyState (int index, const State &s)
 
void copyStateVector (int index, const State &s)
 
long getIntegerData (int index) const
 
double getState (int index) const
 
Vector3d getStateVector (int index) const
 
void setIntegerData (int index, long val)
 
void setState (int index, const Vector3d &v)
 
void setState (int index, double val)
 
void CopyIntegerData (int index, const State &s)
 
void AddToIntegerData (int index, long val)
 
void SetIntegerData (int index, long val)
 
long GetIntegerData (int index) const
 
void CopyStateVector (int index, const State &s)
 
void CopyState (int index, const State &s)
 
void AddToState (int index, const Vector3d &v)
 
void AddToState (int index, double val)
 
double GetState (int index) const
 
Vector3d GetStateVector (int index) const
 
void SetState (int index, double val)
 
void SetState (int index, const Vector3d &v)
 

Protected Member Functions

 Element (long IDnum, long compIDnum, unsigned stateSize=0, unsigned integerDataSize=0)
 
- Protected Member Functions inherited from Entity
 Entity (long id, long compID)
 

Protected Attributes

ElementNodes nodes_
 

Additional Inherited Members

Member Typedef Documentation

◆ ElementNodes

typedef std::vector<Node*> ElementNodes

Constructor & Destructor Documentation

◆ Element()

Element ( long  IDnum,
long  compIDnum,
unsigned  stateSize = 0,
unsigned  integerDataSize = 0 
)
protected
Parameters
IDnumThe ID of the element.
compIDnumThe component ID of the element.
stateSizeThe state size for the element's state.
integerDataSizeThe size of the integer data array for the element's state.

Constructs a null element with no nodes but with the state arrays of the specified sizes. Subclasses are responsible for setting the nodes.

◆ ~Element()

virtual ~Element ( )
virtualdefault

Member Function Documentation

◆ attachElement()

virtual void attachElement ( )
pure virtual

Implemented in Segment, ShellElement, and VolumeElement.

◆ attachNodes()

virtual void attachNodes ( )
pure virtual

Implemented in Segment, ShellElement, and VolumeElement.

◆ detachElement()

virtual void detachElement ( )
pure virtual

Implemented in Segment, ShellElement, and VolumeElement.

◆ getCentroid()

Vector3d getCentroid ( ) const
Returns
The geometric centroid of the element.

◆ GetCentroid()

Vector3d GetCentroid ( ) const
inline

◆ getNode()

Node & getNode ( int  index) const
inline
Returns
The index'th node of the element. No test is made to ensure the index is valid.
See also
numNodes()

◆ GetNode()

Node & GetNode ( int  index) const
inline

◆ getNodes() [1/2]

ElementNodes & getNodes ( )
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ GetNodes() [1/2]

ElementNodes & GetNodes ( )
inline

◆ getNodes() [2/2]

const ElementNodes & getNodes ( ) const
inline
Returns
The nodes used by the element.

◆ GetNodes() [2/2]

const ElementNodes & GetNodes ( ) const
inline

◆ nodeAfter()

Node * nodeAfter ( const Node node) const
Parameters
nodeLook for the node after this one in the node storage order.
Returns
A pointer to the next node according to the storage order for this element type, or a null pointer if node is not part of this element. For example, nodes of a shell element are stored in the clockwise direction around the element's edge when looking in the element normal direction.
See also
nodeBefore()

◆ NodeAfter()

Node * NodeAfter ( const Node node) const
inline

◆ nodeBefore()

Node * nodeBefore ( const Node node) const
Parameters
nodeLook for the node before this one in the node storage order.
Returns
A pointer to the previous node according to the storage order for this element type, or a null pointer if node is not part of this element. For example, nodes of a shell element are stored in the clockwise direction around the element's edge when looking in the element normal direction.
See also
nodeAfter()

◆ NodeBefore()

Node * NodeBefore ( const Node node) const
inline

◆ numNodes()

unsigned numNodes ( ) const
inline
Returns
The number of nodes used by the element.
See also
getNode()

◆ setNode()

void setNode ( int  index,
Node n 
)
inline
Parameters
indexThe index of the node to replace for the element.
nThe node to put at index.

This function replaces the node at the specified index. It cannot be used to set the node at an index that has not yet been assigned. It is generally only used by low-level algorithms that modify elements in-place, which should generally be avoided anyway.

◆ SetNode()

void SetNode ( int  index,
Node n 
)
inline

◆ setNodeFlags()

void setNodeFlags ( unsigned  flag,
bool  b = true 
)

◆ SetNodeFlags()

void SetNodeFlags ( unsigned  flag,
bool  b = true 
)
inline

◆ setNodeStates() [1/3]

void setNodeStates ( int  index,
const Vector3d v 
)
Parameters
indexThe node state index to be set.
vThe value to set for the vector state at the specified index.

For every node this element uses, set the vector state index to v.

◆ SetNodeStates() [1/2]

void SetNodeStates ( int  index,
const Vector3d v 
)
inline

◆ setNodeStates() [2/3]

void setNodeStates ( int  index,
double  v 
)
Parameters
indexThe node state index to be set.
vThe value to set for the scalar state at the specified index.

For every node this element uses, set the scalar state index to v.

◆ SetNodeStates() [2/2]

void SetNodeStates ( int  index,
double  v 
)
inline

◆ setNodeStates() [3/3]

void setNodeStates ( int  index,
int  v 
)
Parameters
indexThe node state index to be set.
vThe value to set for the integer state at the specified index.

For every node this element uses, set the integer state index to v.

◆ usesNode() [1/2]

bool usesNode ( const Node node) const
Returns
True if this element uses node.

◆ UsesNode() [1/2]

bool UsesNode ( const Node node) const
inline

◆ usesNode() [2/2]

bool usesNode ( long  id) const

◆ UsesNode() [2/2]

bool UsesNode ( long  id) const
inline

Member Data Documentation

◆ nodes_

ElementNodes nodes_
protected