edgeFaceCirculator Class Reference

Walks from starting face around edge. More...

Public Member Functions

 edgeFaceCirculator (const primitiveMesh &mesh, const label faceLabel, const bool ownerSide, const label index, const bool isBoundaryEdge)
 Construct from components. More...
 
 edgeFaceCirculator (const edgeFaceCirculator &circ)
 Construct as copy. More...
 
label faceLabel () const
 Return the face label, -1 for end iterator. More...
 
bool isInternalFace () const
 Return true if the face label corresponds to an internal face. More...
 
bool ownerSide () const
 
label index () const
 
label cellLabel () const
 Helper: get the neighbouring cell according to the ownerSide. More...
 
bool sameOrder (const label v0, const label v1) const
 Helper: return true if normal of generated face points along. More...
 
void setCanonical ()
 Set edge to a unique state so different ones can be compared. More...
 
void operator= (const edgeFaceCirculator &iter)
 
bool operator== (const edgeFaceCirculator &iter) const
 
bool operator!= (const edgeFaceCirculator &iter) const
 
edgeFaceCirculatoroperator++ ()
 Step to next face. Uses no edge addressing! More...
 
edgeFaceCirculator begin () const
 Iterator set to the beginning face. For internal edges this is. More...
 
edgeFaceCirculator cbegin () const
 
const edgeFaceCirculator end () const
 Iterator set to beyond the end of the walk. More...
 
const edgeFaceCirculator cend () const
 

Static Public Member Functions

static label getMinIndex (const face &f, const label v0, const label v1)
 Helper: find index in face of edge or -1. Index is such that edge is. More...
 

Detailed Description

Walks from starting face around edge.

Implicit description of edge:

  • face
  • index in face. edge is always between f[index] and f[index+1]
  • direction (cell to walk into)
  1. Use in-place:
    // Optionally rotate to beginning: circ.setCanonical();
    // Walk
    do
    {
    Info<< "face:" << circ.face() << endl;
    ++circ;
    }
    while (circ != circ.end());
    Walks from starting face around edge.
    messageStream Info
    Information stream (stdout output on master, null elsewhere)
    Ostream & endl(Ostream &os)
    Add newline and flush stream.
    Definition: Ostream.H:372
  2. Use like STL iterator:
    for
    (
    edgeFaceCirculator iter = circ.begin();
    iter != circ.end();
    ++iter
    )
    {
    Info<< "face:" << iter.face() << endl;
    }
    edgeFaceCirculator begin() const
    Iterator set to the beginning face. For internal edges this is.
    const edgeFaceCirculator end() const
    Iterator set to beyond the end of the walk.
Source files

Definition at line 88 of file edgeFaceCirculator.H.

Constructor & Destructor Documentation

◆ edgeFaceCirculator() [1/2]

edgeFaceCirculator ( const primitiveMesh mesh,
const label  faceLabel,
const bool  ownerSide,
const label  index,
const bool  isBoundaryEdge 
)
inline

Construct from components.

Definition at line 111 of file edgeFaceCirculatorI.H.

◆ edgeFaceCirculator() [2/2]

edgeFaceCirculator ( const edgeFaceCirculator circ)
inline

Construct as copy.

Definition at line 129 of file edgeFaceCirculatorI.H.

Member Function Documentation

◆ getMinIndex()

Foam::label getMinIndex ( const face f,
const label  v0,
const label  v1 
)
inlinestatic

Helper: find index in face of edge or -1. Index is such that edge is.

between f[index] and f[index+1]

Definition at line 142 of file edgeFaceCirculatorI.H.

References f(), UList< T >::fcIndex(), UList< T >::find(), and UList< T >::rcIndex().

Here is the call graph for this function:

◆ faceLabel()

Foam::label faceLabel ( ) const
inline

Return the face label, -1 for end iterator.

Definition at line 173 of file edgeFaceCirculatorI.H.

◆ isInternalFace()

bool isInternalFace ( ) const
inline

Return true if the face label corresponds to an internal face.

Definition at line 179 of file edgeFaceCirculatorI.H.

◆ ownerSide()

bool ownerSide ( ) const
inline

Definition at line 190 of file edgeFaceCirculatorI.H.

◆ index()

Foam::label index ( ) const
inline

Definition at line 196 of file edgeFaceCirculatorI.H.

◆ cellLabel()

Foam::label cellLabel ( ) const
inline

Helper: get the neighbouring cell according to the ownerSide.

Returns -1 if on neighbourside of boundary face.

Definition at line 202 of file edgeFaceCirculatorI.H.

References polyMesh::faceNeighbour(), polyMesh::faceOwner(), and mesh.

Here is the call graph for this function:

◆ sameOrder()

bool sameOrder ( const label  v0,
const label  v1 
) const
inline

Helper: return true if normal of generated face points along.

edge from v0 to v1. (v0 and v1 have to be on edge)

Definition at line 217 of file edgeFaceCirculatorI.H.

References Foam::abort(), f(), polyMesh::faces(), Foam::FatalError, FatalErrorInFunction, and mesh.

Here is the call graph for this function:

◆ setCanonical()

void setCanonical ( )
inline

Set edge to a unique state so different ones can be compared.

Internal edge: minimum face index. Boundary edge: walk back until boundary face.

Definition at line 237 of file edgeFaceCirculatorI.H.

References Foam::abort(), Foam::endl(), f(), polyMesh::faceNeighbour(), polyMesh::faceOwner(), polyMesh::faces(), Foam::FatalError, FatalErrorInFunction, mesh, and polyMesh::points().

Referenced by edgeFaceCirculator::cbegin().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator=()

void operator= ( const edgeFaceCirculator iter)
inline

Definition at line 341 of file edgeFaceCirculatorI.H.

◆ operator==()

bool operator== ( const edgeFaceCirculator iter) const
inline

Definition at line 351 of file edgeFaceCirculatorI.H.

◆ operator!=()

bool operator!= ( const edgeFaceCirculator iter) const
inline

Definition at line 371 of file edgeFaceCirculatorI.H.

◆ operator++()

Foam::edgeFaceCirculator & operator++ ( )
inline

Step to next face. Uses no edge addressing!

Step to next face.

Definition at line 379 of file edgeFaceCirculatorI.H.

References Foam::abort(), polyMesh::faceNeighbour(), polyMesh::faceOwner(), Foam::FatalError, FatalErrorInFunction, and mesh.

Here is the call graph for this function:

◆ begin()

Foam::edgeFaceCirculator begin ( ) const
inline

Iterator set to the beginning face. For internal edges this is.

the current face. For boundary edges this is the first boundary face reached from walking back (i.e. in opposite direction to ++)

Definition at line 444 of file edgeFaceCirculatorI.H.

◆ cbegin()

Foam::edgeFaceCirculator cbegin ( ) const
inline

Definition at line 425 of file edgeFaceCirculatorI.H.

References edgeFaceCirculator::setCanonical().

Referenced by LList< LListBase, T >::begin(), LPtrList< LListBase, T >::begin(), and UILList< LListBase, T >::begin().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ end()

const Foam::edgeFaceCirculator end ( ) const
inline

Iterator set to beyond the end of the walk.

Definition at line 449 of file edgeFaceCirculatorI.H.

◆ cend()

const Foam::edgeFaceCirculator cend ( ) const
inline

Definition at line 454 of file edgeFaceCirculatorI.H.


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