33template<
class Type,
class TrackingData>
37 const label masterFaceLabel,
49 const face& masterFace = this->mesh_.faces()[masterFaceLabel];
51 const labelList& curFaceLabels = this->mesh_.cells()[celli];
53 oppositeFaceLabels.
clear();
55 forAll(curFaceLabels, facei)
58 const face& curFace = this->mesh_.faces()[curFaceLabels[facei]];
61 if (curFaceLabels[facei] != masterFaceLabel)
63 bool sharedPoint =
false;
69 const label l = curFace[pointi];
71 forAll(masterFace, masterPointi)
73 if (masterFace[masterPointi] == l)
80 if (sharedPoint)
break;
87 oppositeFaceLabels.
append(curFaceLabels[facei]);
98template<
class Type,
class TrackingData>
120 changedOppositeFaces_(this->mesh_.nCells())
123 label iter = this->
iterate(maxIter);
125 if ((maxIter > 0) && (iter >= maxIter))
128 <<
"Maximum number of iterations reached. Increase maxIter."
130 <<
" maxIter:" << maxIter <<
endl
140template<
class Type,
class TrackingData>
143 const labelList& owner = this->mesh_.faceOwner();
144 const labelList& neighbour = this->mesh_.faceNeighbour();
145 label nInternalFaces = this->mesh_.nInternalFaces();
149 forAll(this->changedFaces_, changedFacei)
151 label facei = this->changedFaces_[changedFacei];
153 if (!this->changedFace_.test(facei))
157 <<
" not marked as having been changed"
162 const Type& neighbourWallInfo = this->allFaceInfo_[facei];
168 label celli = owner[facei];
169 Type& currentWallInfo = this->allCellInfo_[celli];
171 if (!currentWallInfo.equal(neighbourWallInfo, this->td_))
174 opposingFaceLabels(celli, facei, oppositeFaceLabels);
176 if (oppositeFaceLabels.
size())
178 label sz = this->changedCells_.size();
184 this->propagationTol_,
187 if (this->changedCells_.size() > sz)
190 if (oppositeFaceLabels.
size() == 1)
192 oppFacei = oppositeFaceLabels[0];
194 changedOppositeFaces_.
append(oppFacei);
201 if (facei < nInternalFaces)
203 label celli = neighbour[facei];
204 Type& currentWallInfo2 = this->allCellInfo_[celli];
206 if (!currentWallInfo2.equal(neighbourWallInfo, this->td_))
209 opposingFaceLabels(celli, facei, oppositeFaceLabels);
211 if (oppositeFaceLabels.
size())
213 label sz = this->changedCells_.size();
219 this->propagationTol_,
222 if (this->changedCells_.size() > sz)
225 if (oppositeFaceLabels.
size() == 1)
227 oppFacei = oppositeFaceLabels[0];
229 changedOppositeFaces_.
append(oppFacei);
236 this->changedFace_.unset(facei);
240 this->changedFaces_.clear();
244 Pout<<
" Changed cells : " << this->changedCells_.size()
249 label totNChanged = this->changedCells_.size();
257template<
class Type,
class TrackingData>
260 forAll(this->changedCells_, changedCelli)
262 label celli = this->changedCells_[changedCelli];
263 label facei = changedOppositeFaces_[changedCelli];
265 if (!this->changedCell_.test(celli))
268 <<
"Cell " << celli <<
" not marked as having been changed"
274 const Type& neighbourWallInfo = this->allCellInfo_[celli];
278 Type& currentWallInfo = this->allFaceInfo_[facei];
280 if (!currentWallInfo.equal(neighbourWallInfo, this->td_))
287 this->propagationTol_,
294 this->changedCell_.unset(celli);
298 this->changedCells_.clear();
299 changedOppositeFaces_.clear();
301 if (this->hasCyclicPatches_)
304 this->handleCyclicPatches();
307 if (this->hasCyclicAMIPatches_)
309 this->handleAMICyclicPatches();
315 this->handleProcPatches();
320 Pout<<
" Changed faces : " << this->changedFaces_.size()
325 label totNChanged = this->changedFaces_.size();
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
void clear() noexcept
Clear the addressed list, i.e. set the size to zero.
void append(const T &val)
Copy append an element to the end of this list.
Wave propagation of information through grid. Every iteration information goes through one layer of c...
DynamicList< label > changedCells_
DynamicList< label > changedFaces_
List of changed faces.
virtual label iterate(const label maxIter)
Iterate until no changes or maxIter reached.
Version of FaceCellWave that walks through prismatic cells only.
void opposingFaceLabels(const label celli, const label facei, DynamicList< label > &) const
Determine 'opposite' faces (= faces not sharing a vertex) on cell.
virtual label faceToCell()
Propagate from face to cell. Returns total number of cells.
virtual label cellToFace()
Propagate from cell to face. Returns total number of faces.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
void size(const label n)
Older name for setAddressableSize.
static bool & parRun() noexcept
Test if this a parallel run.
A face is a list of labels corresponding to mesh vertices.
Mesh consisting of general polyhedral cells.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Ostream & endl(Ostream &os)
Add newline and flush stream.
void reduce(const List< UPstream::commsStruct > &comms, T &value, const BinaryOp &bop, const int tag, const label comm)
errorManip< error > abort(error &err)
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
errorManipArg< error, int > exit(error &err, const int errNo=1)
#define forAll(list, i)
Loop across all elements in list.