40 template<
class Type,
class TrackingData>
43 template<
class Type,
class TrackingData>
49 template<
class Type,
class TrackingData>
74 template<
class Type,
class TrackingData>
84 forAll(patchPointLabels, i)
86 label patchPointI = patchPointLabels[i];
88 const point& pt = patch.
points()[meshPoints[patchPointI]];
90 pointInfo[i].leaveDomain(patch, patchPointI, pt, td_);
96 template<
class Type,
class TrackingData>
106 forAll(patchPointLabels, i)
108 label patchPointI = patchPointLabels[i];
110 const point& pt = patch.
points()[meshPoints[patchPointI]];
112 pointInfo[i].enterDomain(patch, patchPointI, pt, td_);
118 template<
class Type,
class TrackingData>
126 if (rotTensor.size() == 1)
128 const tensor&
T = rotTensor[0];
132 pointInfo[i].transform(
T, td_);
138 <<
"Non-uniform transformation on patch " << patch.
name()
139 <<
" of type " << patch.type()
140 <<
" not supported for point fields"
145 pointInfo[i].transform(rotTensor[i], td_);
156 template<
class Type,
class TrackingData>
160 const label neighbourEdgeI,
161 const Type& neighbourInfo,
167 bool wasValid = pointInfo.valid(td_);
170 pointInfo.updatePoint
182 if (!changedPoint_[pointI])
184 changedPoint_[pointI] =
true;
185 changedPoints_[nChangedPoints_++] = pointI;
189 if (!wasValid && pointInfo.valid(td_))
203 template<
class Type,
class TrackingData>
207 const Type& neighbourInfo,
213 bool wasValid = pointInfo.valid(td_);
216 pointInfo.updatePoint
227 if (!changedPoint_[pointI])
229 changedPoint_[pointI] =
true;
230 changedPoints_[nChangedPoints_++] = pointI;
234 if (!wasValid && pointInfo.valid(td_))
248 template<
class Type,
class TrackingData>
252 const label neighbourPointI,
253 const Type& neighbourInfo,
259 bool wasValid = edgeInfo.valid(td_);
274 if (!changedEdge_[edgeI])
276 changedEdge_[edgeI] =
true;
277 changedEdges_[nChangedEdges_++] = edgeI;
281 if (!wasValid && edgeInfo.valid(td_))
291 template<
class Type,
class TrackingData>
292 template<
class PatchType>
297 forAll(mesh_.boundaryMesh(), patchI)
299 if (isA<PatchType>(mesh_.boundaryMesh()[patchI]))
309 template<
class Type,
class TrackingData>
320 forAll(mesh_.globalData().processorPatches(), i)
322 label patchI = mesh_.globalData().processorPatches()[i];
324 refCast<const processorPolyPatch>(mesh_.boundaryMesh()[patchI]);
335 forAll(neighbPoints, thisPointI)
338 if (changedPoint_[meshPointI])
340 patchInfo.
append(allPointInfo_[meshPointI]);
341 thisPoints.
append(thisPointI);
342 nbrPoints.
append(neighbPoints[thisPointI]);
347 leaveDomain(procPatch, thisPoints, patchInfo);
357 toNeighbour << nbrPoints << patchInfo;
367 forAll(mesh_.globalData().processorPatches(), i)
369 label patchI = mesh_.globalData().processorPatches()[i];
371 refCast<const processorPolyPatch>(mesh_.boundaryMesh()[patchI]);
378 fromNeighbour >> patchPoints >> patchInfo;
395 enterDomain(procPatch, patchPoints, patchInfo);
401 label meshPointI = meshPoints[patchPoints[i]];
403 if (!allPointInfo_[meshPointI].
equal(patchInfo[i], td_))
409 allPointInfo_[meshPointI]
422 template<
class Type,
class TrackingData>
431 forAll(mesh_.boundaryMesh(), patchI)
435 if (isA<cyclicPolyPatch>(patch))
438 refCast<const cyclicPolyPatch>(patch);
455 label thisPointI = pairs[pairI][0];
456 label nbrPointI = pairs[pairI][1];
457 label meshPointI = meshPoints[nbrPointI];
459 if (changedPoint_[meshPointI])
461 nbrInfo.
append(allPointInfo_[meshPointI]);
462 nbrPoints.
append(nbrPointI);
463 thisPoints.
append(thisPointI);
468 leaveDomain(nbrPatch, nbrPoints, nbrInfo);
488 enterDomain(cycPatch, thisPoints, nbrInfo);
494 label meshPointI = meshPoints[thisPoints[i]];
496 if (!allPointInfo_[meshPointI].
equal(nbrInfo[i], td_))
502 allPointInfo_[meshPointI]
513 template<
class Type,
class TrackingData>
525 forAll(meshPoints, pointI)
527 elems[pointI] = allPointInfo_[meshPoints[pointI]];
539 Type& elem = elems[pointI];
541 const labelList& slavePoints = slaves[pointI];
546 cop(elem, elems[slavePoints[j]]);
552 elems[slavePoints[j]] = elem;
560 forAll(meshPoints, pointI)
562 if (elems[pointI].valid(td_))
564 label meshPointI = meshPoints[pointI];
566 Type& elem = allPointInfo_[meshPointI];
568 bool wasValid = elem.valid(td_);
573 if (!elem.equal(elems[pointI], td_))
576 elem = elems[pointI];
579 if (!wasValid && elem.valid(td_))
585 if (!changedPoint_[meshPointI])
587 changedPoint_[meshPointI] =
true;
588 changedPoints_[nChangedPoints_++] = meshPointI;
595 label totNChanged = nChangedPoints_;
607 template<
class Type,
class TrackingData>
622 allPointInfo_(allPointInfo),
623 allEdgeInfo_(allEdgeInfo),
625 changedPoint_(mesh_.nPoints(),
false),
626 changedPoints_(mesh_.nPoints()),
628 changedEdge_(mesh_.nEdges(),
false),
629 changedEdges_(mesh_.nEdges()),
631 nCyclicPatches_(countPatchType<cyclicPolyPatch>()),
633 nUnvisitedPoints_(mesh_.nPoints()),
634 nUnvisitedEdges_(mesh_.nEdges())
636 if (allPointInfo_.size() != mesh_.nPoints())
639 <<
"size of pointInfo work array is not equal to the number"
640 <<
" of points in the mesh" <<
endl
641 <<
" pointInfo :" << allPointInfo_.size() <<
endl
642 <<
" mesh.nPoints:" << mesh_.nPoints()
645 if (allEdgeInfo_.size() != mesh_.nEdges())
648 <<
"size of edgeInfo work array is not equal to the number"
649 <<
" of edges in the mesh" <<
endl
650 <<
" edgeInfo :" << allEdgeInfo_.size() <<
endl
651 <<
" mesh.nEdges:" << mesh_.nEdges()
657 setPointInfo(changedPoints, changedPointsInfo);
661 Info<< typeName <<
": Seed points : "
666 label iter = iterate(maxIter);
668 if ((maxIter > 0) && (iter >= maxIter))
671 <<
"Maximum number of iterations reached. Increase maxIter." <<
endl
672 <<
" maxIter:" << maxIter <<
endl
673 <<
" nChangedPoints:" << nChangedPoints_ <<
endl
674 <<
" nChangedEdges:" << nChangedEdges_ <<
endl
680 template<
class Type,
class TrackingData>
690 allPointInfo_(allPointInfo),
691 allEdgeInfo_(allEdgeInfo),
693 changedPoint_(mesh_.nPoints(),
false),
694 changedPoints_(mesh_.nPoints()),
696 changedEdge_(mesh_.nEdges(),
false),
697 changedEdges_(mesh_.nEdges()),
699 nCyclicPatches_(countPatchType<cyclicPolyPatch>()),
701 nUnvisitedPoints_(mesh_.nPoints()),
702 nUnvisitedEdges_(mesh_.nEdges())
708 template<
class Type,
class TrackingData>
716 template<
class Type,
class TrackingData>
719 return nUnvisitedPoints_;
723 template<
class Type,
class TrackingData>
726 return nUnvisitedEdges_;
731 template<
class Type,
class TrackingData>
738 forAll(changedPoints, changedPointI)
740 label pointI = changedPoints[changedPointI];
742 bool wasValid = allPointInfo_[pointI].valid(td_);
745 allPointInfo_[pointI] = changedPointsInfo[changedPointI];
748 if (!wasValid && allPointInfo_[pointI].valid(td_))
755 if (!changedPoint_[pointI])
757 changedPoint_[pointI] =
true;
758 changedPoints_[nChangedPoints_++] = pointI;
763 handleCollocatedPoints();
768 template<
class Type,
class TrackingData>
773 label changedEdgeI = 0;
774 changedEdgeI < nChangedEdges_;
778 label edgeI = changedEdges_[changedEdgeI];
780 if (!changedEdge_[edgeI])
784 <<
" not marked as having been changed" <<
nl
785 <<
"This might be caused by multiple occurences of the same"
790 const Type& neighbourWallInfo = allEdgeInfo_[edgeI];
793 const edge&
e = mesh_.edges()[edgeI];
797 Type& currentWallInfo = allPointInfo_[
e[eI]];
799 if (!currentWallInfo.equal(neighbourWallInfo, td_))
812 changedEdge_[edgeI] =
false;
818 if (nCyclicPatches_ > 0)
821 handleCyclicPatches();
823 if (Pstream::parRun())
835 label totNChanged = nChangedPoints_;
844 template<
class Type,
class TrackingData>
851 label changedPointI = 0;
852 changedPointI < nChangedPoints_;
856 label pointI = changedPoints_[changedPointI];
858 if (!changedPoint_[pointI])
861 <<
"Point " << pointI
862 <<
" not marked as having been changed" <<
nl
863 <<
"This might be caused by multiple occurences of the same"
867 const Type& neighbourWallInfo = allPointInfo_[pointI];
871 const labelList& edgeLabels = pointEdges[pointI];
872 forAll(edgeLabels, edgeLabelI)
874 label edgeI = edgeLabels[edgeLabelI];
876 Type& currentWallInfo = allEdgeInfo_[edgeI];
878 if (!currentWallInfo.equal(neighbourWallInfo, td_))
891 changedPoint_[pointI] =
false;
903 label totNChanged = nChangedEdges_;
912 template<
class Type,
class TrackingData>
918 if (nCyclicPatches_ > 0)
921 handleCyclicPatches();
923 if (Pstream::parRun())
933 while (iter < maxIter)
935 while (iter < maxIter)
939 Info<< typeName <<
": Iteration " << iter <<
endl;
942 label nEdges = pointToEdge();
946 Info<< typeName <<
": Total changed edges : "
959 Info<< typeName <<
": Total changed points : "
961 << typeName <<
": Total evaluations : "
963 << typeName <<
": Remaining unvisited points: "
965 << typeName <<
": Remaining unvisited edges : "
984 Info<< typeName <<
": Collocated point sync : "