37 class PrimitivePatchType,
42propagationTol_ = 0.01;
46 class PrimitivePatchType,
52dummyTrackData_ = 12345;
64 class PrimitivePatchType,
72 const label neighbourFacei,
73 const Type& neighbourInfo,
79 bool wasValid = edgeInfo.valid(td_);
95 if (!changedEdge_[edgeI])
97 changedEdge_.set(edgeI);
98 changedEdges_.append(edgeI);
102 if (!wasValid && edgeInfo.valid(td_))
118 class PrimitivePatchType,
126 const label neighbourEdgeI,
127 const Type& neighbourInfo,
133 bool wasValid = faceInfo.valid(td_);
149 if (changedFace_.set(facei))
151 changedFaces_.append(facei);
155 if (!wasValid && faceInfo.valid(td_))
166 class PrimitivePatchType,
173 const globalMeshData& globalData = mesh_.globalData();
174 const mapDistribute& map = globalData.globalEdgeSlavesMap();
175 const bitSet& cppOrientation = globalData.globalEdgeOrientation();
181 List<Type> cppEdgeData(map.constructSize());
185 label patchEdgeI = patchEdges_[i];
186 label coupledEdgeI = coupledEdges_[i];
188 if (changedEdge_[patchEdgeI])
190 const Type& data = allEdgeInfo_[patchEdgeI];
195 bool sameOrientation =
197 sameEdgeOrientation_[i]
198 == cppOrientation[coupledEdgeI]
201 cppEdgeData[coupledEdgeI].updateEdge
220 globalData.globalEdgeSlaves(),
221 globalData.globalEdgeTransformedSlaves(),
223 globalData.globalTransforms(),
224 updateOp<PrimitivePatchType, Type, TrackingData>
231 transformOp<PrimitivePatchType, Type, TrackingData>
246 label patchEdgeI = patchEdges_[i];
247 label coupledEdgeI = coupledEdges_[i];
249 const Type& data = cppEdgeData[coupledEdgeI];
253 bool sameOrientation =
255 sameEdgeOrientation_[i]
256 == cppOrientation[coupledEdgeI]
259 allEdgeInfo_[patchEdgeI].updateEdge
269 if (!changedEdge_[patchEdgeI])
271 changedEdge_.set(patchEdgeI);
272 changedEdges_.append(patchEdgeI);
285 class PrimitivePatchType,
293 const PrimitivePatchType& patch,
306 allEdgeInfo_(allEdgeInfo),
307 allFaceInfo_(allFaceInfo),
309 changedEdge_(patch_.
nEdges()),
310 changedEdges_(patch_.size()),
311 changedFace_(patch_.size()),
312 changedFaces_(patch_.size()),
314 nUnvisitedEdges_(patch_.
nEdges()),
315 nUnvisitedFaces_(patch_.size())
330 if (allEdgeInfo_.
size() != patch_.nEdges())
333 <<
"size of edgeInfo work array is not equal to the number"
334 <<
" of edges in the patch" <<
endl
335 <<
" edgeInfo :" << allEdgeInfo_.
size() <<
endl
336 <<
" patch.nEdges:" << patch_.nEdges()
339 if (allFaceInfo_.
size() != patch_.size())
342 <<
"size of edgeInfo work array is not equal to the number"
343 <<
" of faces in the patch" <<
endl
344 <<
" faceInfo :" << allFaceInfo_.
size() <<
endl
345 <<
" patch.size:" << patch_.size()
361 if ((maxIter > 0) && (iter >= maxIter))
364 <<
"Maximum number of iterations reached. Increase maxIter." <<
endl
365 <<
" maxIter:" << maxIter <<
endl
366 <<
" changedEdges:" << changedEdges_.
size() <<
endl
367 <<
" changedFaces:" << changedFaces_.
size() <<
endl
375 class PrimitivePatchType,
383 const PrimitivePatchType& patch,
391 allEdgeInfo_(allEdgeInfo),
392 allFaceInfo_(allFaceInfo),
394 changedEdge_(patch_.
nEdges()),
395 changedEdges_(patch_.
nEdges()),
396 changedFace_(patch_.size()),
397 changedFaces_(patch_.size()),
399 nUnvisitedEdges_(patch_.
nEdges()),
400 nUnvisitedFaces_(patch_.size())
421 class PrimitivePatchType,
432 forAll(changedEdges, changedEdgeI)
434 label edgeI = changedEdges[changedEdgeI];
436 bool wasValid = allEdgeInfo_[edgeI].valid(td_);
439 allEdgeInfo_[edgeI] = changedEdgesInfo[changedEdgeI];
442 if (!wasValid && allEdgeInfo_[edgeI].valid(td_))
449 if (!changedEdge_[edgeI])
451 changedEdge_.
set(edgeI);
452 changedEdges_.append(edgeI);
461 class PrimitivePatchType,
468 changedEdges_.clear();
469 changedEdge_ =
false;
471 forAll(changedFaces_, changedFacei)
473 label facei = changedFaces_[changedFacei];
475 if (!changedFace_.test(facei))
479 <<
" not marked as having been changed" <<
nl
480 <<
"This might be caused by multiple occurrences of the same"
484 const Type& neighbourWallInfo = allFaceInfo_[facei];
487 const labelList& fEdges = patch_.faceEdges()[facei];
491 label edgeI = fEdges[fEdgeI];
493 Type& currentWallInfo = allEdgeInfo_[edgeI];
495 if (!currentWallInfo.equal(neighbourWallInfo, td_))
514 Pout<<
"Changed edges : " << changedEdges_.size() <<
endl;
524 class PrimitivePatchType,
531 changedFaces_.clear();
532 changedFace_ =
false;
536 forAll(changedEdges_, changedEdgeI)
538 label edgeI = changedEdges_[changedEdgeI];
540 if (!changedEdge_[edgeI])
544 <<
" not marked as having been changed" <<
nl
545 <<
"This might be caused by multiple occurrences of the same"
549 const Type& neighbourWallInfo = allEdgeInfo_[edgeI];
553 const labelList& eFaces = edgeFaces[edgeI];
556 label facei = eFaces[eFacei];
558 Type& currentWallInfo = allFaceInfo_[facei];
560 if (!currentWallInfo.equal(neighbourWallInfo, td_))
575 Pout<<
"Changed faces : " << changedFaces_.size() <<
endl;
585 class PrimitivePatchType,
602 while (iter < maxIter)
606 Pout<<
"Iteration " << iter <<
endl;
609 label
nFaces = edgeToFace();
621 label
nEdges = faceToEdge();
626 <<
"Total evaluations : " << nEvals_ <<
nl
627 <<
"Remaining unvisited edges : " << nUnvisitedEdges_ <<
nl
628 <<
"Remaining unvisited faces : " << nUnvisitedFaces_ <<
nl
std::enable_if< std::is_same< bool, TypeT >::value, bool >::type set(const label i, bool val=true)
A bitSet::set() method for a list of bool.
Wave propagation of information along patch. Every iteration information goes through one layer of fa...
label edgeToFace()
Propagate from edge to face.
label iterate(const label maxIter)
Iterate until no changes or maxIter reached.
void setEdgeInfo(const labelList &changedEdges, const List< Type > &changedEdgesInfo)
Copy initial data into allEdgeInfo_.
label faceToEdge()
Propagate from face to edge.
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.
const indirectPrimitivePatch & coupledPatch() const
Return patch of all coupled faces.
Mesh consisting of general polyhedral cells.
const globalMeshData & globalData() const
Return parallel info.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
const labelList nFaces(UPstream::listGatherValues< label >(aMesh.nFaces()))
const labelList nEdges(UPstream::listGatherValues< label >(aMesh.nEdges()))
Ostream & endl(Ostream &os)
Add newline and flush stream.
errorManip< error > abort(error &err)
T returnReduce(const T &value, const BinaryOp &bop, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Reduce (copy) and return value.
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
errorManipArg< error, int > exit(error &err, const int errNo=1)
constexpr char nl
The newline '\n' character (0x0a)
#define forAll(list, i)
Loop across all elements in list.