Version: 5.1.6

INTERP_KERNEL.TriangleFaceKey Class Reference

Class representing a triangular face, used as key in caching hash map in SplitterTetra. More...

#include <SplitterTetra.hxx>

Public Member Functions

 TriangleFaceKey (int node1, int node2, int node3)
 Constructor Sorts the given nodes (so that the order in which they are passed does not matter) and calculates a hash value for the key.
bool operator== (const TriangleFaceKey &key) const
 Equality comparison operator.
int hashVal () const
 Returns a hash value for the object, based on its three nodes.
void sort3Ints (int *sorted, int node1, int node2, int node3)
 Method to sort three integers in ascending order.

Private Attributes

int _nodes [3]
 global numbers of the three nodes, sorted in ascending order
int _hashVal
 hash value for the object, calculated in the constructor

Detailed Description

Class representing a triangular face, used as key in caching hash map in SplitterTetra.


Constructor & Destructor Documentation

INTERP_KERNEL.TriangleFaceKey.TriangleFaceKey ( int  node1,
int  node2,
int  node3 
)

Constructor Sorts the given nodes (so that the order in which they are passed does not matter) and calculates a hash value for the key.

Parameters:
node1 global number of the first node of the face
node2 global number of the second node of the face
node3 global number of the third node of the face

References INTERP_KERNEL.TriangleFaceKey._hashVal, INTERP_KERNEL.TriangleFaceKey._nodes, and INTERP_KERNEL.TriangleFaceKey.sort3Ints().


Member Function Documentation

bool INTERP_KERNEL.TriangleFaceKey.operator== ( const TriangleFaceKey key  )  const

Equality comparison operator.

Compares this TriangleFaceKey object to another and determines if they represent the same face.

Parameters:
key TriangleFaceKey with which to compare
Returns:
true if key has the same three nodes as this object, false if not

References INTERP_KERNEL.TriangleFaceKey._nodes.

int INTERP_KERNEL.TriangleFaceKey.hashVal (  )  const

Returns a hash value for the object, based on its three nodes.

This value is not unique for each face.

Returns:
a hash value for the object

References INTERP_KERNEL.TriangleFaceKey._hashVal.

void INTERP_KERNEL.TriangleFaceKey::sort3Ints ( int sorted,
int  x1,
int  x2,
int  x3 
)

Method to sort three integers in ascending order.

Parameters:
sorted int[3] array in which to store the result
x1 first integer
x2 second integer
x3 third integer

Field Documentation

global numbers of the three nodes, sorted in ascending order

hash value for the object, calculated in the constructor