A triangular face using a FixedList of labels corresponding to mesh vertices. More...

Inheritance diagram for triFace:
Collaboration diagram for triFace:

Public Member Functions

 triFace ()
 Construct null. More...
 
 triFace (const label a, const label b, const label c)
 Construct from three point labels. More...
 
 triFace (const labelUList &)
 Construct from a list of labels. More...
 
 triFace (Istream &)
 Construct from Istream. More...
 
label collapse ()
 Collapse face by removing duplicate point labels. More...
 
void flip ()
 Flip the face in-place. More...
 
pointField points (const pointField &) const
 Return the points corresponding to this face. More...
 
face triFaceFace () const
 Return triangle as a face. More...
 
triPointRef tri (const pointField &) const
 Return the triangle. More...
 
point centre (const pointField &) const
 Return centre (centroid) More...
 
template<class Type >
Type average (const pointField &, const Field< Type > &) const
 Calculate average value at centroid of face. More...
 
scalar mag (const pointField &) const
 Magnitude of face area. More...
 
vector normal (const pointField &) const
 Vector normal; magnitude is equal to area of face. More...
 
label nTriangles () const
 Number of triangles after splitting. More...
 
triFace reverseFace () const
 Return face with reverse direction. More...
 
scalar sweptVol (const pointField &oldPoints, const pointField &newPoints) const
 Return swept-volume. More...
 
tensor inertia (const pointField &, const point &refPt=vector::zero, scalar density=1.0) const
 Return the inertia tensor, with optional reference. More...
 
pointHit ray (const point &p, const vector &q, const pointField &points, const intersection::algorithm=intersection::FULL_RAY, const intersection::direction dir=intersection::VECTOR) const
 Return point intersection with a ray starting at p,. More...
 
pointHit intersection (const point &p, const vector &q, const pointField &points, const intersection::algorithm alg, const scalar tol=0.0) const
 Fast intersection with a ray. More...
 
pointHit intersection (const point &p, const vector &q, const point &ctr, const pointField &points, const intersection::algorithm alg, const scalar tol=0.0) const
 
pointHit nearestPoint (const point &p, const pointField &points) const
 Return nearest point to face. More...
 
pointHit nearestPointClassify (const point &p, const pointField &points, label &nearType, label &nearLabel) const
 Return nearest point to face and classify it: More...
 
label nEdges () const
 Return number of edges. More...
 
edgeList edges () const
 Return edges in face point ordering,. More...
 
edge faceEdge (const label n) const
 Return n-th face edge. More...
 
int edgeDirection (const edge &) const
 Return the edge direction on the face. More...
 
- Public Member Functions inherited from FixedList< T, Size >
 FixedList ()
 Null constructor. More...
 
 FixedList (const T v[Size])
 Construct from C-array. More...
 
 FixedList (const T &)
 Construct from value. More...
 
 FixedList (const UList< T > &)
 Construct from UList. More...
 
 FixedList (const SLList< T > &)
 Construct from SLList. More...
 
 FixedList (const FixedList< T, Size > &)
 Copy constructor. More...
 
 FixedList (Istream &)
 Construct from Istream. More...
 
autoPtr< FixedList< T, Size > > clone () const
 Clone. More...
 
label fcIndex (const label i) const
 Return the forward circular index, i.e. the next index. More...
 
label rcIndex (const label i) const
 Return the reverse circular index, i.e. the previous index. More...
 
const Tcdata () const
 Return a const pointer to the first data element,. More...
 
Tdata ()
 Return a pointer to the first data element,. More...
 
Tfirst ()
 Return the first element of the list. More...
 
const Tfirst () const
 Return first element of the list. More...
 
Tlast ()
 Return the last element of the list. More...
 
const Tlast () const
 Return the last element of the list. More...
 
void checkStart (const label start) const
 Check start is within valid range (0 ... size-1). More...
 
