diff --git a/src/OpenFOAM/algorithms/MeshWave/FaceCellWave.C b/src/OpenFOAM/algorithms/MeshWave/FaceCellWave.C index 060666e02fdc893803e11f5173a2b7cb8f3b2d91..95539965cec43cf5dc225c6259b830b2e4c2117c 100644 --- a/src/OpenFOAM/algorithms/MeshWave/FaceCellWave.C +++ b/src/OpenFOAM/algorithms/MeshWave/FaceCellWave.C @@ -40,8 +40,7 @@ const Foam::scalar Foam::FaceCellWave<Type, TrackingData>::geomTol_ = 1e-6; template <class Type, class TrackingData> -const Foam::scalar -Foam::FaceCellWave<Type, TrackingData>::propagationTol_ = 0.01; +Foam::scalar Foam::FaceCellWave<Type, TrackingData>::propagationTol_ = 0.01; template <class Type, class TrackingData> Foam::label Foam::FaceCellWave<Type, TrackingData>::dummyTrackData_ = 12345; @@ -516,8 +515,8 @@ void Foam::FaceCellWave<Type, TrackingData>::handleProcPatches() refCast<const processorPolyPatch>(patch); // Allocate buffers - labelList receiveFaces(patch.size()); - List<Type> receiveFacesInfo(patch.size()); + labelList receiveFaces; + List<Type> receiveFacesInfo; { UIPstream fromNeighbour(procPatch.neighbProcNo(), pBufs); @@ -675,8 +674,7 @@ Foam::FaceCellWave<Type, TrackingData>::FaceCellWave hasCyclicPatches_(hasCyclicPatch()), nEvals_(0), nUnvisitedCells_(mesh_.nCells()), - nUnvisitedFaces_(mesh_.nFaces()), - iter_(0) + nUnvisitedFaces_(mesh_.nFaces()) {} @@ -707,16 +705,15 @@ Foam::FaceCellWave<Type, TrackingData>::FaceCellWave hasCyclicPatches_(hasCyclicPatch()), nEvals_(0), nUnvisitedCells_(mesh_.nCells()), - nUnvisitedFaces_(mesh_.nFaces()), - iter_(0) + nUnvisitedFaces_(mesh_.nFaces()) { // Copy initial changed faces data setFaceInfo(changedFaces, changedFacesInfo); // Iterate until nothing changes - iterate(maxIter); + label iter = iterate(maxIter); - if ((maxIter > 0) && (iter_ >= maxIter)) + if ((maxIter > 0) && (iter >= maxIter)) { FatalErrorIn ( @@ -796,7 +793,7 @@ Foam::label Foam::FaceCellWave<Type, TrackingData>::faceToCell() ); } - // Neighbour. Hack for check if face has neighbour. + // Neighbour. if (faceI < nInternalFaces) { cellI = neighbour[faceI]; @@ -927,11 +924,13 @@ Foam::label Foam::FaceCellWave<Type, TrackingData>::iterate(const label maxIter) handleProcPatches(); } - while (iter_ < maxIter) + label iter = 0; + + while (iter < maxIter) { if (debug) { - Pout<< " Iteration " << iter_ << endl; + Pout<< " Iteration " << iter << endl; } nEvals_ = 0; @@ -963,10 +962,11 @@ Foam::label Foam::FaceCellWave<Type, TrackingData>::iterate(const label maxIter) break; } - ++iter_; + ++iter; } - return nUnvisitedCells_; + return iter; } + // ************************************************************************* // diff --git a/src/OpenFOAM/algorithms/MeshWave/FaceCellWave.H b/src/OpenFOAM/algorithms/MeshWave/FaceCellWave.H index 6ad8a1ae32ed3f75262603341a54d5ce58ccc6ba..2824d8e13a14cd7af28694d66c43a6745583e18c 100644 --- a/src/OpenFOAM/algorithms/MeshWave/FaceCellWave.H +++ b/src/OpenFOAM/algorithms/MeshWave/FaceCellWave.H @@ -114,9 +114,6 @@ class FaceCellWave label nUnvisitedCells_; label nUnvisitedFaces_; - //- Iteration counter - label iter_; - // Private Member Functions @@ -232,7 +229,7 @@ class FaceCellWave // Private static data static const scalar geomTol_; - static const scalar propagationTol_; + static scalar propagationTol_; //- Used as default trackdata value to satisfy default template // argument. @@ -340,8 +337,8 @@ public: // counted double) label cellToFace(); - //- Iterate until no changes or maxIter reached. Returns number of - // unset cells (see getUnsetCells) + //- Iterate until no changes or maxIter reached. Returns actual + // number of iterations. label iterate(const label maxIter); }; diff --git a/src/OpenFOAM/algorithms/MeshWave/MeshWave.H b/src/OpenFOAM/algorithms/MeshWave/MeshWave.H index a93d01cfabfdbd258b66f462879d66939cea28b4..d48f3c69aad18a9cac36c2ae795f2de50566c620 100644 --- a/src/OpenFOAM/algorithms/MeshWave/MeshWave.H +++ b/src/OpenFOAM/algorithms/MeshWave/MeshWave.H @@ -134,8 +134,8 @@ public: return calc_.data(); } - //- Iterate until no changes or maxIter reached. Returns number of - // unset cells (see getUnsetCells) + //- Iterate until no changes or maxIter reached. Returns actual + // number of iterations. label iterate(const label maxIter) { return calc_.iterate(maxIter);