diff --git a/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalPoints.C b/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalPoints.C index f34b7c542d..5466f41130 100644 --- a/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalPoints.C +++ b/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalPoints.C @@ -891,19 +891,22 @@ void Foam::globalPoints::calculateSharedPoints // a point or edge. initOwnPoints(meshToPatchPoint, true, changedPoints); + // Note: to use 'scheduled' would have to intersperse send and receive. + // So for now just use nonBlocking. Also globalPoints itself gets + // constructed by mesh.globalData().patchSchedule() so creates a loop. + PstreamBuffers pBufs + ( + ( + Pstream::defaultCommsType == Pstream::commsTypes::scheduled + ? Pstream::commsTypes::nonBlocking + : Pstream::defaultCommsType + ) + ); + // Do one exchange iteration to get neighbour points. { - // Note: to use 'scheduled' would have to intersperse send and receive. - // So for now just use nonBlocking. Also globalPoints itself gets - // constructed by mesh.globalData().patchSchedule() so creates a loop. - PstreamBuffers pBufs - ( - ( - Pstream::defaultCommsType == Pstream::commsTypes::scheduled - ? Pstream::commsTypes::nonBlocking - : Pstream::defaultCommsType - ) - ); + pBufs.clear(); + sendPatchPoints ( mergeSeparated, @@ -911,7 +914,9 @@ void Foam::globalPoints::calculateSharedPoints pBufs, changedPoints ); + pBufs.finishedSends(); + receivePatchPoints ( mergeSeparated, @@ -933,14 +938,8 @@ void Foam::globalPoints::calculateSharedPoints do { - PstreamBuffers pBufs - ( - ( - Pstream::defaultCommsType == Pstream::commsTypes::scheduled - ? Pstream::commsTypes::nonBlocking - : Pstream::defaultCommsType - ) - ); + pBufs.clear(); + sendPatchPoints ( mergeSeparated, @@ -948,7 +947,9 @@ void Foam::globalPoints::calculateSharedPoints pBufs, changedPoints ); + pBufs.finishedSends(); + receivePatchPoints ( mergeSeparated, diff --git a/src/dynamicMesh/polyTopoChange/polyTopoChange/addPatchCellLayer.C b/src/dynamicMesh/polyTopoChange/polyTopoChange/addPatchCellLayer.C index 8802246e92..f0441afd67 100644 --- a/src/dynamicMesh/polyTopoChange/polyTopoChange/addPatchCellLayer.C +++ b/src/dynamicMesh/polyTopoChange/polyTopoChange/addPatchCellLayer.C @@ -452,31 +452,6 @@ Foam::label Foam::addPatchCellLayer::addSideFace } -Foam::label Foam::addPatchCellLayer::findProcPatch -( - const polyMesh& mesh, - const label nbrProcID -) -{ - const polyBoundaryMesh& patches = mesh.boundaryMesh(); - - forAll(mesh.globalData().processorPatches(), i) - { - label patchi = mesh.globalData().processorPatches()[i]; - - if - ( - refCast(patches[patchi]).neighbProcNo() - == nbrProcID - ) - { - return patchi; - } - } - return -1; -} - - void Foam::addPatchCellLayer::setFaceProps ( const polyMesh& mesh, diff --git a/src/dynamicMesh/polyTopoChange/polyTopoChange/addPatchCellLayer.H b/src/dynamicMesh/polyTopoChange/polyTopoChange/addPatchCellLayer.H index b0d12af7ed..fe59a8f608 100644 --- a/src/dynamicMesh/polyTopoChange/polyTopoChange/addPatchCellLayer.H +++ b/src/dynamicMesh/polyTopoChange/polyTopoChange/addPatchCellLayer.H @@ -202,9 +202,6 @@ class addPatchCellLayer polyTopoChange& ) const; - //- Find patch to neighbouring processor - static label findProcPatch(const polyMesh&, const label nbrProcID); - //- Extract properties from mesh face static void setFaceProps ( diff --git a/src/meshTools/algorithms/MeshWave/FaceCellWave.C b/src/meshTools/algorithms/MeshWave/FaceCellWave.C index aeb8930324..325f93ba94 100644 --- a/src/meshTools/algorithms/MeshWave/FaceCellWave.C +++ b/src/meshTools/algorithms/MeshWave/FaceCellWave.C @@ -526,13 +526,15 @@ void Foam::FaceCellWave::handleProcPatches() // Which patches are processor patches const labelList& procPatches = pData.processorPatches(); - // Send all + // Which processors this processor is connected to + const labelList& neighbourProcs = pData.topology().procNeighbours(); - PstreamBuffers pBufs(Pstream::commsTypes::nonBlocking); + // Reset buffers + pBufs_.clear(); for (const label patchi : procPatches) { - const processorPolyPatch& procPatch = + const auto& procPatch = refCast(mesh_.boundaryMesh()[patchi]); // Allocate buffers @@ -567,20 +569,20 @@ void Foam::FaceCellWave::handleProcPatches() << endl; } - UOPstream toNeighbour(procPatch.neighbProcNo(), pBufs); + UOPstream toNeighbour(procPatch.neighbProcNo(), pBufs_); //writeFaces(nSendFaces, sendFaces, sendFacesInfo, toNeighbour); toNeighbour << SubList