Public Member Functions | Static Public Member Functions | List of all members
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 &)
 Construct as copy. More...
 
label faceLabel () const
 
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 edgeFaceCirculatorend () const
 Iterator set to beyond the end of the walk. More...
 
const edgeFaceCirculatorcend () 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:

  1. Use in-place:
    // Optionally rotate to beginning: circ.setCanonical();
    // Walk
    do
    {
    Info<< "face:" << circ.face() << endl;
    ++circ;
    }
    while (circ != circ.end());
  2. Use like STL iterator:
    for
    (
    edgeFaceCirculator iter = circ.begin();
    iter != circ.end();
    ++iter
    )
    {
    Info<< "face:" << iter.face() << endl;
    }
Source files

Definition at line 86 of file edgeFaceCirculator.H.

Constructor & Destructor Documentation

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

Construct from components.

Definition at line 95 of file edgeFaceCirculatorI.H.

edgeFaceCirculator ( const edgeFaceCirculator circ)
inline

Construct as copy.

Construct copy.

Definition at line 113 of file edgeFaceCirculatorI.H.

References edgeFaceCirculator::getMinIndex().

Here is the call graph for this function:

Member Function Documentation

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 127 of file edgeFaceCirculatorI.H.

References UList< T >::fcIndex(), Foam::findIndex(), and UList< T >::rcIndex().

Referenced by edgeFaceCirculator::edgeFaceCirculator(), and edgeFaceCirculator::sameOrder().

Here is the call graph for this function:

Here is the caller graph for this function:

Foam::label faceLabel ( ) const
inline

Definition at line 157 of file edgeFaceCirculatorI.H.

bool ownerSide ( ) const
inline

Definition at line 163 of file edgeFaceCirculatorI.H.

Foam::label index ( ) const
inline

Definition at line 169 of file edgeFaceCirculatorI.H.

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 175 of file edgeFaceCirculatorI.H.

References primitiveMesh::faceNeighbour(), primitiveMesh::faceOwner(), and primitiveMesh::isInternalFace().

Here is the call graph for this function:

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 192 of file edgeFaceCirculatorI.H.

References Foam::abort(), primitiveMesh::faces(), Foam::FatalError, FatalErrorIn, and edgeFaceCirculator::getMinIndex().

Here is the call graph for this function:

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 214 of file edgeFaceCirculatorI.H.

References Foam::abort(), edgeFaceCirculator::end(), Foam::endl(), primitiveMesh::faceNeighbour(), primitiveMesh::faceOwner(), primitiveMesh::faces(), Foam::FatalError, FatalErrorIn, primitiveMesh::isInternalFace(), face::nextLabel(), edgeFaceCirculator::operator++(), and primitiveMesh::points().

Referenced by edgeFaceCirculator::begin(), and edgeFaceCirculator::cbegin().

Here is the call graph for this function:

Here is the caller graph for this function:

void operator= ( const edgeFaceCirculator iter)
inline

Definition at line 318 of file edgeFaceCirculatorI.H.

bool operator== ( const edgeFaceCirculator iter) const
inline

Definition at line 328 of file edgeFaceCirculatorI.H.

bool operator!= ( const edgeFaceCirculator iter) const
inline

Definition at line 348 of file edgeFaceCirculatorI.H.

Foam::edgeFaceCirculator & operator++ ( )
inline

Step to next face. Uses no edge addressing!

Step to next face.

Definition at line 356 of file edgeFaceCirculatorI.H.

References Foam::abort(), primitiveMesh::faceNeighbour(), primitiveMesh::faceOwner(), Foam::FatalError, FatalErrorIn, and primitiveMesh::isInternalFace().

Referenced by edgeFaceCirculator::setCanonical().

Here is the call graph for this function:

Here is the caller graph for this function:

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 402 of file edgeFaceCirculatorI.H.

References edgeFaceCirculator::setCanonical().

Here is the call graph for this function:

Foam::edgeFaceCirculator cbegin ( ) const
inline

Definition at line 421 of file edgeFaceCirculatorI.H.

References edgeFaceCirculator::setCanonical().

Here is the call graph for this function:

const Foam::edgeFaceCirculator & end ( ) const
inline

Iterator set to beyond the end of the walk.

Definition at line 440 of file edgeFaceCirculatorI.H.

Referenced by edgeFaceCirculator::setCanonical().

Here is the caller graph for this function:

const Foam::edgeFaceCirculator & cend ( ) const
inline

Definition at line 445 of file edgeFaceCirculatorI.H.


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