diff --git a/src/OpenFOAM/algorithms/MeshWave/FaceCellWave.C b/src/OpenFOAM/algorithms/MeshWave/FaceCellWave.C index a85e071ba5..017c20d692 100644 --- a/src/OpenFOAM/algorithms/MeshWave/FaceCellWave.C +++ b/src/OpenFOAM/algorithms/MeshWave/FaceCellWave.C @@ -466,40 +466,6 @@ void Foam::FaceCellWave::transform } -// Send face info to neighbour. -template -void Foam::FaceCellWave::sendPatchInfo -( - const label neighbour, - const label nFaces, - const labelList& faceLabels, - const List& faceInfo -) const -{ - OPstream toNeighbour(Pstream::blocking, neighbour); - - writeFaces(nFaces, faceLabels, faceInfo, toNeighbour); -} - - -// Receive face info from neighbour -template -Foam::label Foam::FaceCellWave::receivePatchInfo -( - const label neighbour, - labelList& faceLabels, - List& faceInfo -) const -{ - IPstream fromNeighbour(Pstream::blocking, neighbour); - - label nFaces = 0; - readFaces(nFaces, faceLabels, faceInfo, fromNeighbour); - - return nFaces; -} - - // Offset mesh face. Used for transferring from one cyclic half to the other. template void Foam::FaceCellWave::offset @@ -523,6 +489,8 @@ void Foam::FaceCellWave::handleProcPatches() { // Send all + PstreamBuffers pBufs(Pstream::nonBlocking); + forAll(mesh_.boundaryMesh(), patchI) { const polyPatch& patch = mesh_.boundaryMesh()[patchI]; @@ -564,16 +532,13 @@ void Foam::FaceCellWave::handleProcPatches() << endl; } - sendPatchInfo - ( - procPatch.neighbProcNo(), - nSendFaces, - sendFaces, - sendFacesInfo - ); + UOPstream toNeighbour(procPatch.neighbProcNo(), pBufs); + writeFaces(nSendFaces, sendFaces, sendFacesInfo, toNeighbour); } } + pBufs.finishedSends(); + // Receive all forAll(mesh_.boundaryMesh(), patchI) @@ -586,16 +551,20 @@ void Foam::FaceCellWave::handleProcPatches() refCast(patch); // Allocate buffers - label nReceiveFaces; + label nReceiveFaces = 0; labelList receiveFaces(patch.size()); List receiveFacesInfo(patch.size()); - nReceiveFaces = receivePatchInfo - ( - procPatch.neighbProcNo(), - receiveFaces, - receiveFacesInfo - ); + { + UIPstream fromNeighbour(procPatch.neighbProcNo(), pBufs); + readFaces + ( + nReceiveFaces, + receiveFaces, + receiveFacesInfo, + fromNeighbour + ); + } if (debug) { diff --git a/src/OpenFOAM/algorithms/MeshWave/FaceCellWave.H b/src/OpenFOAM/algorithms/MeshWave/FaceCellWave.H index 00c89d415b..6bf08d8e92 100644 --- a/src/OpenFOAM/algorithms/MeshWave/FaceCellWave.H +++ b/src/OpenFOAM/algorithms/MeshWave/FaceCellWave.H @@ -225,23 +225,6 @@ class FaceCellWave List& faceInfo ) const; - //- Send info to neighbour - void sendPatchInfo - ( - const label neighbour, - const label nFaces, - const labelList&, - const List& - ) const; - - //- Receive info from neighbour. Returns number of faces received. - label receivePatchInfo - ( - const label neighbour, - labelList&, - List& - ) const; - //- Offset face labels by constant value static void offset (