34 template<
class Type,
class TrackingData>
38 const label masterFaceLabel,
50 const face& masterFace = this->mesh_.faces()[masterFaceLabel];
52 oppositeFaceLabels.
clear();
54 for (
const label facei : this->mesh_.cells()[celli])
57 const face&
f = this->mesh_.faces()[facei];
62 facei != masterFaceLabel
63 && !
f.connected(masterFace)
77 template<
class Type,
class TrackingData>
102 label iter = this->
iterate(maxIter);
104 if ((maxIter > 0) && (iter >= maxIter))
107 <<
"Maximum number of iterations reached. Increase maxIter." 109 <<
" maxIter:" << maxIter <<
endl 119 template<
class Type,
class TrackingData>
122 const labelList& owner = this->mesh_.faceOwner();
123 const labelList& neighbour = this->mesh_.faceNeighbour();
124 label nInternalFaces = this->mesh_.nInternalFaces();
126 DynamicList<label> oppositeFaceLabels;
128 for (
const label facei : this->changedFaces_)
130 if (!this->changedFace_.test(facei))
134 <<
" not marked as having been changed" 139 const Type& neighbourWallInfo = this->allFaceInfo_[facei];
145 label celli = owner[facei];
146 Type& currentWallInfo = this->allCellInfo_[celli];
148 if (!currentWallInfo.equal(neighbourWallInfo, this->td_))
151 opposingFaceLabels(celli, facei, oppositeFaceLabels);
153 if (oppositeFaceLabels.size())
155 label sz = this->nChangedCells();
161 this->propagationTol_,
164 if (this->nChangedCells() > sz)
167 if (oppositeFaceLabels.size() == 1)
169 oppFacei = oppositeFaceLabels.front();
171 changedOppositeFaces_.push_back(oppFacei);
178 if (facei < nInternalFaces)
180 label celli = neighbour[facei];
181 Type& currentWallInfo2 = this->allCellInfo_[celli];
183 if (!currentWallInfo2.equal(neighbourWallInfo, this->td_))
186 opposingFaceLabels(celli, facei, oppositeFaceLabels);
188 if (oppositeFaceLabels.size())
190 label sz = this->nChangedCells();
196 this->propagationTol_,
199 if (this->nChangedCells() > sz)
202 if (oppositeFaceLabels.size() == 1)
204 oppFacei = oppositeFaceLabels.front();
206 changedOppositeFaces_.push_back(oppFacei);
213 this->changedFace_.unset(facei);
217 this->changedFaces_.clear();
221 Pout<<
" Changed cells : " << this->nChangedCells() <<
endl;
229 template<
class Type,
class TrackingData>
232 forAll(this->changedCells_, changedCelli)
234 label celli = this->changedCells_[changedCelli];
235 label facei = changedOppositeFaces_[changedCelli];
237 if (!this->changedCell_.test(celli))
240 <<
"Cell " << celli <<
" not marked as having been changed" 246 const Type& neighbourWallInfo = this->allCellInfo_[celli];
250 Type& currentWallInfo = this->allFaceInfo_[facei];
252 if (!currentWallInfo.equal(neighbourWallInfo, this->td_))
259 this->propagationTol_,
266 this->changedCell_.unset(celli);
270 this->changedCells_.clear();
271 changedOppositeFaces_.clear();
273 if (this->hasCyclicPatches_)
276 this->handleCyclicPatches();
279 if (this->hasCyclicAMIPatches_)
281 this->handleAMICyclicPatches();
287 this->handleProcPatches();
292 Pout<<
" Changed faces : " << this->nChangedFaces()
297 return returnReduce(this->nChangedFaces(), sumOp<label>());
OppositeFaceCellWave(const polyMesh &, const labelList &initialChangedFaces, const List< Type > &changedFacesInfo, UList< Type > &allFaceInfo, UList< Type > &allCellInfo, const label maxIter, TrackingData &td=FaceCellWaveBase::dummyTrackData_)
Construct from mesh and list of changed faces with the Type for these faces.
List< wallPoints > allCellInfo(mesh_.nCells())
virtual label iterate(const label maxIter)
Iterate until no changes or maxIter reached.
errorManipArg< error, int > exit(error &err, const int errNo=1)
A face is a list of labels corresponding to mesh vertices.
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
wallPoints::trackData td(isBlockedFace, regionToBlockSize)
virtual label cellToFace()
Propagate from cell to face. Returns total number of faces.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Wave propagation of information through grid. Every iteration information goes through one layer of c...
static bool & parRun() noexcept
Test if this a parallel run.
T returnReduce(const T &value, const BinaryOp &bop, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Perform reduction on a copy, using specified binary operation.
#define forAll(list, i)
Loop across all elements in list.
void opposingFaceLabels(const label celli, const label facei, DynamicList< label > &) const
Determine 'opposite' faces (= faces not sharing a vertex) on cell.
errorManip< error > abort(error &err)
virtual label faceToCell()
Propagate from face to cell. Returns total number of cells.
int debug
Static debugging option.
void clear() noexcept
Clear the addressed list, i.e. set the size to zero.
void push_back(const T &val)
Copy append an element to the end of this list.
Mesh consisting of general polyhedral cells.
List< label > labelList
A List of labels.
label nChangedFaces() const noexcept
Current number of changed faces.
List< wallPoints > allFaceInfo(mesh_.nFaces())
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
label nChangedCells() const noexcept
Current number of changed cells.