void checkSize (const label size) const
 Check size is within valid range (0 ... size). More...
 
void checkIndex (const label i) const
 Check index i is within valid range (0 ... size-1). More...
 
void resize (const label)
 Dummy resize function. More...
 
void setSize (const label)
 Dummy setSize function. More...
 
void transfer (const FixedList< T, Size > &)
 Copy (not transfer) the argument contents. More...
 
void writeEntry (Ostream &) const
 Write the FixedList as a dictionary entry. More...
 
void writeEntry (const word &keyword, Ostream &) const
 Write the FixedList as a dictionary entry with keyword. More...
 
Toperator[] (const label)
 Return element of FixedList. More...
 
const Toperator[] (const label) const
 Return element of constant FixedList. More...
 
void operator= (const T v[Size])
 Assignment from array operator. Takes linear time. More...
 
void operator= (const UList< T > &)
 Assignment from UList operator. Takes linear time. More...
 
void operator= (const SLList< T > &)
 Assignment from SLList operator. Takes linear time. More...
 
void operator= (const T &)
 Assignment of all entries to the given value. More...
 
iterator begin ()
 Return an iterator to begin traversing the FixedList. More...
 
iterator end ()
 Return an iterator to end traversing the FixedList. More...
 
const_iterator cbegin () const
 Return const_iterator to begin traversing the constant FixedList. More...
 
const_iterator cend () const
 Return const_iterator to end traversing the constant FixedList. More...
 
const_iterator begin () const
 Return const_iterator to begin traversing the constant FixedList. More...
 
const_iterator end () const
 Return const_iterator to end traversing the constant FixedList. More...
 
reverse_iterator rbegin ()
 Return reverse_iterator to begin reverse traversing the FixedList. More...
 
reverse_iterator rend ()
 Return reverse_iterator to end reverse traversing the FixedList. More...
 
const_reverse_iterator crbegin () const
 Return const_reverse_iterator to begin reverse traversing FixedList. More...
 
const_reverse_iterator crend () const
 Return const_reverse_iterator to end reverse traversing FixedList. More...
 
const_reverse_iterator rbegin () const
 Return const_reverse_iterator to begin reverse traversing FixedList. More...
 
const_reverse_iterator rend () const
 Return const_reverse_iterator to end reverse traversing FixedList. More...
 
label size () const
 Return the number of elements in the FixedList. More...
 
label max_size () const
 Return size of the largest possible FixedList. More...
 
bool empty () const
 Return true if the FixedList is empty (ie, size() is zero). More...
 
void swap (FixedList< T, Size > &)
 Swap two FixedLists of the same type in constant time. More...
 
bool operator== (const FixedList< T, Size > &) const
 Equality operation on FixedLists of the same type. More...
 
bool operator!= (const FixedList< T, Size > &) const
 The opposite of the equality operation. Takes linear time. More...
 
bool operator< (const FixedList< T, Size > &) const
 Compare two FixedLists lexicographically. Takes linear time. More...
 
bool operator> (const FixedList< T, Size > &) const
 Compare two FixedLists lexicographically. Takes linear time. More...
 
bool operator<= (const FixedList< T, Size > &) const
 Return true if !(a > b). Takes linear time. More...
 
bool operator>= (const FixedList< T, Size > &) const
 Return true if !(a < b). Takes linear time. More...
 

Static Public Member Functions

static int compare (const triFace &, const triFace &)
 compare triFaces More...
 
- Static Public Member Functions inherited from FixedList< T, Size >
static const FixedList< T, Size > & null ()
 Return a null FixedList. More...
 

Friends

bool operator== (const triFace &, const triFace &)
 
bool operator!= (const triFace &, const triFace &)
 

Additional Inherited Members

- Public Types inherited from FixedList< T, Size >
typedef T value_type
 Type of values the FixedList contains. More...
 
typedef Treference
 Type that can be used for storing into. More...
 
