43 class PrimitivePatchType,
51 const label neighbourFacei,
52 const Type& neighbourInfo,
58 bool wasValid = edgeInfo.valid(td_);
74 if (changedEdge_.set(edgei))
76 changedEdges_.push_back(edgei);
80 if (!wasValid && edgeInfo.valid(td_))
96 class PrimitivePatchType,
104 const label neighbourEdgeI,
105 const Type& neighbourInfo,
111 bool wasValid = faceInfo.valid(td_);
127 if (changedFace_.set(facei))
129 changedFaces_.push_back(facei);
133 if (!wasValid && faceInfo.valid(td_))
144 class PrimitivePatchType,
151 const globalMeshData& globalData = mesh_.globalData();
152 const mapDistribute& map = globalData.globalEdgeSlavesMap();
153 const bitSet& cppOrientation = globalData.globalEdgeOrientation();
159 List<Type> cppEdgeData(map.constructSize());
163 label patchEdgeI = patchEdges_[i];
164 label coupledEdgeI = coupledEdges_[i];
166 if (changedEdge_.test(patchEdgeI))
168 const Type& data = allEdgeInfo_[patchEdgeI];
173 bool sameOrientation =
175 sameEdgeOrientation_[i]
176 == cppOrientation[coupledEdgeI]
179 cppEdgeData[coupledEdgeI].updateEdge
198 globalData.globalEdgeSlaves(),
199 globalData.globalEdgeTransformedSlaves(),
201 globalData.globalTransforms(),
202 updateOp<PrimitivePatchType, Type, TrackingData>
209 transformOp<PrimitivePatchType, Type, TrackingData>
224 label patchEdgeI = patchEdges_[i];
225 label coupledEdgeI = coupledEdges_[i];
227 const Type& data = cppEdgeData[coupledEdgeI];
231 bool sameOrientation =
233 sameEdgeOrientation_[i]
234 == cppOrientation[coupledEdgeI]
237 allEdgeInfo_[patchEdgeI].updateEdge
247 if (changedEdge_.set(patchEdgeI))
249 changedEdges_.push_back(patchEdgeI);
262 class PrimitivePatchType,
270 const PrimitivePatchType& patch,
293 mesh_.globalData().coupledPatch(),
301 if (allEdgeInfo_.size() != patch_.nEdges())
304 <<
"size of edgeInfo work array is not equal to the number"
305 <<
" of edges in the patch" <<
nl
306 <<
" edgeInfo :" << allEdgeInfo_.size() <<
nl
307 <<
" patch.nEdges:" << patch_.nEdges() <<
endl
310 if (allFaceInfo_.size() != patch_.size())
313 <<
"size of edgeInfo work array is not equal to the number"
314 <<
" of faces in the patch" <<
nl
315 <<
" faceInfo :" << allFaceInfo_.size() <<
nl
316 <<
" patch.size:" << patch_.size() <<
endl
332 if ((maxIter > 0) && (iter >= maxIter))
335 <<
"Maximum number of iterations reached. Increase maxIter." <<
nl
336 <<
" maxIter:" << maxIter <<
nl
346 class PrimitivePatchType,
354 const PrimitivePatchType& patch,
372 mesh_.globalData().coupledPatch(),
386 class PrimitivePatchType,
397 forAll(changedEdges, changedEdgeI)
399 label edgeI = changedEdges[changedEdgeI];
401 bool wasValid = allEdgeInfo_[edgeI].valid(td_);
404 allEdgeInfo_[edgeI] = changedEdgesInfo[changedEdgeI];
407 if (!wasValid && allEdgeInfo_[edgeI].valid(td_))
425 class PrimitivePatchType,
441 <<
" not marked as having been changed" <<
nl
442 <<
"This might be caused by multiple occurrences of the same"
446 const Type& neighbourWallInfo = allFaceInfo_[facei];
449 const labelList& fEdges = patch_.faceEdges()[facei];
453 label edgeI = fEdges[fEdgeI];
455 Type& currentWallInfo = allEdgeInfo_[edgeI];
457 if (!currentWallInfo.equal(neighbourWallInfo, td_))
486 class PrimitivePatchType,
504 <<
" not marked as having been changed" <<
nl
505 <<
"This might be caused by multiple occurrences of the same"
509 const Type& neighbourWallInfo = allEdgeInfo_[edgei];
513 for (
const label facei : edgeFaces[edgei])
515 Type& currentWallInfo = allFaceInfo_[facei];
517 if (!currentWallInfo.equal(neighbourWallInfo, td_))
542 class PrimitivePatchType,
559 while (iter < maxIter)
563 Pout<<
"Iteration " << iter <<
endl;
570 Pout<<
"Total changed faces : " << nFaces <<
endl;
582 Pout<<
"Total changed edges : " << nEdges <<
nl
583 <<
"Total evaluations : " << nEvals_ <<
nl
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
label nChangedFaces() const noexcept
Current number of changed faces.
DynamicList< label > changedFaces_
List of changed faces.
bitSet changedFace_
Track if face has changed.
DynamicList< label > changedEdges_
List of changed edges.
label nChangedEdges() const noexcept
Current number of changed edges.
label nUnvisitedFaces_
Number of unvisited faces.
PatchEdgeFaceWaveBase(const polyMesh &mesh, const label nEdges, const label nFaces)
Construct with mesh reference and set initial sizes.
label nUnvisitedEdges_
Number of unvisited edges.
bitSet changedEdge_
Track if edge has changed.
const polyMesh & mesh() const noexcept
Return access to the mesh.
const polyMesh & mesh_
Reference to mesh.
Wave propagation of information along patch. Every iteration information goes through one layer of fa...
UList< Type > & allFaceInfo() const noexcept
Access allFaceInfo.
label edgeToFace()
Propagate from edge to face.
UList< Type > & allEdgeInfo() const noexcept
Access allEdgeInfo.
label iterate(const label maxIter)
Iterate until no changes or maxIter reached.
label faceToEdge()
Propagate from face to edge.
void setEdgeInfo(const labelUList &changedEdges, const UList< Type > &changedEdgesInfo)
Copy initial data into allEdgeInfo_.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
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< labelList > labelListList
List of labelList.
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)
UList< label > labelUList
A UList of labels.
constexpr char nl
The newline '\n' character (0x0a).
#define forAll(list, i)
Loop across all elements in list.