Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
edgeFaceCirculator Class Reference

Walks from starting face around edge. More...

Collaboration diagram for edgeFaceCirculator:
Collaboration graph
[legend]

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...
 

Private Member Functions

void setEnd ()
 Set to end() iterator. More...
 
void setFace (const label faceI, const label cellI)
 Check and set faceLabel_ and ownerSide_. More...
 
void otherFace (const label cellI)
 Set faceLabel_ to be the other face on the cell that uses the. More...
 

Private Attributes

const primitiveMeshmesh_
 Mesh. More...
 
label faceLabel_
 Current face. More...
 
bool ownerSide_
 Current side of face. More...
 
label index_
 Edge (between index and index+1 on faces[faceLabel_]. More...
 
bool isBoundaryEdge_
 Is boundary edge? More...
 
label startFaceLabel_
 Starting face so we know when to stop. Used when circulating over. More...
 

Static Private Attributes

static const edgeFaceCirculator endConstIter
 End iterator. 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() [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 93 of file edgeFaceCirculatorI.H.

◆ edgeFaceCirculator() [2/2]

edgeFaceCirculator ( const edgeFaceCirculator circ)
inline

Construct as copy.

Construct copy.

Definition at line 111 of file edgeFaceCirculatorI.H.

Member Function Documentation

◆ setEnd()

void setEnd ( )
inlineprivate

Set to end() iterator.

Definition at line 30 of file edgeFaceCirculatorI.H.

References edgeFaceCirculator::faceLabel_, and edgeFaceCirculator::index_.

◆ setFace()

void setFace ( const label  faceI,
const label  cellI 
)
inlineprivate

Check and set faceLabel_ and ownerSide_.

Definition at line 38 of file edgeFaceCirculatorI.H.

References Foam::abort(), Foam::FatalError, and FatalErrorInFunction.

Here is the call graph for this function:

◆ otherFace()

void otherFace ( const label  cellI)
inlineprivate

Set faceLabel_ to be the other face on the cell that uses the.

edge.

Definition at line 55 of file edgeFaceCirculatorI.H.

References Foam::abort(), Foam::endl(), f(), Foam::FatalError, FatalErrorInFunction, and forAll.

Here is the call graph for this function:

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

References f(), and Foam::findIndex().

Here is the call graph for this function:

◆ faceLabel()

Foam::label faceLabel ( ) const
inline

Definition at line 155 of file edgeFaceCirculatorI.H.

◆ ownerSide()

bool ownerSide ( ) const
inline

Definition at line 161 of file edgeFaceCirculatorI.H.

◆ index()

Foam::label index ( ) const
inline

Definition at line 167 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 173 of file edgeFaceCirculatorI.H.

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

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

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

References Foam::abort(), Foam::endl(), f(), Foam::FatalError, FatalErrorInFunction, and Foam::meshTools::otherFace().

Referenced by edgeFaceCirculator::begin(), and 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

◆ operator==()

bool operator== ( const edgeFaceCirculator iter) const
inline

◆ operator!=()

bool operator!= ( const edgeFaceCirculator iter) const
inline

Definition at line 344 of file edgeFaceCirculatorI.H.

◆ operator++()

Foam::edgeFaceCirculator & operator++ ( )
inline

Step to next face. Uses no edge addressing!

Step to next face.

Definition at line 352 of file edgeFaceCirculatorI.H.

References Foam::abort(), Foam::FatalError, FatalErrorInFunction, and Foam::meshTools::otherFace().

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

References edgeFaceCirculator::setCanonical().

Here is the call graph for this function:

◆ cbegin()

Foam::edgeFaceCirculator cbegin ( ) const
inline

Definition at line 417 of file edgeFaceCirculatorI.H.

References edgeFaceCirculator::setCanonical().

Here is the call graph for this function:

◆ end()

const Foam::edgeFaceCirculator & end ( ) const
inline

Iterator set to beyond the end of the walk.

Definition at line 436 of file edgeFaceCirculatorI.H.

◆ cend()

const Foam::edgeFaceCirculator & cend ( ) const
inline

Definition at line 441 of file edgeFaceCirculatorI.H.

Field Documentation

◆ endConstIter

const edgeFaceCirculator endConstIter
staticprivate

End iterator.

Definition at line 91 of file edgeFaceCirculator.H.

◆ mesh_

const primitiveMesh& mesh_
private

Mesh.

Definition at line 97 of file edgeFaceCirculator.H.

◆ faceLabel_

label faceLabel_
private

◆ ownerSide_

bool ownerSide_
private

Current side of face.

Definition at line 103 of file edgeFaceCirculator.H.

Referenced by edgeFaceCirculator::operator=().

◆ index_

label index_
private

Edge (between index and index+1 on faces[faceLabel_].

Definition at line 106 of file edgeFaceCirculator.H.

Referenced by edgeFaceCirculator::operator=(), edgeFaceCirculator::operator==(), and edgeFaceCirculator::setEnd().

◆ isBoundaryEdge_

bool isBoundaryEdge_
private

Is boundary edge?

Definition at line 109 of file edgeFaceCirculator.H.

Referenced by edgeFaceCirculator::operator=().

◆ startFaceLabel_

label startFaceLabel_
private

Starting face so we know when to stop. Used when circulating over.

internal edges.

Definition at line 113 of file edgeFaceCirculator.H.

Referenced by edgeFaceCirculator::operator=().


The documentation for this class was generated from the following files:
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:251
Foam::Info
messageStream Info
Foam::edgeFaceCirculator::edgeFaceCirculator
edgeFaceCirculator(const primitiveMesh &mesh, const label faceLabel, const bool ownerSide, const label index, const bool isBoundaryEdge)
Construct from components.
Definition: edgeFaceCirculatorI.H:93