39void Foam::edgeFaceCirculator::setEnd()
46void Foam::edgeFaceCirculator::setFace
54 if (!isBoundaryEdge_ && !
mesh().isInternalFace(facei))
57 <<
"Edge is not defined as boundary edge but still walked to"
58 <<
" boundary face:" << facei <<
" on cell:" << celli
64void Foam::edgeFaceCirculator::otherFace(
const label celli)
68 label v1 =
f.nextLabel(index_);
70 const cell& cFaces =
mesh().
cells()[celli];
74 label faceB = cFaces[i];
76 if (faceB != faceLabel_)
78 label fp = getMinIndex(
mesh().faces()[faceB], v0, v1);
83 setFace(faceB, celli);
90 <<
"Could not find next face stepping"
91 <<
" through cell along edge." <<
endl
92 <<
"face:" << faceLabel_ <<
" index in face:" << index_
104 isBoundaryEdge_(false),
114 const label faceLabel,
115 const bool ownerSide,
117 const bool isBoundaryEdge
121 ownerSide_(ownerSide),
122 isBoundaryEdge_(isBoundaryEdge),
123 faceLabel_(faceLabel),
125 startFaceLabel_(faceLabel_)
131 meshPtr_(circ.meshPtr_),
132 ownerSide_(circ.ownerSide_),
133 isBoundaryEdge_(circ.isBoundaryEdge_),
134 faceLabel_(circ.faceLabel_),
136 startFaceLabel_(circ.startFaceLabel_)
149 label fp =
f.
find(v0);
163 if (
f[fpPlus1] != v1)
185 && meshPtr_->isInternalFace(faceLabel_)
208 else if (
mesh().isInternalFace(faceLabel_))
221 label fp = getMinIndex(
f, v0, v1);
226 <<
"v0:" << v1 <<
" and v1:" << v1
227 <<
" not on position:" << index_ <<
" on face:" << faceLabel_
233 return ownerSide_ != (
f[index_] == v0);
246 if (
mesh().isInternalFace(faceLabel_))
282 <<
"Walked " << i <<
" cells around edge "
285 <<
" without reaching a boundary face."
286 <<
" Are you sure this is a boundary edge?"
293 startFaceLabel_ = faceLabel_;
298 label minFacei = faceLabel_;
299 bool minOwnerSide = ownerSide_;
300 label minIndex = index_;
306 if (
operator==(end()))
311 if (!
mesh().isInternalFace(faceLabel_))
316 <<
"Reached boundary face " << faceLabel_
317 <<
" when walking around internal edge "
321 <<
"Are you sure this is an internal edge?"
325 if (faceLabel_ < minFacei)
327 minFacei = faceLabel_;
328 minOwnerSide = ownerSide_;
333 faceLabel_ = minFacei;
334 ownerSide_ = minOwnerSide;
336 startFaceLabel_ = faceLabel_;
343 ownerSide_ = circ.ownerSide_;
344 isBoundaryEdge_ = circ.isBoundaryEdge_;
345 faceLabel_ = circ.faceLabel_;
346 index_ = circ.index_;
347 startFaceLabel_ = circ.startFaceLabel_;
353 return faceLabel_ == circ.faceLabel_ && index_ == circ.index_;
373 return !(*
this == circ);
381 if (faceLabel_ == -1)
384 <<
"Already reached end(). Cannot walk any further."
396 if (!isBoundaryEdge_ && faceLabel_ == startFaceLabel_)
401 else if (
mesh().isInternalFace(faceLabel_))
410 if (!isBoundaryEdge_ && faceLabel_ == startFaceLabel_)
label find(const T &val, label pos=0) const
Find index of the first occurrence of the value.
label rcIndex(const label i) const noexcept
label fcIndex(const label i) const noexcept
Walks from starting face around edge.
void operator=(const edgeFaceCirculator &iter)
edgeFaceCirculator & operator++()
Step to next face. Uses no edge addressing!
bool isInternalFace() const
Return true if the face label corresponds to an internal face.
bool sameOrder(const label v0, const label v1) const
Helper: return true if normal of generated face points along.
label faceLabel() const
Return the face label, -1 for end iterator.
const edgeFaceCirculator cend() const
label cellLabel() const
Helper: get the neighbouring cell according to the ownerSide.
void setCanonical()
Set edge to a unique state so different ones can be compared.
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.
edgeFaceCirculator cbegin() const
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.
A face is a list of labels corresponding to mesh vertices.
virtual const faceList & faces() const
Return raw faces.
virtual const labelList & faceOwner() const
Return face owner.
virtual const labelList & faceNeighbour() const
Return face neighbour.
virtual const pointField & points() const
Return raw points.
Cell-face mesh analysis engine.
const cellList & cells() const
friend bool operator!=(const refineCell &rc1, const refineCell &rc2)
friend bool operator==(const refineCell &rc1, const refineCell &rc2)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Ostream & endl(Ostream &os)
Add newline and flush stream.
errorManip< error > abort(error &err)
#define forAll(list, i)
Loop across all elements in list.