typedef const Tconst_reference
 Type that can be used for storing into. More...
 
typedef label difference_type
 The type that can represent the difference between any two. More...
 
typedef label size_type
 The type that can represent the size of a FixedList. More...
 
typedef Titerator
 Random access iterator for traversing FixedList. More...
 
typedef const Tconst_iterator
 Random access iterator for traversing FixedList. More...
 
typedef Treverse_iterator
 Reverse iterator for reverse traversal of FixedList. More...
 
typedef const Tconst_reverse_iterator
 Reverse iterator for reverse traversal of constant FixedList. More...
 

Detailed Description

A triangular face using a FixedList of labels corresponding to mesh vertices.

See Also
Foam::face, Foam::triangle
Source files

Definition at line 69 of file triFace.H.

Constructor & Destructor Documentation

triFace ( )
inline

Construct null.

Definition at line 64 of file triFaceI.H.

triFace ( const label  a,
const label  b,
const label  c 
)
inline

Construct from three point labels.

Definition at line 69 of file triFaceI.H.

References Foam::constant::physicoChemical::b, and Foam::constant::universal::c.

triFace ( const labelUList lst)
inlineexplicit

Construct from a list of labels.

Definition at line 81 of file triFaceI.H.

triFace ( Istream is)
inline

Construct from Istream.

Definition at line 87 of file triFaceI.H.

Member Function Documentation

Foam::label collapse ( )
inline

Collapse face by removing duplicate point labels.

return the collapsed size, set collapsed point labels to -1

Definition at line 95 of file triFaceI.H.

References triFace::collapse(), and n.

Referenced by triFace::collapse().

Here is the call graph for this function:

Here is the caller graph for this function:

void flip ( )
inline

Flip the face in-place.

The starting points of the original and flipped face are identical.

Definition at line 122 of file triFaceI.H.

References triFace::flip(), and Foam::Swap().

Referenced by triFace::flip().

Here is the call graph for this function:

Here is the caller graph for this function:

Foam::pointField points ( const pointField points) const
inline

Return the points corresponding to this face.

Definition at line 128 of file triFaceI.H.

References p.

Foam::face triFaceFace ( ) const
inline

Return triangle as a face.

Definition at line 140 of file triFaceI.H.

References f(), and triFace::triFaceFace().

Referenced by triFace::triFaceFace().

Here is the call graph for this function:

Here is the caller graph for this function:

Foam::triPointRef tri ( const pointField points) const
inline

Return the triangle.

Definition at line 152 of file triFaceI.H.

References triFace::tri().

Referenced by triSurfaceTools::calcInterpolationWeights(), and triFace::tri().

Here is the call graph for this function:

Here is the caller graph for this function:

Foam::point centre ( const pointField points) const
inline

Return centre (centroid)

Definition at line 163 of file triFaceI.H.

References triFace::centre().

Referenced by triFace::centre().

Here is the call graph for this function:

Here is the caller graph for this function:

Type average ( const pointField meshPoints,
const Field< Type > &  fld 
) const

Calculate average value at centroid of face.

Definition at line 32 of file triFaceTemplates.C.

Foam::scalar mag ( const pointField points) const
inline

Magnitude of face area.

Definition at line 174 of file triFaceI.H.

References Foam::mag().

Here is the call graph for this function:

Foam::vector normal ( const pointField points) const
inline

Vector normal; magnitude is equal to area of face.

Definition at line 181 of file triFaceI.H.

References triFace::normal().

Referenced by wallBoundedParticle::isTriAlongTrack(), triFace::normal(), wallBoundedParticle::trackFaceTri(), and wallBoundedParticle::trackToEdge().

Here is the call graph for this function:

Here is the caller graph for this function:

Foam::label nTriangles ( ) const
inline

Number of triangles after splitting.

Definition at line 191 of file triFaceI.H.

References triFace::nTriangles().

Referenced by triFace::nTriangles().

