1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | foam-extend: Open Source CFD
4 \\ / O peration | Version: 3.2
5 \\ / A nd | Web: http://www.foam-extend.org
6 \\/ M anipulation | For copyright notice see file Copyright
7 -------------------------------------------------------------------------------
9 This file is part of foam-extend.
11 foam-extend is free software: you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by the
13 Free Software Foundation, either version 3 of the License, or (at your
14 option) any later version.
16 foam-extend is distributed in the hope that it will be useful, but
17 WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 General Public License for more details.
21 You should have received a copy of the GNU General Public License
22 along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
24 \*---------------------------------------------------------------------------*/
26 #include "PointEdgeWave.H"
28 #include "processorPolyPatch.H"
29 #include "cyclicPolyPatch.H"
30 #include "ggiPolyPatch.H"
33 #include "PstreamCombineReduceOps.H"
37 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
40 Foam::scalar Foam::PointEdgeWave<Type>::propagationTol_ = 0.01;
43 // Offset labelList. Used for transferring from one cyclic half to the other.
45 void Foam::PointEdgeWave<Type>::offset(const label val, labelList& elems)
54 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
56 // Gets point-point correspondence. Is
57 // - list of halfA points (in cyclic patch points)
58 // - list of halfB points (can overlap with A!)
59 // - for every patchPoint its corresponding point
61 void Foam::PointEdgeWave<Type>::calcCyclicAddressing()
65 forAll(mesh_.boundaryMesh(), patchI)
67 const polyPatch& patch = mesh_.boundaryMesh()[patchI];
69 if (isA<cyclicPolyPatch>(patch))
71 label halfSize = patch.size()/2;
73 SubList<face> halfAFaces
83 new primitivePatch(halfAFaces, mesh_.points())
86 SubList<face> halfBFaces
90 patch.start() + halfSize
96 new primitivePatch(halfBFaces, mesh_.points())
103 // Handle leaving domain. Implementation referred to Type
104 template <class Type>
105 void Foam::PointEdgeWave<Type>::leaveDomain
107 const polyPatch& meshPatch,
108 const primitivePatch& patch,
109 const labelList& patchPointLabels,
110 List<Type>& pointInfo
113 const labelList& meshPoints = patch.meshPoints();
115 forAll(patchPointLabels, i)
117 label patchPointI = patchPointLabels[i];
119 const point& pt = patch.points()[meshPoints[patchPointI]];
121 pointInfo[i].leaveDomain(meshPatch, patchPointI, pt);
126 // Handle entering domain. Implementation referred to Type
127 template <class Type>
128 void Foam::PointEdgeWave<Type>::enterDomain
130 const polyPatch& meshPatch,
131 const primitivePatch& patch,
132 const labelList& patchPointLabels,
133 List<Type>& pointInfo
136 const labelList& meshPoints = patch.meshPoints();
138 forAll(patchPointLabels, i)
140 label patchPointI = patchPointLabels[i];
142 const point& pt = patch.points()[meshPoints[patchPointI]];
144 pointInfo[i].enterDomain(meshPatch, patchPointI, pt);
149 // Transform. Implementation referred to Type
150 template <class Type>
151 void Foam::PointEdgeWave<Type>::transform
153 const tensorField& rotTensor,
154 List<Type>& pointInfo
157 if (rotTensor.size() == 1)
159 const tensor& T = rotTensor[0];
163 pointInfo[i].transform(T);
170 "PointEdgeWave<Type>::transform(const tensorField&, List<Type>&)"
171 ) << "Parallel cyclics not supported"
172 << abort(FatalError);
176 pointInfo[i].transform(rotTensor[i]);
182 // Update info for pointI, at position pt, with information from
183 // neighbouring edge.
185 // - changedPoint_, changedPoints_, nChangedPoints_,
186 // - statistics: nEvals_, nUnvisitedPoints_
187 template <class Type>
188 bool Foam::PointEdgeWave<Type>::updatePoint
191 const label neighbourEdgeI,
192 const Type& neighbourInfo,
199 bool wasValid = pointInfo.valid();
202 pointInfo.updatePoint
213 if (!changedPoint_[pointI])
215 changedPoint_[pointI] = true;
216 changedPoints_[nChangedPoints_++] = pointI;
220 if (!wasValid && pointInfo.valid())
229 // Update info for pointI, at position pt, with information from
232 // - changedPoint_, changedPoints_, nChangedPoints_,
233 // - statistics: nEvals_, nUnvisitedPoints_
234 template <class Type>
235 bool Foam::PointEdgeWave<Type>::updatePoint
238 const Type& neighbourInfo,
245 bool wasValid = pointInfo.valid();
248 pointInfo.updatePoint
258 if (!changedPoint_[pointI])
260 changedPoint_[pointI] = true;
261 changedPoints_[nChangedPoints_++] = pointI;
265 if (!wasValid && pointInfo.valid())
274 // Update info for edgeI, at position pt, with information from
275 // neighbouring point.
277 // - changedEdge_, changedEdges_, nChangedEdges_,
278 // - statistics: nEvals_, nUnvisitedEdge_
279 template <class Type>
280 bool Foam::PointEdgeWave<Type>::updateEdge
283 const label neighbourPointI,
284 const Type& neighbourInfo,
291 bool wasValid = edgeInfo.valid();
305 if (!changedEdge_[edgeI])
307 changedEdge_[edgeI] = true;
308 changedEdges_[nChangedEdges_++] = edgeI;
312 if (!wasValid && edgeInfo.valid())
321 // Check if patches of given type name are present
322 template <class Type>
323 template <class PatchType>
324 Foam::label Foam::PointEdgeWave<Type>::countPatchType() const
328 forAll(mesh_.boundaryMesh(), patchI)
330 if (isA<PatchType>(mesh_.boundaryMesh()[patchI]))
339 // Collect changed patch points
340 template <class Type>
341 void Foam::PointEdgeWave<Type>::getChangedPatchPoints
343 const primitivePatch& patch,
345 DynamicList<Type>& patchInfo,
346 dynamicLabelList& patchPoints,
347 dynamicLabelList& owner,
348 dynamicLabelList& ownerIndex
351 const labelList& meshPoints = patch.meshPoints();
352 const faceList& localFaces = patch.localFaces();
353 const labelListList& pointFaces = patch.pointFaces();
355 forAll(meshPoints, patchPointI)
357 label meshPointI = meshPoints[patchPointI];
359 if (changedPoint_[meshPointI])
361 patchInfo.append(allPointInfo_[meshPointI]);
363 //Pout << "Sending " << meshPointI << " " << mesh_.points()[meshPointI] << " o = " << patchInfo[patchInfo.size()-1].origin() << " " << allPointInfo_[meshPointI] << endl;
365 patchPoints.append(patchPointI);
367 label patchFaceI = pointFaces[patchPointI][0];
369 const face& f = localFaces[patchFaceI];
371 label index = findIndex(f, patchPointI);
373 owner.append(patchFaceI);
374 ownerIndex.append(index);
379 patchPoints.shrink();
385 // Update overall for changed patch points
386 template <class Type>
387 void Foam::PointEdgeWave<Type>::updateFromPatchInfo
389 const polyPatch& meshPatch,
390 const primitivePatch& patch,
391 const labelList& owner,
392 const labelList& ownerIndex,
393 List<Type>& patchInfo
396 const faceList& localFaces = patch.localFaces();
397 const labelList& meshPoints = patch.meshPoints();
399 // Get patch and mesh points.
400 labelList changedPatchPoints(patchInfo.size());
401 labelList changedMeshPoints(patchInfo.size());
405 label faceI = owner[i];
407 const face& f = localFaces[faceI];
409 label index = (f.size() - ownerIndex[i]) % f.size();
411 changedPatchPoints[i] = f[index];
412 changedMeshPoints[i] = meshPoints[f[index]];
415 // Adapt for entering domain
416 enterDomain(meshPatch, patch, changedPatchPoints, patchInfo);
418 // Merge received info
423 changedMeshPoints[i],
426 allPointInfo_[changedMeshPoints[i]]
433 // Transfer all the information to/from neighbouring processors
434 template <class Type>
435 void Foam::PointEdgeWave<Type>::handleProcPatches()
437 // 1. Send all point info on processor patches. Send as
438 // face label + offset in face.
440 forAll(mesh_.boundaryMesh(), patchI)
442 const polyPatch& patch = mesh_.boundaryMesh()[patchI];
444 if (isA<processorPolyPatch>(patch))
446 // Get all changed points in relative addressing
448 DynamicList<Type> patchInfo(patch.nPoints());
449 dynamicLabelList patchPoints(patch.nPoints());
450 dynamicLabelList owner(patch.nPoints());
451 dynamicLabelList ownerIndex(patch.nPoints());
453 getChangedPatchPoints
462 // Adapt for leaving domain
463 leaveDomain(patch, patch, patchPoints, patchInfo);
465 const processorPolyPatch& procPatch =
466 refCast<const processorPolyPatch>(patch);
470 Pout<< "Processor patch " << patchI << ' ' << patch.name()
471 << " communicating with " << procPatch.neighbProcNo()
472 << " Sending:" << patchInfo.size() << endl;
479 procPatch.neighbProcNo()
482 toNeighbour << owner << ownerIndex << patchInfo;
489 // 2. Receive all point info on processor patches.
492 forAll(mesh_.boundaryMesh(), patchI)
494 const polyPatch& patch = mesh_.boundaryMesh()[patchI];
496 if (isA<processorPolyPatch>(patch))
498 const processorPolyPatch& procPatch =
499 refCast<const processorPolyPatch>(patch);
501 List<Type> patchInfo;
503 labelList ownerIndex;
505 IPstream fromNeighbour
508 procPatch.neighbProcNo()
511 fromNeighbour >> owner >> ownerIndex >> patchInfo;
516 Pout<< "Processor patch " << patchI << ' ' << patch.name()
517 << " communicating with " << procPatch.neighbProcNo()
518 << " Received:" << patchInfo.size() << endl;
521 // Apply transform to received data for non-parallel planes
522 if (!procPatch.parallel())
524 transform(procPatch.forwardT(), patchInfo);
541 // 3. Handle all shared points
542 // (Note:irrespective if changed or not for now)
545 const globalMeshData& pd = mesh_.globalData();
547 List<Type> sharedData(pd.nGlobalPoints());
549 forAll(pd.sharedPointLabels(), i)
551 label meshPointI = pd.sharedPointLabels()[i];
553 // Fill my entries in the shared points
554 sharedData[pd.sharedPointAddr()[i]] = allPointInfo_[meshPointI];
557 // Combine on master. Reduce operator has to handle a list and call
558 // Type.updatePoint for all elements
559 combineReduce(sharedData, listUpdateOp<Type>());
561 forAll(pd.sharedPointLabels(), i)
563 label meshPointI = pd.sharedPointLabels()[i];
565 // Retrieve my entries from the shared points
569 sharedData[pd.sharedPointAddr()[i]],
571 allPointInfo_[meshPointI]
577 template <class Type>
578 void Foam::PointEdgeWave<Type>::handleCyclicPatches()
580 // 1. Send all point info on cyclic patches. Send as
581 // face label + offset in face.
585 forAll(mesh_.boundaryMesh(), patchI)
587 const polyPatch& patch = mesh_.boundaryMesh()[patchI];
589 if (isA<cyclicPolyPatch>(patch))
591 const primitivePatch& halfA = cycHalves_[cycHalf++];
592 const primitivePatch& halfB = cycHalves_[cycHalf++];
594 // HalfA : get all changed points in relative addressing
596 DynamicList<Type> halfAInfo(halfA.nPoints());
597 dynamicLabelList halfAPoints(halfA.nPoints());
598 dynamicLabelList halfAOwner(halfA.nPoints());
599 dynamicLabelList halfAIndex(halfA.nPoints());
601 getChangedPatchPoints
610 // HalfB : get all changed points in relative addressing
612 DynamicList<Type> halfBInfo(halfB.nPoints());
613 dynamicLabelList halfBPoints(halfB.nPoints());
614 dynamicLabelList halfBOwner(halfB.nPoints());
615 dynamicLabelList halfBIndex(halfB.nPoints());
617 getChangedPatchPoints
627 // HalfA : adapt for leaving domain
628 leaveDomain(patch, halfA, halfAPoints, halfAInfo);
630 // HalfB : adapt for leaving domain
631 leaveDomain(patch, halfB, halfBPoints, halfBInfo);
634 // Apply rotation for non-parallel planes
635 const cyclicPolyPatch& cycPatch =
636 refCast<const cyclicPolyPatch>(patch);
638 if (!cycPatch.parallel())
640 // received data from half1
641 transform(cycPatch.forwardT(), halfAInfo);
643 // received data from half2
644 transform(cycPatch.forwardT(), halfBInfo);
649 Pout<< "Cyclic patch " << patchI << ' ' << patch.name()
650 << " Changed on first half : " << halfAInfo.size()
651 << " Changed on second half : " << halfBInfo.size()
655 // Half1: update with data from halfB
665 // Half2: update with data from halfA
677 //checkCyclic(patch);
684 // Update overall for changed patch points
685 template <class Type>
686 void Foam::PointEdgeWave<Type>::updateFromPatchInfo
688 const ggiPolyPatch& to,
689 const labelListList& shadowAddr,
690 const labelList& owner,
691 const labelList& ownerIndex,
692 List<Type>& patchInfo
695 //const labelList& meshPoints = to.meshPoints();
696 const pointField& points = to.points();
697 const List<face>& allFaces = mesh_.allFaces();
701 label fID = to.shadow().zone()[owner[i]];
702 label pID = allFaces[fID][ownerIndex[i]];
703 point p = points[pID];
705 // Update in sending zone without propagation
706 if(fID >= mesh_.nFaces())
708 allPointInfo_[pID].updatePoint
717 const labelList& addr = shadowAddr[owner[i]];
721 label nearestPoint = -1;
722 label nearestFace = -1;
727 label fID2 = to.zone()[addr[saI]];
729 const face& f = allFaces[fID2];
734 scalar d = magSqr(points[pID2] - p);
742 else if(nearestPoint == pID2 && fID2 < mesh_.nFaces())
744 // Choose face in patch over face in zone
750 patchInfo[i].enterDomain(to, nearestPoint, points[nearestPoint]);
752 if(nearestFace < mesh_.nFaces())
754 // Update in receiving patch with propagation
760 allPointInfo_[nearestPoint]
765 // Update in receiving zone without propagation
766 allPointInfo_[nearestPoint].updatePoint
779 // Transfer all the information to/from neighbouring processors
780 template <class Type>
781 void Foam::PointEdgeWave<Type>::handleGgiPatches()
783 forAll(mesh_.boundaryMesh(), patchI)
785 const polyPatch& patch = mesh_.boundaryMesh()[patchI];
787 if (isA<ggiPolyPatch>(patch))
789 const ggiPolyPatch& master = refCast<const ggiPolyPatch>(patch);
790 const ggiPolyPatch& slave = master.shadow();
792 if(master.master() && (master.localParallel() || master.size()))
794 // 1. Collect all point info on master side
795 DynamicList<Type> masterInfo(master.nPoints());
796 dynamicLabelList masterOwner(master.nPoints());
797 dynamicLabelList masterOwnerIndex(master.nPoints());
800 dynamicLabelList patchPoints(master.nPoints());
802 // Get all changed points in relative addressing
803 getChangedPatchPoints
812 forAll(masterOwner, i)
815 master.zoneAddressing()[masterOwner[i]];
818 // Adapt for leaving domain
819 leaveDomain(master, master, patchPoints, masterInfo);
823 Pout<< "Ggi patch " << master.index() << ' ' << master.name()
824 << " Sending:" << masterInfo.size() << endl;
828 // 2. Collect all point info on slave side
829 DynamicList<Type> slaveInfo(slave.nPoints());
830 dynamicLabelList slaveOwner(slave.nPoints());
831 dynamicLabelList slaveOwnerIndex(slave.nPoints());
834 dynamicLabelList patchPoints(slave.nPoints());
836 // Get all changed points in relative addressing
837 getChangedPatchPoints
846 forAll(slaveOwner, i)
849 slave.zoneAddressing()[slaveOwner[i]];
852 // Adapt for leaving domain
853 leaveDomain(slave, slave, patchPoints, slaveInfo);
857 Pout<< "Ggi patch " << slave.index() << ' ' << slave.name()
858 << " Sending:" << slaveInfo.size() << endl;
863 if(!master.localParallel())
865 combineReduce(masterInfo, listAppendOp<Type>());
866 combineReduce(slaveInfo, listAppendOp<Type>());
867 combineReduce(masterOwner, listAppendOp<label>());
868 combineReduce(slaveOwner, listAppendOp<label>());
869 combineReduce(masterOwnerIndex, listAppendOp<label>());
870 combineReduce(slaveOwnerIndex, listAppendOp<label>());
873 // 3. Apply point info on master & slave side
877 Pout<< "Ggi patch " << slave.index() << ' ' << slave.name()
878 << " Received:" << masterInfo.size() << endl;
879 Pout<< "Ggi patch " << master.index() << ' ' << master.name()
880 << " Received:" << slaveInfo.size() << endl;
883 // Apply transform to received data for non-parallel planes
884 if (!master.parallel())
886 transform(master.forwardT(), masterInfo);
887 transform(slave.forwardT(), slaveInfo);
893 master.patchToPatch().masterAddr(),
902 master.patchToPatch().slaveAddr(),
913 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
915 // Iterate, propagating changedPointsInfo across mesh, until no change (or
916 // maxIter reached). Initial point values specified.
917 template <class Type>
918 Foam::PointEdgeWave<Type>::PointEdgeWave
920 const polyMesh& mesh,
921 const labelList& changedPoints,
922 const List<Type>& changedPointsInfo,
924 List<Type>& allPointInfo,
925 List<Type>& allEdgeInfo,
931 allPointInfo_(allPointInfo),
932 allEdgeInfo_(allEdgeInfo),
933 changedPoint_(mesh_.nPoints(), false),
934 changedPoints_(mesh_.nPoints()),
936 changedEdge_(mesh_.nEdges(), false),
937 changedEdges_(mesh_.nEdges()),
939 nCyclicPatches_(countPatchType<cyclicPolyPatch>()),
940 nGgiPatches_(countPatchType<ggiPolyPatch>()),
941 cycHalves_(2*nCyclicPatches_),
943 nUnvisitedPoints_(mesh_.nPoints()),
944 nUnvisitedEdges_(mesh_.nEdges())
948 allPointInfo_.size() != mesh_.nPoints()
949 && allPointInfo_.size() != mesh_.allPoints().size()
954 "PointEdgeWave<Type>::PointEdgeWave"
955 "(const polyMesh&, const labelList&, const List<Type>,"
956 " List<Type>&, List<Type>&, const label maxIter)"
957 ) << "size of pointInfo work array is not equal to the number"
958 << " of points in the mesh" << endl
959 << " pointInfo :" << allPointInfo_.size() << endl
960 << " mesh.nPoints:" << mesh_.nPoints()
963 if (allEdgeInfo_.size() != mesh_.nEdges())
967 "PointEdgeWave<Type>::PointEdgeWave"
968 "(const polyMesh&, const labelList&, const List<Type>,"
969 " List<Type>&, List<Type>&, const label maxIter)"
970 ) << "size of edgeInfo work array is not equal to the number"
971 << " of edges in the mesh" << endl
972 << " edgeInfo :" << allEdgeInfo_.size() << endl
973 << " mesh.nEdges:" << mesh_.nEdges()
978 // Calculate cyclic halves addressing.
979 if (nCyclicPatches_ > 0)
981 calcCyclicAddressing();
985 // Set from initial changed points data
986 setPointInfo(changedPoints, changedPointsInfo);
990 Pout<< "Seed points : " << nChangedPoints_ << endl;
993 // Iterate until nothing changes
994 label iter = iterate(maxIter);
996 if ((maxIter > 0) && (iter >= maxIter))
1000 "PointEdgeWave<Type>::PointEdgeWave"
1001 "(const polyMesh&, const labelList&, const List<Type>,"
1002 " List<Type>&, List<Type>&, const label maxIter)"
1003 ) << "Maximum number of iterations reached. Increase maxIter." << nl
1004 << " maxIter:" << maxIter << endl
1005 << " nChangedPoints:" << nChangedPoints_ << endl
1006 << " nChangedEdges:" << nChangedEdges_ << endl
1007 << exit(FatalError);
1012 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
1014 template <class Type>
1015 Foam::PointEdgeWave<Type>::~PointEdgeWave()
1019 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
1022 template <class Type>
1023 Foam::label Foam::PointEdgeWave<Type>::getUnsetPoints() const
1025 return nUnvisitedPoints_;
1029 template <class Type>
1030 Foam::label Foam::PointEdgeWave<Type>::getUnsetEdges() const
1032 return nUnvisitedEdges_;
1036 // Copy point information into member data
1037 template <class Type>
1038 void Foam::PointEdgeWave<Type>::setPointInfo
1040 const labelList& changedPoints,
1041 const List<Type>& changedPointsInfo
1044 forAll(changedPoints, changedPointI)
1046 label pointI = changedPoints[changedPointI];
1048 bool wasValid = allPointInfo_[pointI].valid();
1050 // Copy info for pointI
1051 allPointInfo_[pointI] = changedPointsInfo[changedPointI];
1053 // Maintain count of unset points
1054 if (!wasValid && allPointInfo_[pointI].valid())
1056 --nUnvisitedPoints_;
1059 // Mark pointI as changed, both on list and on point itself.
1061 if (!changedPoint_[pointI])
1063 changedPoint_[pointI] = true;
1064 changedPoints_[nChangedPoints_++] = pointI;
1070 // Propagate information from edge to point. Return number of points changed.
1071 template <class Type>
1072 Foam::label Foam::PointEdgeWave<Type>::edgeToPoint()
1076 label changedEdgeI = 0;
1077 changedEdgeI < nChangedEdges_;
1081 label edgeI = changedEdges_[changedEdgeI];
1083 if (!changedEdge_[edgeI])
1085 FatalErrorIn("PointEdgeWave<Type>::edgeToPoint()")
1087 << " not marked as having been changed" << nl
1088 << "This might be caused by multiple occurences of the same"
1089 << " seed point." << abort(FatalError);
1093 const Type& neighbourWallInfo = allEdgeInfo_[edgeI];
1095 // Evaluate all connected points (= edge endpoints)
1096 const edge& e = mesh_.edges()[edgeI];
1100 Type& currentWallInfo = allPointInfo_[e[eI]];
1102 if (currentWallInfo != neighbourWallInfo)
1115 // Reset status of edge
1116 changedEdge_[edgeI] = false;
1119 // Handled all changed edges by now
1122 if (nCyclicPatches_ > 0)
1124 // Transfer changed points across cyclic halves
1125 handleCyclicPatches();
1127 if (nGgiPatches_ > 0)
1129 // Transfer changed points across cyclic halves
1132 if (Pstream::parRun())
1134 // Transfer changed points from neighbouring processors.
1135 handleProcPatches();
1140 Pout<< "Changed points : " << nChangedPoints_ << endl;
1143 // Sum nChangedPoints over all procs
1144 label totNChanged = nChangedPoints_;
1146 reduce(totNChanged, sumOp<label>());
1152 // Propagate information from point to edge. Return number of edges changed.
1153 template <class Type>
1154 Foam::label Foam::PointEdgeWave<Type>::pointToEdge()
1156 const labelListList& pointEdges = mesh_.pointEdges();
1160 label changedPointI = 0;
1161 changedPointI < nChangedPoints_;
1165 label pointI = changedPoints_[changedPointI];
1167 if (!changedPoint_[pointI])
1169 FatalErrorIn("PointEdgeWave<Type>::pointToEdge()")
1170 << "Point " << pointI
1171 << " not marked as having been changed" << nl
1172 << "This might be caused by multiple occurences of the same"
1173 << " seed point." << abort(FatalError);
1176 const Type& neighbourWallInfo = allPointInfo_[pointI];
1178 // Evaluate all connected edges
1180 const labelList& edgeLabels = pointEdges[pointI];
1181 forAll(edgeLabels, edgeLabelI)
1183 label edgeI = edgeLabels[edgeLabelI];
1185 Type& currentWallInfo = allEdgeInfo_[edgeI];
1187 if (currentWallInfo != neighbourWallInfo)
1200 // Reset status of point
1201 changedPoint_[pointI] = false;
1204 // Handled all changed points by now
1205 nChangedPoints_ = 0;
1209 Pout<< "Changed edges : " << nChangedEdges_ << endl;
1212 // Sum nChangedPoints over all procs
1213 label totNChanged = nChangedEdges_;
1215 reduce(totNChanged, sumOp<label>());
1222 template <class Type>
1223 Foam::label Foam::PointEdgeWave<Type>::iterate(const label maxIter)
1225 if (nCyclicPatches_ > 0)
1227 // Transfer changed points across cyclic halves
1228 handleCyclicPatches();
1230 if (nGgiPatches_ > 0)
1232 // Transfer changed points across ggi patches
1235 if (Pstream::parRun())
1237 // Transfer changed points from neighbouring processors.
1238 handleProcPatches();
1245 while(iter < maxIter)
1249 Pout<< "Iteration " << iter << endl;
1252 label nEdges = pointToEdge();
1256 Pout<< "Total changed edges : " << nEdges << endl;
1264 label nPoints = edgeToPoint();
1268 Pout<< "Total changed points : " << nPoints << endl;
1270 Pout<< "Total evaluations : " << nEvals_ << endl;
1272 Pout<< "Remaining unvisited points: " << nUnvisitedPoints_ << endl;
1274 Pout<< "Remaining unvisited edges : " << nUnvisitedEdges_ << endl;
1291 // ************************************************************************* //