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

Define a class representing a face of a tetra volume element. More...

#include <Mesh/DataStructures/volumeface.h>

Public Member Functions

 VolumeFace (Node &node0, Node &node1, Node &node2)
 
 ~VolumeFace ()
 
Attached< VolumeElement >::iterator attachedTetrasBegin ()
 
Attached< VolumeElement >::const_iterator attachedTetrasBegin () const
 
Attached< VolumeElement >::iterator attachedTetrasEnd ()
 
Attached< VolumeElement >::const_iterator attachedTetrasEnd () const
 
const Vector3dgetFaceNormal () const
 
NodegetNode (int index) const
 
VolumeFacegetOppositeFace () const
 
bool hasTetrasAttached () const
 
bool isAttachedTo (VolumeElement &elem) const
 
bool isDuplicate (const Node &node0, const Node &node1, const Node &node2) const
 
bool isDuplicate (long id0, long id1, long id2) const
 
bool isSurface () const
 
NodenodeAfter (const Node &node) const
 
NodenodeBefore (const Node &node) const
 
unsigned numTetrasAttached () const
 
void recalculateNormal ()
 
bool usesNode (const Node &node) const
 
bool usesNode (long id) const
 
Deprecated functions
const Vector3dGetFaceNormal () const
 
VolumeFaceGetOppositeFace () const
 
NodeGetNode (int index) const
 
bool IsAttachedTo (VolumeElement &elem) const
 
bool HasTetrasAttached () const
 
unsigned NumTetrasAttached () const
 
Attached< VolumeElement >::iterator AttachedTetrasBegin ()
 
Attached< VolumeElement >::iterator AttachedTetrasEnd ()
 
Attached< VolumeElement >::const_iterator AttachedTetrasBegin () const
 
Attached< VolumeElement >::const_iterator AttachedTetrasEnd () const
 
void RecalculateNormal ()
 
bool UsesNode (const Node &node) const
 
bool UsesNode (long id) const
 
NodeNodeBefore (const Node &node) const
 
NodeNodeAfter (const Node &node) const
 
bool IsSurface () const
 
bool IsDuplicate (const Node &node0, const Node &node1, const Node &node2) const
 
bool IsDuplicate (long id0, long id1, long id2) const
 

Static Public Member Functions

static void orderNodes (Node *&node0, Node *&node1, Node *&node2)
 

Detailed Description

This class is similar to a shell element, but it is only meant as an aid to processing volume elements. VolumeFace and ShellElement may be merged into a single class at some point in the future.

Constructor & Destructor Documentation

◆ VolumeFace()

VolumeFace ( Node node0,
Node node1,
Node node2 
)

The three nodes must not form a degenerate triangle, or else a division by zero error will be generated when trying to calculate the unit normal vector.

Note that while the nodes will be stored in the same order as specified, the node list might be rotated from the specified order. In other words, the three nodes may be stored as any one of the following three combinations:

  • node0, node1, node2
  • node1, node2, node0
  • node2, node0, node1

This is done for efficiency reasons when testing for a particular face.

◆ ~VolumeFace()

~VolumeFace ( )

If this face has an opposite pair, the destructor removes the connection between the two. It is the responsibility of the volume elements using this face to ensure that the face is not used by any other volume element before deciding to delete it.

Member Function Documentation

◆ attachedTetrasBegin() [1/2]

Attached< VolumeElement >::iterator attachedTetrasBegin ( )
inline

◆ AttachedTetrasBegin() [1/2]

Attached< VolumeElement >::iterator AttachedTetrasBegin ( )
inline

◆ attachedTetrasBegin() [2/2]

Attached< VolumeElement >::const_iterator attachedTetrasBegin ( ) const
inline

◆ AttachedTetrasBegin() [2/2]

Attached< VolumeElement >::const_iterator AttachedTetrasBegin ( ) const
inline

◆ attachedTetrasEnd() [1/2]

