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_(move(ptf.sendBuf_)),
154 receiveBuf_(move(ptf.receiveBuf_)),
155 outstandingSendRequest_(-1),
156 outstandingRecvRequest_(-1),
157 scalarSendBuf_(move(ptf.scalarSendBuf_)),
158 scalarReceiveBuf_(move(ptf.scalarReceiveBuf_))
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);
298 procPatch_.transform().transform(*
this, *
this);
310 return deltaCoeffs*(*
this - this->patchInternalField());
324 this->patch().patchInternalField(psiInternal, scalarSendBuf_);
328 commsType == Pstream::commsTypes::nonBlocking
329 && !Pstream::floatTransfer
333 if (debug && !this->ready())
336 <<
"On patch " << procPatch_.name()
337 <<
" outstanding request." 342 scalarReceiveBuf_.setSize(scalarSendBuf_.size());
343 outstandingRecvRequest_ = UPstream::nRequests();
346 Pstream::commsTypes::nonBlocking,
347 procPatch_.neighbProcNo(),
348 reinterpret_cast<char*
>(scalarReceiveBuf_.begin()),
349 scalarReceiveBuf_.byteSize(),
354 outstandingSendRequest_ = UPstream::nRequests();
357 Pstream::commsTypes::nonBlocking,
358 procPatch_.neighbProcNo(),
359 reinterpret_cast<const char*
>(scalarSendBuf_.begin()),
360 scalarSendBuf_.byteSize(),
367 procPatch_.compressedSend(commsType, scalarSendBuf_);
384 if (this->updatedMatrix())
389 const labelUList& faceCells = this->patch().faceCells();
393 commsType == Pstream::commsTypes::nonBlocking
394 && !Pstream::floatTransfer
400 outstandingRecvRequest_ >= 0
401 && outstandingRecvRequest_ < Pstream::nRequests()
404 UPstream::waitRequest(outstandingRecvRequest_);
407 outstandingSendRequest_ = -1;
408 outstandingRecvRequest_ = -1;
413 transformCoupleField(scalarReceiveBuf_, cmpt);
418 result[faceCells[elemI]] -= coeffs[elemI]*scalarReceiveBuf_[elemI];
425 procPatch_.compressedReceive<scalar>(commsType, this->size())()
429 transformCoupleField(pnf, cmpt);
434 result[faceCells[elemI]] -= coeffs[elemI]*pnf[elemI];
451 this->patch().patchInternalField(psiInternal, sendBuf_);
455 commsType == Pstream::commsTypes::nonBlocking
456 && !Pstream::floatTransfer
460 if (debug && !this->ready())
463 <<
"On patch " << procPatch_.name()
464 <<
" outstanding request." 469 receiveBuf_.setSize(sendBuf_.size());
470 outstandingRecvRequest_ = UPstream::nRequests();
473 Pstream::commsTypes::nonBlocking,
474 procPatch_.neighbProcNo(),
475 reinterpret_cast<char*
>(receiveBuf_.begin()),
476 receiveBuf_.byteSize(),
481 outstandingSendRequest_ = UPstream::nRequests();
484 Pstream::commsTypes::nonBlocking,
485 procPatch_.neighbProcNo(),
486 reinterpret_cast<const char*
>(sendBuf_.begin()),
494 procPatch_.compressedSend(commsType, sendBuf_);
510 if (this->updatedMatrix())
515 const labelUList& faceCells = this->patch().faceCells();
519 commsType == Pstream::commsTypes::nonBlocking
520 && !Pstream::floatTransfer
526 outstandingRecvRequest_ >= 0
527 && outstandingRecvRequest_ < Pstream::nRequests()
530 UPstream::waitRequest(outstandingRecvRequest_);
533 outstandingSendRequest_ = -1;
534 outstandingRecvRequest_ = -1;
539 transformCoupleField(receiveBuf_);
544 result[faceCells[elemI]] -= coeffs[elemI]*receiveBuf_[elemI];
551 procPatch_.compressedReceive<Type>(commsType, this->size())()
555 transformCoupleField(pnf);
560 result[faceCells[elemI]] -= coeffs[elemI]*pnf[elemI];
573 outstandingSendRequest_ >= 0
574 && outstandingSendRequest_ < Pstream::nRequests()
577 bool finished = UPstream::finishedRequest(outstandingSendRequest_);
583 outstandingSendRequest_ = -1;
587 outstandingRecvRequest_ >= 0
588 && outstandingRecvRequest_ < Pstream::nRequests()
591 bool finished = UPstream::finishedRequest(outstandingRecvRequest_);
597 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.
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.
void write(std::ostream &os, const bool binary, List< floatScalar > &fField)
Write floats ascii or binary.
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.