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())),
155 outstandingSendRequest_(-1),
156 outstandingRecvRequest_(-1),
160 if (debug && !ptf.
ready())
163 <<
"On patch " << procPatch_.name() <<
" outstanding request." 185 if (debug && !this->ready())
188 <<
"On patch " << procPatch_.name()
189 <<
" outstanding request." 202 if (Pstream::parRun())
204 this->patchInternalField(sendBuf_);
208 commsType == Pstream::commsTypes::nonBlocking
209 && !Pstream::floatTransfer
213 this->
setSize(sendBuf_.size());
214 outstandingRecvRequest_ = UPstream::nRequests();
217 Pstream::commsTypes::nonBlocking,
218 procPatch_.neighbProcNo(),
219 reinterpret_cast<char*
>(this->begin()),
225 outstandingSendRequest_ = UPstream::nRequests();
228 Pstream::commsTypes::nonBlocking,
229 procPatch_.neighbProcNo(),
230 reinterpret_cast<const char*
>(sendBuf_.begin()),
238 procPatch_.compressedSend(commsType, sendBuf_);
250 if (Pstream::parRun())
254 commsType == Pstream::commsTypes::nonBlocking
255 && !Pstream::floatTransfer
262 outstandingRecvRequest_ >= 0
263 && outstandingRecvRequest_ < Pstream::nRequests()
266 UPstream::waitRequest(outstandingRecvRequest_);
268 outstandingSendRequest_ = -1;
269 outstandingRecvRequest_ = -1;
273 procPatch_.compressedReceive<Type>(commsType, *
this);
276 procPatch_.transform().transform(*
this, *
this);
288 return deltaCoeffs*(*
this - this->patchInternalField());
302 this->patch().patchInternalField(psiInternal, scalarSendBuf_);
306 commsType == Pstream::commsTypes::nonBlocking
307 && !Pstream::floatTransfer
311 if (debug && !this->ready())
314 <<
"On patch " << procPatch_.name()
315 <<
" outstanding request." 320 scalarReceiveBuf_.setSize(scalarSendBuf_.size());
321 outstandingRecvRequest_ = UPstream::nRequests();
324 Pstream::commsTypes::nonBlocking,
325 procPatch_.neighbProcNo(),
326 reinterpret_cast<char*
>(scalarReceiveBuf_.begin()),
327 scalarReceiveBuf_.byteSize(),
332 outstandingSendRequest_ = UPstream::nRequests();
335 Pstream::commsTypes::nonBlocking,
336 procPatch_.neighbProcNo(),
337 reinterpret_cast<const char*
>(scalarSendBuf_.begin()),
338 scalarSendBuf_.byteSize(),
345 procPatch_.compressedSend(commsType, scalarSendBuf_);
362 if (this->updatedMatrix())
367 const labelUList& faceCells = this->patch().faceCells();
371 commsType == Pstream::commsTypes::nonBlocking
372 && !Pstream::floatTransfer
378 outstandingRecvRequest_ >= 0
379 && outstandingRecvRequest_ < Pstream::nRequests()
382 UPstream::waitRequest(outstandingRecvRequest_);
385 outstandingSendRequest_ = -1;
386 outstandingRecvRequest_ = -1;
391 transformCoupleField(scalarReceiveBuf_, cmpt);
396 result[faceCells[elemI]] -= coeffs[elemI]*scalarReceiveBuf_[elemI];
403 procPatch_.compressedReceive<scalar>(commsType, this->size())()
407 transformCoupleField(pnf, cmpt);
412 result[faceCells[elemI]] -= coeffs[elemI]*pnf[elemI];
429 this->patch().patchInternalField(psiInternal, sendBuf_);
433 commsType == Pstream::commsTypes::nonBlocking
434 && !Pstream::floatTransfer
438 if (debug && !this->ready())
441 <<
"On patch " << procPatch_.name()
442 <<
" outstanding request." 447 receiveBuf_.setSize(sendBuf_.size());
448 outstandingRecvRequest_ = UPstream::nRequests();
451 Pstream::commsTypes::nonBlocking,
452 procPatch_.neighbProcNo(),
453 reinterpret_cast<char*
>(receiveBuf_.begin()),
454 receiveBuf_.byteSize(),
459 outstandingSendRequest_ = UPstream::nRequests();
462 Pstream::commsTypes::nonBlocking,
463 procPatch_.neighbProcNo(),
464 reinterpret_cast<const char*
>(sendBuf_.begin()),
472 procPatch_.compressedSend(commsType, sendBuf_);
488 if (this->updatedMatrix())
493 const labelUList& faceCells = this->patch().faceCells();
497 commsType == Pstream::commsTypes::nonBlocking
498 && !Pstream::floatTransfer
504 outstandingRecvRequest_ >= 0
505 && outstandingRecvRequest_ < Pstream::nRequests()
508 UPstream::waitRequest(outstandingRecvRequest_);
511 outstandingSendRequest_ = -1;
512 outstandingRecvRequest_ = -1;
517 transformCoupleField(receiveBuf_);
522 result[faceCells[elemI]] -= coeffs[elemI]*receiveBuf_[elemI];
529 procPatch_.compressedReceive<Type>(commsType, this->size())()
533 transformCoupleField(pnf);
538 result[faceCells[elemI]] -= coeffs[elemI]*pnf[elemI];
551 outstandingSendRequest_ >= 0
552 && outstandingSendRequest_ < Pstream::nRequests()
555 bool finished = UPstream::finishedRequest(outstandingSendRequest_);
561 outstandingSendRequest_ = -1;
565 outstandingRecvRequest_ >= 0
566 && outstandingRecvRequest_ < Pstream::nRequests()
569 bool finished = UPstream::finishedRequest(outstandingRecvRequest_);
575 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)
~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.
virtual tmp< Field< Type > > patchNeighbourField(const Pstream::commsTypes) const
Return neighbour field given internal field.
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 > > snGrad() const
Return patch-normal gradient.
processorFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.