Here is the call graph for this function:

Here is the caller graph for this function:

Foam::triFace reverseFace ( ) const
inline

Return face with reverse direction.

The starting points of the original and reverse face are identical.

Definition at line 197 of file triFaceI.H.

References triFace::reverseFace(), and triFace().

Referenced by triFace::reverseFace().

Here is the call graph for this function:

Here is the caller graph for this function:

Foam::scalar sweptVol ( const pointField oldPoints,
const pointField newPoints 
) const
inline

Return swept-volume.

Definition at line 205 of file triFaceI.H.

Foam::tensor inertia ( const pointField points,
const point refPt = vector::zero,
scalar  density = 1.0 
) const
inline

Return the inertia tensor, with optional reference.

point and density specification

Definition at line 238 of file triFaceI.H.

Foam::pointHit ray ( const point p,
const vector q,
const pointField points,
const intersection::algorithm  alg = intersection::FULL_RAY,
const intersection::direction  dir = intersection::VECTOR 
) const
inline

Return point intersection with a ray starting at p,.

with direction q.

Definition at line 250 of file triFaceI.H.

Foam::pointHit intersection ( const point p,
const vector q,
const pointField points,
const intersection::algorithm  alg,
const scalar  tol = 0.0 
) const
inline

Fast intersection with a ray.

Definition at line 264 of file triFaceI.H.

Foam::pointHit intersection ( const point p,
const vector q,
const point ctr,
const pointField points,
const intersection::algorithm  alg,
const scalar  tol = 0.0 
) const
inline

Definition at line 277 of file triFaceI.H.

Foam::pointHit nearestPoint ( const point p,
const pointField points 
) const
inline

Return nearest point to face.

Definition at line 291 of file triFaceI.H.

Foam::pointHit nearestPointClassify ( const point p,
const pointField points,
label &  nearType,
label &  nearLabel 
) const
inline

Return nearest point to face and classify it:

+ near point (nearType=POINT, nearLabel=0, 1, 2) + near edge (nearType=EDGE, nearLabel=0, 1, 2) Note: edges are counted from starting vertex so e.g. edge n is from f[n] to f[0], where the face has n + 1 points

Definition at line 301 of file triFaceI.H.

Foam::label nEdges ( ) const
inline

Return number of edges.

Definition at line 312 of file triFaceI.H.

References triFace::nEdges().

Referenced by triFace::nEdges().

Here is the call graph for this function:

Here is the caller graph for this function:

Foam::edgeList edges ( ) const
inline

Return edges in face point ordering,.

i.e. edges()[0] is edge between [0] and [1]

Definition at line 318 of file triFaceI.H.

References Foam::e.

Foam::edge faceEdge ( const label  n) const
inline

Return n-th face edge.

Definition at line 335 of file triFaceI.H.

References triFace::faceEdge().

Referenced by triFace::faceEdge().

Here is the call graph for this function:

Here is the caller graph for this function:

int edgeDirection ( const edge e) const
inline

Return the edge direction on the face.

Returns:

  • +1: forward (counter-clockwise) on the face
  • -1: reverse (clockwise) on the face
  • 0: edge not found on the face

Definition at line 345 of file triFaceI.H.

References triFace::edgeDirection(), edge::end(), and edge::start().

Referenced by triFace::edgeDirection().

Here is the call graph for this function:

Here is the caller graph for this function:

int compare ( const triFace a,
const triFace b 
)
inlinestatic

compare triFaces

Returns:

  • 0: different
  • +1: identical
  • -1: same face, but different orientation

Definition at line 33 of file triFaceI.H.

References triFace::compare().

Referenced by triFace::compare().

Here is the call graph for this function:

Here is the caller graph for this function:

Friends And Related Function Documentation

bool operator== ( const triFace ,
const triFace  
)
friend
bool operator!= ( const triFace ,
const triFace  
)
friend

The documentation for this class was generated from the following files: