41 procPatch_(refCast<const processorFvPatch>(p)),
44 outstandingSendRequest_(-1),
45 outstandingRecvRequest_(-1),
60 procPatch_(refCast<const processorFvPatch>(p)),
63 outstandingSendRequest_(-1),
64 outstandingRecvRequest_(-1),
80 procPatch_(refCast<const processorFvPatch>(p)),
83 outstandingSendRequest_(-1),
84 outstandingRecvRequest_(-1),
88 if (!isA<processorFvPatch>(this->patch()))
91 <<
"' not constraint type '" << typeName <<
"'" 92 <<
"\n for patch " << p.name()
93 <<
" of field " << this->internalField().name()
94 <<
" in file " << this->internalField().objectPath()
97 if (debug && !ptf.
ready())
100 <<
"On patch " << procPatch_.name() <<
" outstanding request." 115 procPatch_(refCast<const processorFvPatch>(p)),
118 outstandingSendRequest_(-1),
119 outstandingRecvRequest_(-1),
123 if (!isA<processorFvPatch>(p))
128 ) <<
"\n patch type '" << p.type()
129 <<
"' not constraint type '" << typeName <<
"'" 130 <<
"\n for patch " << p.name()
131 <<
" of field " << this->internalField().name()
132 <<
" in file " << this->internalField().objectPath()
146 procPatch_(refCast<const processorFvPatch>(ptf.
patch())),
147 sendBuf_(ptf.sendBuf_.xfer()),
148 receiveBuf_(ptf.receiveBuf_.xfer()),
149 outstandingSendRequest_(-1),
150 outstandingRecvRequest_(-1),
151 scalarSendBuf_(ptf.scalarSendBuf_.
xfer()),
152 scalarReceiveBuf_(ptf.scalarReceiveBuf_.
xfer())
154 if (debug && !ptf.
ready())
157 <<
"On patch " << procPatch_.name() <<
" outstanding request." 171 procPatch_(refCast<const processorFvPatch>(ptf.
patch())),
174 outstandingSendRequest_(-1),
175 outstandingRecvRequest_(-1),
179 if (debug && !ptf.
ready())
182 <<
"On patch " << procPatch_.name() <<
" outstanding request." 201 if (debug && !this->ready())
204 <<
"On patch " << procPatch_.name()
205 <<
" outstanding request." 218 if (Pstream::parRun())
220 this->patchInternalField(sendBuf_);
222 if (commsType == Pstream::nonBlocking && !Pstream::floatTransfer)
225 this->
setSize(sendBuf_.size());
226 outstandingRecvRequest_ = UPstream::nRequests();
229 Pstream::nonBlocking,
230 procPatch_.neighbProcNo(),
231 reinterpret_cast<char*
>(this->begin()),
237 outstandingSendRequest_ = UPstream::nRequests();
240 Pstream::nonBlocking,
241 procPatch_.neighbProcNo(),
242 reinterpret_cast<const char*
>(sendBuf_.begin()),
250 procPatch_.compressedSend(commsType, sendBuf_);
262 if (Pstream::parRun())
264 if (commsType == Pstream::nonBlocking && !Pstream::floatTransfer)
270 outstandingRecvRequest_ >= 0
271 && outstandingRecvRequest_ < Pstream::nRequests()
274 UPstream::waitRequest(outstandingRecvRequest_);
276 outstandingSendRequest_ = -1;
277 outstandingRecvRequest_ = -1;
281 procPatch_.compressedReceive<Type>(commsType, *
this);
286 transform(*
this, procPatch_.forwardT(), *
this);
299 return deltaCoeffs*(*
this - this->patchInternalField());
313 this->patch().patchInternalField(psiInternal, scalarSendBuf_);
315 if (commsType == Pstream::nonBlocking && !Pstream::floatTransfer)
318 if (debug && !this->ready())
321 <<
"On patch " << procPatch_.name()
322 <<
" outstanding request." 327 scalarReceiveBuf_.setSize(scalarSendBuf_.size());
328 outstandingRecvRequest_ = UPstream::nRequests();
331 Pstream::nonBlocking,
332 procPatch_.neighbProcNo(),
333 reinterpret_cast<char*
>(scalarReceiveBuf_.begin()),
334 scalarReceiveBuf_.byteSize(),
339 outstandingSendRequest_ = UPstream::nRequests();
342 Pstream::nonBlocking,
343 procPatch_.neighbProcNo(),
344 reinterpret_cast<const char*
>(scalarSendBuf_.begin()),
345 scalarSendBuf_.byteSize(),
352 procPatch_.compressedSend(commsType, scalarSendBuf_);
369 if (this->updatedMatrix())
374 const labelUList& faceCells = this->patch().faceCells();
376 if (commsType == Pstream::nonBlocking && !Pstream::floatTransfer)
381 outstandingRecvRequest_ >= 0
382 && outstandingRecvRequest_ < Pstream::nRequests()
385 UPstream::waitRequest(outstandingRecvRequest_);
388 outstandingSendRequest_ = -1;
389 outstandingRecvRequest_ = -1;
394 transformCoupleField(scalarReceiveBuf_, cmpt);
399 result[faceCells[elemI]] -= coeffs[elemI]*scalarReceiveBuf_[elemI];
406 procPatch_.compressedReceive<scalar>(commsType, this->size())()
410 transformCoupleField(pnf, cmpt);
415 result[faceCells[elemI]] -= coeffs[elemI]*pnf[elemI];
432 this->patch().patchInternalField(psiInternal, sendBuf_);
434 if (commsType == Pstream::nonBlocking && !Pstream::floatTransfer)
437 if (debug && !this->ready())
440 <<
"On patch " << procPatch_.name()
441 <<
" outstanding request." 446 receiveBuf_.setSize(sendBuf_.size());
447 outstandingRecvRequest_ = UPstream::nRequests();
450 Pstream::nonBlocking,
451 procPatch_.neighbProcNo(),
452 reinterpret_cast<char*
>(receiveBuf_.begin()),
453 receiveBuf_.byteSize(),
458 outstandingSendRequest_ = UPstream::nRequests();
461 Pstream::nonBlocking,
462 procPatch_.neighbProcNo(),
463 reinterpret_cast<const char*
>(sendBuf_.begin()),
471 procPatch_.compressedSend(commsType, sendBuf_);
487 if (this->updatedMatrix())
492 const labelUList& faceCells = this->patch().faceCells();
494 if (commsType == Pstream::nonBlocking && !Pstream::floatTransfer)
499 outstandingRecvRequest_ >= 0
500 && outstandingRecvRequest_ < Pstream::nRequests()
503 UPstream::waitRequest(outstandingRecvRequest_);
506 outstandingSendRequest_ = -1;
507 outstandingRecvRequest_ = -1;
512 transformCoupleField(receiveBuf_);
517 result[faceCells[elemI]] -= coeffs[elemI]*receiveBuf_[elemI];
524 procPatch_.compressedReceive<Type>(commsType, this->size())()
528 transformCoupleField(pnf);
533 result[faceCells[elemI]] -= coeffs[elemI]*pnf[elemI];
546 outstandingSendRequest_ >= 0
547 && outstandingSendRequest_ < Pstream::nRequests()
550 bool finished = UPstream::finishedRequest(outstandingSendRequest_);
556 outstandingSendRequest_ = -1;
560 outstandingRecvRequest_ >= 0
561 && outstandingRecvRequest_ < Pstream::nRequests()
564 bool finished = UPstream::finishedRequest(outstandingRecvRequest_);
570 outstandingRecvRequest_ = -1;
const fvPatch & patch() const
Return patch.
#define forAll(list, i)
Loop across all elements in list.
errorManipArg< error, int > exit(error &err, const int errNo=1)
virtual void initEvaluate(const Pstream::commsTypes commsType)
Initialise the evaluation of the patch field.
A list of keyword definitions, which are a keyword followed by any number of values (e...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Xfer< List< T > > xfer()
Transfer contents to the Xfer container.
commsTypes
Types of communications.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
virtual bool ready() const
Is all data available.
points setSize(newPointi)
virtual bool ready() const
Is all data available.
bool read(const char *, int32_t &)
Abstract base class for processor coupled interfaces.
~processorFvPatchField()
Destructor.
Pre-declare SubField and related Field type.
Foam::fvPatchFieldMapper.
virtual void initInterfaceMatrixUpdate(scalarField &result, const scalarField &psiInternal, const scalarField &coeffs, const direction cmpt, const Pstream::commsTypes commsType) const
Initialise neighbour matrix update.
bool updatedMatrix() const
Whether matrix has been updated.
virtual tmp< Field< Type > > patchNeighbourField() const
Return neighbour field given internal field.
errorManip< error > abort(error &err)
Abstract base class for coupled patches.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
virtual tmp< Field< Type > > snGrad() const
Return patch-normal gradient.
virtual void evaluate(const Pstream::commsTypes commsType)
Evaluate the patch field.
Template functions to aid in the implementation of demand driven data.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
This boundary condition enables processor communication across patches.
A class for managing temporary objects.
virtual void updateInterfaceMatrix(scalarField &result, const scalarField &psiInternal, const scalarField &coeffs, const direction cmpt, const Pstream::commsTypes commsType) const
Update result field based on interface functionality.
processorFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
dimensionSet transform(const dimensionSet &)