Workspace 6.21.5
Public Member Functions | List of all members
VolumeElement Class Reference

Defines a volume element class (ie a four-noded tetrahedral element). More...

#include <Mesh/DataStructures/volumeelement.h>

Inheritance diagram for VolumeElement:
[legend]

Public Member Functions

 VolumeElement (long IDnum, long compIDnum, Node &n0, Node &n1, Node &n2, Node &n3, unsigned stateSize=0, unsigned integerDataSize=0)
 
 ~VolumeElement () override
 
void attachElement () override
 
void attachNodes () override
 
void detachElement () override
 
VolumeFacegetFace (int i)
 
const VolumeFacegetFace (int i) const
 
bool isDuplicate (const Node &node0, const Node &node1, const Node &node2, const Node &node3) const
 
bool isDuplicate (const VolumeElement &elem) const
 
bool isInsideOut () const
 
bool isOnSurface () const
 
bool isOutsideElement (const Vector3d &p) const
 
void setFace (int i, VolumeFace &f)
 
double volumeTimes6 () const
 
Deprecated functions
const VolumeFaceGetFace (int i) const
 
VolumeFaceGetFace (int i)
 
void SetFace (int i, VolumeFace &f)
 
bool IsDuplicate (const Node &node0, const Node &node1, const Node &node2, const Node &node3) const
 
bool IsDuplicate (const VolumeElement &elem) const
 
double VolumeTimes6 () const
 
bool IsInsideOut () const
 
bool IsOutsideElement (const Vector3d &p) const
 
bool IsOnSurface () const
 
- Public Member Functions inherited from Element
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
 
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)
 

Additional Inherited Members

- Public Types inherited from Element
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
}
 
- Protected Member Functions inherited from Element
 Element (long IDnum, long compIDnum, unsigned stateSize=0, unsigned integerDataSize=0)
 
- Protected Member Functions inherited from Entity
 Entity (long id, long compID)
 
- Protected Attributes inherited from Element
ElementNodes nodes_
 

Detailed Description

The node ordering of a volume element is such that the face defined by nodes 0,1,2 has a normal vector pointing out of the element (ie the right-hand rule is used on that face).

Constructor & Destructor Documentation

◆ VolumeElement()

VolumeElement ( long  IDnum,
long  compIDnum,
Node n0,
Node n1,
Node n2,
Node n3,
unsigned  stateSize = 0,
unsigned  integerDataSize = 0 
)
Parameters
IDnumThe ID of the element.
compIDnumThe component ID of the element.
n0The element node to put at node index 0.
n1The element node to put at node index 1.
n2The element node to put at node index 2.
n3The element node to put at node index 3.
stateSizeThe size of the state array for the element.
integerDataSizeThe size of the integer state array for the element.

The constructor allows you to create an unmanaged volume element. This is something you would typically want to avoid doing, so only do this if you are forced to. You should normally allow a VolumeElementList to create a VolumeElement for your with its addVolumeElement() function.

The constructor does not try to attach it to its nodes. Specifically, it does not update the attached element lists for the nodes it uses. This is currently the responsibility of the caller. Attachment is usually managed by element lists.

The ordering of the nodes should be such that 012, 023, 031 and 321 all form faces whose normals point out of the element. Another way of thinking of it is that the normal vector of the face 012 should point away from point 3.

◆ ~VolumeElement()

~VolumeElement ( )
override

Member Function Documentation

◆ attachElement()

void attachElement ( )
overridevirtual

For each node in this element, attach the element to the node as long as the element is not marked for deletion. This function also takes care of creating the faces used by the element.

Implements Element.

◆ attachNodes()

void attachNodes ( )
overridevirtual

The element's nodes are not attached to each other by this function. This will probably change in the future, but since current code still relies on this, it has not been changed yet. The other two element types (Segment and ShellElement) do attach their nodes to each other.

Implements Element.

◆ detachElement()

void detachElement ( )
overridevirtual

For each node in this element, detach the element from the node. The function also detaches the element from the relevant faces.

Implements Element.

◆ getFace() [1/2]

VolumeFace * getFace ( int  i)
inline

◆ GetFace() [1/2]

VolumeFace * GetFace ( int  i)
inline

◆ getFace() [2/2]

const VolumeFace * getFace ( int  i) const
inline

◆ GetFace() [2/2]

const VolumeFace * GetFace ( int  i) const
inline

◆ isDuplicate() [1/2]

bool isDuplicate ( const Node node0,
const Node node1,
const Node node2,
const Node node3 
) const
inline
Returns
True if the element uses all four of the specified nodes.

◆ IsDuplicate() [1/2]

bool IsDuplicate ( const Node node0,
const Node node1,
const Node node2,
const Node node3 
) const
inline

◆ isDuplicate() [2/2]

bool isDuplicate ( const VolumeElement elem) const
inline
Returns
True if the element uses the same nodes (not necessarily in the same order or orientation) as elem.

◆ IsDuplicate() [2/2]

bool IsDuplicate ( const VolumeElement elem) const
inline

◆ isInsideOut()

bool isInsideOut ( ) const
inline
Returns
True if this tetra is defined such that it has negative volume.

◆ IsInsideOut()

bool IsInsideOut ( ) const
inline

◆ isOnSurface()

bool isOnSurface ( ) const
Returns
True if any face of the element is on the surface. Note that the surface is defined only by volume elements, so shell elements will not affect this function. A face is considered to be on the surface if no other face is directly opposing it.

◆ IsOnSurface()

bool IsOnSurface ( ) const
inline

◆ isOutsideElement()

bool isOutsideElement ( const Vector3d p) const
Returns
True if the point p is not inside the element.

◆ IsOutsideElement()

bool IsOutsideElement ( const Vector3d p) const
inline

◆ setFace()

void setFace ( int  i,
VolumeFace f 
)
inline

◆ SetFace()

void SetFace ( int  i,
VolumeFace f 
)
inline

◆ volumeTimes6()

double volumeTimes6 ( ) const
Returns
The volume of this tetrahedron, multiplied by 6 for efficiency reasons.

◆ VolumeTimes6()

double VolumeTimes6 ( ) const
inline