30 void Foam::edgeFaceCirculator::setEnd()
37 void Foam::edgeFaceCirculator::setFace
48 <<
"Edge is not defined as boundary edge but still walked to" 49 <<
" boundary face:" << facei <<
" on cell:" << celli
55 void Foam::edgeFaceCirculator::otherFace(
const label celli)
57 const face& f = mesh_.
faces()[faceLabel_];
59 label v1 = f.nextLabel(index_);
61 const cell& cFaces = mesh_.
cells()[celli];
65 label faceB = cFaces[i];
67 if (faceB != faceLabel_)
74 setFace(faceB, celli);
81 <<
"Could not find next face stepping" 82 <<
" through cell along edge." <<
endl 83 <<
"face:" << faceLabel_ <<
" index in face:" << index_
95 const label faceLabel,
98 const bool isBoundaryEdge
102 faceLabel_(faceLabel),
103 ownerSide_(ownerSide),
105 isBoundaryEdge_(isBoundaryEdge),
106 startFaceLabel_(faceLabel_)
114 faceLabel_(circ.faceLabel_),
115 ownerSide_(circ.ownerSide_),
117 isBoundaryEdge_(circ.isBoundaryEdge_),
118 startFaceLabel_(circ.startFaceLabel_)
145 if (f[fpPlus1] != v1)
192 const face& f = mesh_.
faces()[faceLabel_];
199 <<
"v0:" << v1 <<
" and v1:" << v1
200 <<
" not on position:" << index_ <<
" on face:" << faceLabel_
206 return ownerSide_ != (f[index_] == v0);
226 ownerSide_ = (mesh_.
faceOwner()[faceLabel_] == celli);
233 ownerSide_ = (mesh_.
faceOwner()[faceLabel_] == celli);
245 ownerSide_ = (mesh_.
faceOwner()[faceLabel_] == celli);
252 const face& f = mesh_.
faces()[faceLabel_];
255 <<
"Walked " << i <<
" cells around edge " 256 << mesh_.
points()[f[index_]]
258 <<
" without reaching a boundary face." 259 <<
" Are you sure this is a boundary edge?" 266 startFaceLabel_ = faceLabel_;
271 label minFacei = faceLabel_;
272 bool minOwnerSide = ownerSide_;
273 label minIndex = index_;
279 if (
operator==(
end()))
286 const face& f = mesh_.
faces()[faceLabel_];
289 <<
"Reached boundary face " << faceLabel_
290 <<
" when walking around internal edge " 291 << mesh_.
points()[f[index_]]
294 <<
"Are you sure this is an internal edge?" 298 if (faceLabel_ < minFacei)
300 minFacei = faceLabel_;
301 minOwnerSide = ownerSide_;
306 faceLabel_ = minFacei;
307 ownerSide_ = minOwnerSide;
309 startFaceLabel_ = faceLabel_;
316 faceLabel_ = circ.faceLabel_;
317 ownerSide_ = circ.ownerSide_;
318 index_ = circ.index_;
319 isBoundaryEdge_ = circ.isBoundaryEdge_;
320 startFaceLabel_ = circ.startFaceLabel_;
326 return faceLabel_ == circ.faceLabel_ && index_ == circ.index_;
346 return !(*
this == circ);
354 if (faceLabel_ == -1)
357 <<
"Already reached end(). Cannot walk any further." 366 ownerSide_ = (mesh_.
faceOwner()[faceLabel_] != celli);
369 if (!isBoundaryEdge_ && faceLabel_ == startFaceLabel_)
380 ownerSide_ = (mesh_.
faceOwner()[faceLabel_] != celli);
383 if (!isBoundaryEdge_ && faceLabel_ == startFaceLabel_)
#define forAll(list, i)
Loop across all elements in list.
FvWallInfoData< WallInfo, label > label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
A face is a list of labels corresponding to mesh vertices.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
label rcIndex(const label i) const
Return the reverse circular index, i.e. the previous index.
Cell-face mesh analysis engine.
label fcIndex(const label i) const
Return the forward circular index, i.e. the next index.
Ostream & endl(Ostream &os)
Add newline and flush stream.
label nextLabel(const label i) const
Next vertex on face.
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.
virtual const pointField & points() const =0
Return mesh points.
void operator=(const edgeFaceCirculator &iter)
const cellList & cells() const
label cellLabel() const
Helper: get the neighbouring cell according to the ownerSide.
bool sameOrder(const label v0, const label v1) const
Helper: return true if normal of generated face points along.
virtual const labelList & faceNeighbour() const =0
Face face-neighbour addressing.
errorManip< error > abort(error &err)
edgeFaceCirculator & operator++()
Step to next face. Uses no edge addressing!
bool isInternalFace(const label faceIndex) const
Return true if given face label is internal to the mesh.
edgeFaceCirculator begin() const
Iterator set to the beginning face. For internal edges this is.
label findIndex(const ListType &, typename ListType::const_reference, const label start=0)
Find first occurrence of given element and return index,.
bool operator!=(const edgeFaceCirculator &iter) const
edgeFaceCirculator(const primitiveMesh &mesh, const label faceLabel, const bool ownerSide, const label index, const bool isBoundaryEdge)
Construct from components.
virtual const faceList & faces() const =0
Return faces.
Walks from starting face around edge.
virtual const labelList & faceOwner() const =0
Face face-owner addressing.
void setCanonical()
Set edge to a unique state so different ones can be compared.
edgeFaceCirculator cbegin() const
bool operator==(const edgeFaceCirculator &iter) const
const edgeFaceCirculator & end() const
Iterator set to beyond the end of the walk.
const edgeFaceCirculator & cend() const