34template<
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])
62 facei != masterFaceLabel
63 && !
f.connected(masterFace)
77template<
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
119template<
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;
229template<
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()
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 push_back(const T &val)
Copy append an element to the end of this list.
label nChangedFaces() const noexcept
Current number of changed faces.
DynamicList< label > changedCells_
List of changed cells.
DynamicList< label > changedFaces_
List of changed faces.
bitSet changedFace_
Track if face has changed.
static scalar propagationTol_
label nChangedCells() const noexcept
Current number of changed cells.
bitSet changedCell_
Track if cell has changed.
const polyMesh & mesh() const noexcept
Return access to the mesh.
const polyMesh & mesh_
Reference to mesh.
UList< Type > & allCellInfo_
UList< Type > & allFaceInfo_
FaceCellWave(const FaceCellWave &)=delete
void handleAMICyclicPatches()
virtual label iterate(const label maxIter)
void handleCyclicPatches()
bool updateCell(const label celli, const label neighbourFacei, const Type &neighbourInfo, const scalar tol, Type &cellInfo)
const bool hasCyclicAMIPatches_
UList< Type > & allFaceInfo() noexcept
bool updateFace(const label facei, const label neighbourCelli, const Type &neighbourInfo, const scalar tol, Type &faceInfo)
UList< Type > & allCellInfo() noexcept
const bool hasCyclicPatches_
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
void clear()
Clear the list, i.e. set size to zero.
DynamicList< label > changedOppositeFaces_
For every entry in changedCells (i.e. the cell front) gives.
OppositeFaceCellWaveBase(const polyMesh &mesh)
Construct with mesh reference (for sizing).
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.
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...
T & front()
Access first element of the list, position [0].
void size(const label n)
Older name for setAddressableSize.
static bool parRun(const bool on) noexcept
Set as parallel run on/off.
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.
wallPoints::trackData td(isBlockedFace, regionToBlockSize)
Namespace for handling debugging switches.
List< label > labelList
A List of labels.
T returnReduce(const T &value, BinaryOp bop, const int tag=UPstream::msgType(), const int communicator=UPstream::worldComm)
Perform reduction on a copy, using specified binary operation.
Ostream & endl(Ostream &os)
Add newline and flush stream.
errorManip< error > abort(error &err)
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
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.