31 template<
class Type,
class TrackingData>
35 const label masterFaceLabel,
47 const face& masterFace = this->mesh_.faces()[masterFaceLabel];
49 const labelList& curFaceLabels = this->mesh_.cells()[celli];
51 oppositeFaceLabels.
clear();
53 forAll(curFaceLabels, facei)
56 const face& curFace = this->mesh_.faces()[curFaceLabels[facei]];
59 if (curFaceLabels[facei] != masterFaceLabel)
61 bool sharedPoint =
false;
67 const label l = curFace[pointi];
69 forAll(masterFace, masterPointi)
71 if (masterFace[masterPointi] == l)
78 if (sharedPoint)
break;
85 oppositeFaceLabels.
append(curFaceLabels[facei]);
96 template<
class Type,
class TrackingData>
118 changedOppositeFaces_(this->mesh_.nCells())
123 if ((maxIter > 0) && (iter >= maxIter))
126 <<
"Maximum number of iterations reached. Increase maxIter."
128 <<
" maxIter:" << maxIter <<
endl
138 template<
class Type,
class TrackingData>
141 const labelList& owner = this->mesh_.faceOwner();
142 const labelList& neighbour = this->mesh_.faceNeighbour();
143 label nInternalFaces = this->mesh_.nInternalFaces();
147 forAll(this->changedFaces_, changedFacei)
149 label facei = this->changedFaces_[changedFacei];
151 if (!this->changedFace_[facei])
155 <<
" not marked as having been changed"
160 const Type& neighbourWallInfo = this->allFaceInfo_[facei];
166 label celli = owner[facei];
167 Type& currentWallInfo = this->allCellInfo_[celli];
169 if (!currentWallInfo.equal(neighbourWallInfo, this->td_))
172 opposingFaceLabels(celli, facei, oppositeFaceLabels);
174 if (oppositeFaceLabels.
size())
176 label sz = this->changedCells_.size();
182 this->propagationTol_,
185 if (this->changedCells_.size() > sz)
188 if (oppositeFaceLabels.
size() == 1)
190 oppFacei = oppositeFaceLabels[0];
192 changedOppositeFaces_.
append(oppFacei);
199 if (facei < nInternalFaces)
201 label celli = neighbour[facei];
202 Type& currentWallInfo2 = this->allCellInfo_[celli];
204 if (!currentWallInfo2.equal(neighbourWallInfo, this->td_))
207 opposingFaceLabels(celli, facei, oppositeFaceLabels);
209 if (oppositeFaceLabels.
size())
211 label sz = this->changedCells_.size();
217 this->propagationTol_,
220 if (this->changedCells_.size() > sz)
223 if (oppositeFaceLabels.
size() == 1)
225 oppFacei = oppositeFaceLabels[0];
227 changedOppositeFaces_.
append(oppFacei);
234 this->changedFace_[facei] =
false;
238 this->changedFaces_.clear();
242 Pout<<
" Changed cells : " << this->changedCells_.size()
247 label totNChanged = this->changedCells_.size();
255 template<
class Type,
class TrackingData>
258 forAll(this->changedCells_, changedCelli)
260 label celli = this->changedCells_[changedCelli];
261 label facei = changedOppositeFaces_[changedCelli];
263 if (!this->changedCell_[celli])
266 <<
"Cell " << celli <<
" not marked as having been changed"
272 const Type& neighbourWallInfo = this->allCellInfo_[celli];
276 Type& currentWallInfo = this->allFaceInfo_[facei];
278 if (!currentWallInfo.equal(neighbourWallInfo, this->td_))
285 this->propagationTol_,
292 this->changedCell_[celli] =
false;
296 this->changedCells_.clear();
297 changedOppositeFaces_.clear();
299 if (this->hasCyclicPatches_)
302 this->handleCyclicPatches();
308 this->handleProcPatches();
313 Pout<<
" Changed faces : " << this->changedFaces_.size()
318 label totNChanged = this->changedFaces_.size();
#define forAll(list, i)
Loop across all elements in list.
DynamicList< T, SizeInc, SizeMult, SizeDiv > & append(const T &)
Append an element at the end of the list.
void clear()
Clear the addressed list, i.e. set the size to zero.
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. Returns actual.
void size(const label)
Override size to be inconsistent with allocated storage.
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.
OppositeFaceCellWave(const polyMesh &, const labelList &initialChangedFaces, const List< Type > &changedFacesInfo, UList< Type > &allFaceInfo, UList< Type > &allCellInfo, const label maxIter, TrackingData &td=FaceCellWave< Type, TrackingData >::defaultTrackingData_)
Construct from mesh and list of changed faces with the Type.
virtual label cellToFace()
Propagate from cell to face. Returns total number of faces.
static bool & parRun()
Is 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.
errorManipArg< error, int > exit(error &err, const int errNo=1)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Ostream & endl(Ostream &os)
Add newline and flush stream.
errorManip< error > abort(error &err)
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
prefixOSstream Pout(cout, "Pout")