41 procPatch_(refCast<const processorFvPatch>(p)),
44 outstandingSendRequest_(-1),
45 outstandingRecvRequest_(-1),
60 procPatch_(refCast<const processorFvPatch>(p)),
63 outstandingSendRequest_(-1),
64 outstandingRecvRequest_(-1),
79 procPatch_(refCast<const processorFvPatch>(p)),
82 outstandingSendRequest_(-1),
83 outstandingRecvRequest_(-1),
87 if (!isA<processorFvPatch>(p))
92 ) <<
"\n patch type '" << p.type()
93 <<
"' not constraint type '" << typeName <<
"'" 94 <<
"\n for patch " << p.name()
95 <<
" of field " << this->internalField().name()
96 <<
" in file " << this->internalField().objectPath()
101 if (!dict.found(
"value"))
118 procPatch_(refCast<const processorFvPatch>(p)),
121 outstandingSendRequest_(-1),
122 outstandingRecvRequest_(-1),
126 if (!isA<processorFvPatch>(this->patch()))
129 <<
"' not constraint type '" << typeName <<
"'" 130 <<
"\n for patch " << p.name()
131 <<
" of field " << this->internalField().name()
132 <<
" in file " << this->internalField().objectPath()
135 if (debug && !ptf.
ready())
138 <<
"On patch " << procPatch_.name() <<
" outstanding request." 152 procPatch_(refCast<const processorFvPatch>(ptf.
patch())),
153 sendBuf_(ptf.sendBuf_.xfer()),
154 receiveBuf_(ptf.receiveBuf_.xfer()),
155 outstandingSendRequest_(-1),
156 outstandingRecvRequest_(-1),
157 scalarSendBuf_(ptf.scalarSendBuf_.
xfer()),
158 scalarReceiveBuf_(ptf.scalarReceiveBuf_.
xfer())
160 if (debug && !ptf.
ready())
163 <<
"On patch " << procPatch_.name() <<
" outstanding request." 177 procPatch_(refCast<const processorFvPatch>(ptf.
patch())),
180 outstandingSendRequest_(-1),
181 outstandingRecvRequest_(-1),
185 if (debug && !ptf.
ready())
188 <<
"On patch " << procPatch_.name() <<
" outstanding request." 207 if (debug && !this->ready())
210 <<
"On patch " << procPatch_.name()
211 <<
" outstanding request." 224 if (Pstream::parRun())
226 this->patchInternalField(sendBuf_);
230 commsType == Pstream::commsTypes::nonBlocking
231 && !Pstream::floatTransfer
235 this->
setSize(sendBuf_.size());
236 outstandingRecvRequest_ = UPstream::nRequests();
239 Pstream::commsTypes::nonBlocking,
240 procPatch_.neighbProcNo(),
241 reinterpret_cast<char*
>(this->begin()),
247 outstandingSendRequest_ = UPstream::nRequests();
250 Pstream::commsTypes::nonBlocking,
251 procPatch_.neighbProcNo(),
252 reinterpret_cast<const char*
>(sendBuf_.begin()),
260 procPatch_.compressedSend(commsType, sendBuf_);
272 if (Pstream::parRun())
276 commsType == Pstream::commsTypes::nonBlocking
277 && !Pstream::floatTransfer
284 outstandingRecvRequest_ >= 0
285 && outstandingRecvRequest_ < Pstream::nRequests()
288 UPstream::waitRequest(outstandingRecvRequest_);
290 outstandingSendRequest_ = -1;
291 outstandingRecvRequest_ = -1;
295 procPatch_.compressedReceive<Type>(commsType, *
this);
300 transform(*
this, procPatch_.forwardT(), *
this);
313 return deltaCoeffs*(*
this - this->patchInternalField());
327 this->patch().patchInternalField(psiInternal, scalarSendBuf_);
331 commsType == Pstream::commsTypes::nonBlocking
332 && !Pstream::floatTransfer
336 if (debug && !this->ready())
339 <<
"On patch " << procPatch_.name()
340 <<
" outstanding request." 345 scalarReceiveBuf_.setSize(scalarSendBuf_.size());
346 outstandingRecvRequest_ = UPstream::nRequests();
349 Pstream::commsTypes::nonBlocking,
350 procPatch_.neighbProcNo(),
351 reinterpret_cast<char*
>(scalarReceiveBuf_.begin()),
352 scalarReceiveBuf_.byteSize(),
357 outstandingSendRequest_ = UPstream::nRequests();
360 Pstream::commsTypes::nonBlocking,
361 procPatch_.neighbProcNo(),
362 reinterpret_cast<const char*
>(scalarSendBuf_.begin()),
363 scalarSendBuf_.byteSize(),
370 procPatch_.compressedSend(commsType, scalarSendBuf_);
387 if (this->updatedMatrix())
392 const labelUList& faceCells = this->patch().faceCells();
396 commsType == Pstream::commsTypes::nonBlocking
397 && !Pstream::floatTransfer
403 outstandingRecvRequest_ >= 0
404 && outstandingRecvRequest_ < Pstream::nRequests()
407 UPstream::waitRequest(outstandingRecvRequest_);
410 outstandingSendRequest_ = -1;
411 outstandingRecvRequest_ = -1;
416 transformCoupleField(scalarReceiveBuf_, cmpt);
421 result[faceCells[elemI]] -= coeffs[elemI]*scalarReceiveBuf_[elemI];
428 procPatch_.compressedReceive<scalar>(commsType, this->size())()
432 transformCoupleField(pnf, cmpt);
437 result[faceCells[elemI]] -= coeffs[elemI]*pnf[elemI];
454 this->patch().patchInternalField(psiInternal, sendBuf_);
458 commsType == Pstream::commsTypes::nonBlocking
459 && !Pstream::floatTransfer
463 if (debug && !this->ready())
466 <<
"On patch " << procPatch_.name()
467 <<
" outstanding request." 472 receiveBuf_.setSize(sendBuf_.size());
473 outstandingRecvRequest_ = UPstream::nRequests();
476 Pstream::commsTypes::nonBlocking,
477 procPatch_.neighbProcNo(),
478 reinterpret_cast<char*
>(receiveBuf_.begin()),
479 receiveBuf_.byteSize(),
484 outstandingSendRequest_ = UPstream::nRequests();
487 Pstream::commsTypes::nonBlocking,
488 procPatch_.neighbProcNo(),
489 reinterpret_cast<const char*
>(sendBuf_.begin()),
497 procPatch_.compressedSend(commsType, sendBuf_);
513 if (this->updatedMatrix())
518 const labelUList& faceCells = this->patch().faceCells();
522 commsType == Pstream::commsTypes::nonBlocking
523 && !Pstream::floatTransfer
529 outstandingRecvRequest_ >= 0
530 && outstandingRecvRequest_ < Pstream::nRequests()
533 UPstream::waitRequest(outstandingRecvRequest_);
536 outstandingSendRequest_ = -1;
537 outstandingRecvRequest_ = -1;
542 transformCoupleField(receiveBuf_);
547 result[faceCells[elemI]] -= coeffs[elemI]*receiveBuf_[elemI];
554 procPatch_.compressedReceive<Type>(commsType, this->size())()
558 transformCoupleField(pnf);
563 result[faceCells[elemI]] -= coeffs[elemI]*pnf[elemI];
576 outstandingSendRequest_ >= 0
577 && outstandingSendRequest_ < Pstream::nRequests()
580 bool finished = UPstream::finishedRequest(outstandingSendRequest_);
586 outstandingSendRequest_ = -1;
590 outstandingRecvRequest_ >= 0
591 && outstandingRecvRequest_ < Pstream::nRequests()
594 bool finished = UPstream::finishedRequest(outstandingRecvRequest_);
600 outstandingRecvRequest_ = -1;
#define forAll(list, i)
Loop across all elements in list.
bool updatedMatrix() const
Whether matrix has been updated.
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.
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
virtual void initInterfaceMatrixUpdate(scalarField &result, const scalarField &psiInternal, const scalarField &coeffs, const direction cmpt, const Pstream::commsTypes commsType) const
Initialise neighbour matrix update.
points setSize(newPointi)
Abstract base class for processor coupled interfaces.
~processorFvPatchField()
Destructor.
Pre-declare SubField and related Field type.
Foam::fvPatchFieldMapper.
virtual bool ready() const
Is all data available.
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...
const fvPatch & patch() const
Return patch.
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...
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.
This boundary condition enables processor communication across patches.
A class for managing temporary objects.
virtual bool ready() const
Is all data available.
virtual tmp< Field< Type > > patchNeighbourField() const
Return neighbour field given internal field.
virtual tmp< Field< Type > > snGrad() const
Return patch-normal gradient.
processorFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
dimensionSet transform(const dimensionSet &)