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." 182 if (debug && !this->ready())
185 <<
"On patch " << procPatch_.name()
186 <<
" outstanding request." 199 if (Pstream::parRun())
201 this->patchInternalField(sendBuf_);
205 commsType == Pstream::commsTypes::nonBlocking
206 && !Pstream::floatTransfer
210 this->
setSize(sendBuf_.size());
211 outstandingRecvRequest_ = UPstream::nRequests();
214 Pstream::commsTypes::nonBlocking,
215 procPatch_.neighbProcNo(),
216 reinterpret_cast<char*
>(this->begin()),
222 outstandingSendRequest_ = UPstream::nRequests();
225 Pstream::commsTypes::nonBlocking,
226 procPatch_.neighbProcNo(),
227 reinterpret_cast<const char*
>(sendBuf_.begin()),
235 procPatch_.compressedSend(commsType, sendBuf_);
247 if (Pstream::parRun())
251 commsType == Pstream::commsTypes::nonBlocking
252 && !Pstream::floatTransfer
259 outstandingRecvRequest_ >= 0
260 && outstandingRecvRequest_ < Pstream::nRequests()
263 UPstream::waitRequest(outstandingRecvRequest_);
265 outstandingSendRequest_ = -1;
266 outstandingRecvRequest_ = -1;
270 procPatch_.compressedReceive<Type>(commsType, *
this);
273 procPatch_.transform().transform(*
this, *
this);
285 return deltaCoeffs*(*
this - this->patchInternalField());
299 this->patch().patchInternalField(psiInternal, scalarSendBuf_);
303 commsType == Pstream::commsTypes::nonBlocking
304 && !Pstream::floatTransfer
308 if (debug && !this->ready())
311 <<
"On patch " << procPatch_.name()
312 <<
" outstanding request." 317 scalarReceiveBuf_.setSize(scalarSendBuf_.size());
318 outstandingRecvRequest_ = UPstream::nRequests();
321 Pstream::commsTypes::nonBlocking,
322 procPatch_.neighbProcNo(),
323 reinterpret_cast<char*
>(scalarReceiveBuf_.begin()),
324 scalarReceiveBuf_.byteSize(),
329 outstandingSendRequest_ = UPstream::nRequests();
332 Pstream::commsTypes::nonBlocking,
333 procPatch_.neighbProcNo(),
334 reinterpret_cast<const char*
>(scalarSendBuf_.begin()),
335 scalarSendBuf_.byteSize(),
342 procPatch_.compressedSend(commsType, scalarSendBuf_);
359 if (this->updatedMatrix())
364 const labelUList& faceCells = this->patch().faceCells();
368 commsType == Pstream::commsTypes::nonBlocking
369 && !Pstream::floatTransfer
375 outstandingRecvRequest_ >= 0
376 && outstandingRecvRequest_ < Pstream::nRequests()
379 UPstream::waitRequest(outstandingRecvRequest_);
382 outstandingSendRequest_ = -1;
383 outstandingRecvRequest_ = -1;
388 transformCoupleField(scalarReceiveBuf_, cmpt);
393 result[faceCells[elemI]] -= coeffs[elemI]*scalarReceiveBuf_[elemI];
400 procPatch_.compressedReceive<scalar>(commsType, this->size())()
404 transformCoupleField(pnf, cmpt);
409 result[faceCells[elemI]] -= coeffs[elemI]*pnf[elemI];
426 this->patch().patchInternalField(psiInternal, sendBuf_);
430 commsType == Pstream::commsTypes::nonBlocking
431 && !Pstream::floatTransfer
435 if (debug && !this->ready())
438 <<
"On patch " << procPatch_.name()
439 <<
" outstanding request." 444 receiveBuf_.setSize(sendBuf_.size());
445 outstandingRecvRequest_ = UPstream::nRequests();
448 Pstream::commsTypes::nonBlocking,
449 procPatch_.neighbProcNo(),
450 reinterpret_cast<char*
>(receiveBuf_.begin()),
451 receiveBuf_.byteSize(),
456 outstandingSendRequest_ = UPstream::nRequests();
459 Pstream::commsTypes::nonBlocking,
460 procPatch_.neighbProcNo(),
461 reinterpret_cast<const char*
>(sendBuf_.begin()),
469 procPatch_.compressedSend(commsType, sendBuf_);
485 if (this->updatedMatrix())
490 const labelUList& faceCells = this->patch().faceCells();
494 commsType == Pstream::commsTypes::nonBlocking
495 && !Pstream::floatTransfer
501 outstandingRecvRequest_ >= 0
502 && outstandingRecvRequest_ < Pstream::nRequests()
505 UPstream::waitRequest(outstandingRecvRequest_);
508 outstandingSendRequest_ = -1;
509 outstandingRecvRequest_ = -1;
514 transformCoupleField(receiveBuf_);
519 result[faceCells[elemI]] -= coeffs[elemI]*receiveBuf_[elemI];
526 procPatch_.compressedReceive<Type>(commsType, this->size())()
530 transformCoupleField(pnf);
535 result[faceCells[elemI]] -= coeffs[elemI]*pnf[elemI];
548 outstandingSendRequest_ >= 0
549 && outstandingSendRequest_ < Pstream::nRequests()
552 bool finished = UPstream::finishedRequest(outstandingSendRequest_);
558 outstandingSendRequest_ = -1;
562 outstandingRecvRequest_ >= 0
563 && outstandingRecvRequest_ < Pstream::nRequests()
566 bool finished = UPstream::finishedRequest(outstandingRecvRequest_);
572 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.
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.