30 void Foam::edgeFaceCirculator::setEnd()
37 void Foam::edgeFaceCirculator::setFace
45 if (!isBoundaryEdge_ && !mesh_.isInternalFace(faceI))
49 "edgeFaceCirculator::setFace(const label, const label)"
50 ) <<
"Edge is not defined as boundary edge but still walked to"
51 <<
" boundary face:" << faceI <<
" on cell:" << cellI
59 const face&
f = mesh_.faces()[faceLabel_];
61 label
v1 = f.nextLabel(index_);
63 const cell& cFaces = mesh_.cells()[cellI];
67 label faceB = cFaces[i];
69 if (faceB != faceLabel_)
71 label fp = getMinIndex(mesh_.faces()[faceB], v0,
v1);
76 setFace(faceB, cellI);
82 FatalErrorIn(
"edgeFaceCirculator::otherFace(const label)")
83 <<
"Could not find next face stepping"
84 <<
" through cell along edge." <<
endl
85 <<
"face:" << faceLabel_ <<
" index in face:" << index_
86 <<
" edge:" << mesh_.points()[v0] << mesh_.points()[
v1]
97 const label faceLabel,
100 const bool isBoundaryEdge
104 faceLabel_(faceLabel),
105 ownerSide_(ownerSide),
107 isBoundaryEdge_(isBoundaryEdge),
108 startFaceLabel_(faceLabel_)
116 faceLabel_(circ.faceLabel_),
117 ownerSide_(circ.ownerSide_),
119 isBoundaryEdge_(circ.isBoundaryEdge_),
120 startFaceLabel_(circ.startFaceLabel_)
147 if (f[fpPlus1] != v1)
179 return mesh_.faceOwner()[faceLabel_];
181 else if (mesh_.isInternalFace(faceLabel_))
183 return mesh_.faceNeighbour()[faceLabel_];
194 const face& f = mesh_.faces()[faceLabel_];
196 label fp = getMinIndex(f, v0, v1);
202 "edgeFaceCirculator::sameOrder(const label, const label) const"
203 ) <<
"v0:" << v1 <<
" and v1:" << v1
204 <<
" not on position:" << index_ <<
" on face:" << faceLabel_
210 return ownerSide_ != (f[index_] == v0);
223 if (mesh_.isInternalFace(faceLabel_))
227 label cellI = mesh_.faceNeighbour()[faceLabel_];
230 ownerSide_ = (mesh_.faceOwner()[faceLabel_] == cellI);
234 label cellI = mesh_.faceOwner()[faceLabel_];
237 ownerSide_ = (mesh_.faceOwner()[faceLabel_] == cellI);
246 label cellI = mesh_.faceOwner()[faceLabel_];
249 ownerSide_ = (mesh_.faceOwner()[faceLabel_] == cellI);
256 const face& f = mesh_.faces()[faceLabel_];
258 FatalErrorIn(
"Foam::edgeFaceCirculator::setCanonical()")
259 <<
"Walked " << i <<
" cells around edge "
260 << mesh_.points()[f[index_]]
262 <<
" without reaching a boundary face."
263 <<
" Are you sure this is a boundary edge?"
270 startFaceLabel_ = faceLabel_;
275 label minFaceI = faceLabel_;
276 bool minOwnerSide = ownerSide_;
277 label minIndex = index_;
283 if (
operator==(end()))
288 if (!mesh_.isInternalFace(faceLabel_))
290 const face& f = mesh_.faces()[faceLabel_];
292 FatalErrorIn(
"Foam::edgeFaceCirculator::setCanonical()")
293 <<
"Reached boundary face " << faceLabel_
294 <<
" when walking around internal edge "
295 << mesh_.points()[f[index_]]
298 <<
"Are you sure this is an internal edge?"
302 if (faceLabel_ < minFaceI)
304 minFaceI = faceLabel_;
305 minOwnerSide = ownerSide_;
310 faceLabel_ = minFaceI;
311 ownerSide_ = minOwnerSide;
313 startFaceLabel_ = faceLabel_;
320 faceLabel_ = circ.faceLabel_;
321 ownerSide_ = circ.ownerSide_;
322 index_ = circ.index_;
323 isBoundaryEdge_ = circ.isBoundaryEdge_;
324 startFaceLabel_ = circ.startFaceLabel_;
330 return faceLabel_ == circ.faceLabel_ && index_ == circ.index_;
350 return !(*
this == circ);
357 if (faceLabel_ == -1)
360 <<
"Already reached end(). Cannot walk any further."
366 label cellI = mesh_.faceOwner()[faceLabel_];
369 ownerSide_ = (mesh_.faceOwner()[faceLabel_] != cellI);
372 if (!isBoundaryEdge_ && faceLabel_ == startFaceLabel_)
377 else if (mesh_.isInternalFace(faceLabel_))
380 label cellI = mesh_.faceNeighbour()[faceLabel_];
383 ownerSide_ = (mesh_.faceOwner()[faceLabel_] != cellI);
386 if (!isBoundaryEdge_ && faceLabel_ == startFaceLabel_)