Attached< VolumeElement >::iterator attachedTetrasEnd ( )
inline

◆ AttachedTetrasEnd() [1/2]

Attached< VolumeElement >::iterator AttachedTetrasEnd ( )
inline

◆ attachedTetrasEnd() [2/2]

Attached< VolumeElement >::const_iterator attachedTetrasEnd ( ) const
inline

◆ AttachedTetrasEnd() [2/2]

Attached< VolumeElement >::const_iterator AttachedTetrasEnd ( ) const
inline

◆ getFaceNormal()

const Vector3d & getFaceNormal ( ) const
inline

◆ GetFaceNormal()

const Vector3d & GetFaceNormal ( ) const
inline

◆ getNode()

Node & getNode ( int  index) const
inline

◆ GetNode()

Node & GetNode ( int  index) const
inline

◆ getOppositeFace()

VolumeFace * getOppositeFace ( ) const
inline

◆ GetOppositeFace()

VolumeFace * GetOppositeFace ( ) const
inline

◆ hasTetrasAttached()

bool hasTetrasAttached ( ) const
inline

◆ HasTetrasAttached()

bool HasTetrasAttached ( ) const
inline

◆ isAttachedTo()

bool isAttachedTo ( VolumeElement elem) const
inline

◆ IsAttachedTo()

bool IsAttachedTo ( VolumeElement elem) const
inline

◆ isDuplicate() [1/2]

bool isDuplicate ( const Node node0,
const Node node1,
const Node node2 
) const
inline

Test if this face is defined by the three specified nodes. Note that node order is important, as the opposite order is for a face with normal in the opposite direction and this function will return false in that case. Also note that the face must match the three nodes exactly, meaning that (node0, node1, node2) would return true but (node1, node2, node0) or (node2, node0, node1) would return false. In order to figure out which node should appear as node0, you could call OrderNodes first.

Returns
True if this face is a duplicate of the face formed by the three nodes.

◆ IsDuplicate() [1/2]

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

◆ isDuplicate() [2/2]

bool isDuplicate ( long  id0,
long  id1,
long  id2 
) const
inline

◆ IsDuplicate() [2/2]

bool IsDuplicate ( long  id0,
long  id1,
long  id2 
) const
inline

◆ isSurface()

bool isSurface ( ) const
inline
Returns
True if there is no opposing face.

◆ IsSurface()

bool IsSurface ( ) const
inline

◆ nodeAfter()

Node * nodeAfter ( const Node node) const
inline
Returns
A pointer to the next node according to the storage order for this face, or a null pointer if node is not part of this face.

◆ NodeAfter()

Node * NodeAfter ( const Node node) const
inline

◆ nodeBefore()

Node * nodeBefore ( const Node node) const
inline
Returns
A pointer to the previous node according to the storage order for this face, or a null pointer if node is not part of this face.

◆ NodeBefore()

Node * NodeBefore ( const Node node) const
inline

◆ numTetrasAttached()

unsigned numTetrasAttached ( ) const
inline

◆ NumTetrasAttached()

unsigned NumTetrasAttached ( ) const
inline

◆ orderNodes()

void orderNodes ( Node *&  node0,
Node *&  node1,
Node *&  node2 
)
static

This function will rotate the three nodes to the specific order that would be stored by a face using these three nodes. Note that the relative order will be maintained, so the specific order is fully defined by the first node at exit (for a given first node, there can be only one combination of three ordered nodes that preserve the original relative order).

This function would typically be used by a client wanting to test whether a particular face existed. A specific storage order is used to reduce the number of tests that would be necessary to determine this.

◆ recalculateNormal()

void recalculateNormal ( )

Recalculate the normal vector for this face. This should be called after any of the nodes the face uses is shifted, but is not necessary when the face is created since the constructor calculates the normal during face creation.

◆ RecalculateNormal()

void RecalculateNormal ( )
inline

◆ usesNode() [1/2]

bool usesNode ( const Node node) const
inline
Returns
True if this face 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