diff --git a/src/OpenFOAM/fields/pointPatchFields/constraint/processorCyclic/processorCyclicPointPatchField.C b/src/OpenFOAM/fields/pointPatchFields/constraint/processorCyclic/processorCyclicPointPatchField.C index 8dee733480..0554b28a9c 100644 --- a/src/OpenFOAM/fields/pointPatchFields/constraint/processorCyclic/processorCyclicPointPatchField.C +++ b/src/OpenFOAM/fields/pointPatchFields/constraint/processorCyclic/processorCyclicPointPatchField.C @@ -95,19 +95,19 @@ void Foam::processorCyclicPointPatchField::initSwapAddSeparated { if (Pstream::parRun()) { - // Get internal field into correct order for opposite side - Field pf + // Get internal field into correct order for opposite side. Note use + // of member data buffer since using non-blocking. Could be optimised + // out if not using non-blocking... + sendBuf_ = this->patchInternalField ( - this->patchInternalField - ( - pField, - procPatch_.reverseMeshPoints() - ) + pField, + procPatch_.reverseMeshPoints() ); if (commsType == Pstream::commsTypes::nonBlocking) { - recvBuf_.resize_nocopy(pf.size()); + recvBuf_.resize_nocopy(sendBuf_.size()); + UIPstream::read ( commsType, @@ -122,8 +122,8 @@ void Foam::processorCyclicPointPatchField::initSwapAddSeparated ( commsType, procPatch_.neighbProcNo(), - pf.cdata_bytes(), - pf.size_bytes(), + sendBuf_.cdata_bytes(), + sendBuf_.size_bytes(), procPatch_.tag(), procPatch_.comm() ); diff --git a/src/OpenFOAM/fields/pointPatchFields/constraint/processorCyclic/processorCyclicPointPatchField.H b/src/OpenFOAM/fields/pointPatchFields/constraint/processorCyclic/processorCyclicPointPatchField.H index b4d5a5396a..7dd46e4f74 100644 --- a/src/OpenFOAM/fields/pointPatchFields/constraint/processorCyclic/processorCyclicPointPatchField.H +++ b/src/OpenFOAM/fields/pointPatchFields/constraint/processorCyclic/processorCyclicPointPatchField.H @@ -60,6 +60,9 @@ class processorCyclicPointPatchField //- Local reference to processor patch const processorCyclicPointPatch& procPatch_; + //- Send buffer for non-blocking communication + mutable Field sendBuf_; + //- Receive buffer for non-blocking communication mutable Field recvBuf_;