77 if (!isType<processorFaPatch>(this->
patch()))
80 <<
"\n patch type '" << p.type()
81 <<
"' not constraint type '" <<
typeName <<
"'" 82 <<
"\n for patch " <<
p.name()
87 if (
debug && !ptf.all_ready())
90 <<
"Outstanding request(s) on patch " << procPatch_.
name()
100 const DimensionedField<Type, areaMesh>& iF,
101 const dictionary&
dict 104 coupledFaPatchField<Type>(
p, iF,
dict, IOobjectOption::NO_READ),
109 if (!isType<processorFaPatch>(
p))
112 <<
"\n patch type '" <<
p.type()
113 <<
"' not constraint type '" <<
typeName <<
"'" 114 <<
"\n for patch " <<
p.name()
131 const processorFaPatchField<Type>& ptf
134 processorLduInterfaceField(),
135 coupledFaPatchField<Type>(ptf),
136 procPatch_(
refCast<const processorFaPatch>(ptf.
patch())),
139 sendBuf_(
std::move(ptf.sendBuf_)),
140 recvBuf_(
std::move(ptf.recvBuf_)),
141 scalarSendBuf_(
std::move(ptf.scalarSendBuf_)),
142 scalarRecvBuf_(
std::move(ptf.scalarRecvBuf_))
144 if (
debug && !ptf.all_ready())
147 <<
"Outstanding request(s) on patch " << procPatch_.
name()
156 const processorFaPatchField<Type>& ptf,
157 const DimensionedField<Type, areaMesh>& iF
160 coupledFaPatchField<Type>(ptf, iF),
161 procPatch_(
refCast<const processorFaPatch>(ptf.
patch())),
165 if (
debug && !ptf.all_ready())
168 <<
"Outstanding request(s) on patch " << procPatch_.
name()
200 if (
debug && !this->ready())
203 <<
"Outstanding request on patch " << procPatch_.name()
218 this->patchInternalField(sendBuf_);
222 if (!is_contiguous<Type>::value)
225 <<
"Invalid for non-contiguous data types" 230 this->resize_nocopy(sendBuf_.size());
236 procPatch_.neighbProcNo(),
247 procPatch_.neighbProcNo(),
248 sendBuf_.cdata_bytes(),
249 sendBuf_.size_bytes(),
256 procPatch_.send(commsType, sendBuf_);
281 procPatch_.receive<Type>(commsType, *
this);
295 return this->
patch().deltaCoeffs()*(*
this - this->patchInternalField());
312 this->
patch().patchInternalField(psiInternal, scalarSendBuf_);
317 if (
debug && !this->all_ready())
320 <<
"Outstanding request(s) on patch " << procPatch_.name()
324 scalarRecvBuf_.resize_nocopy(scalarSendBuf_.size());
330 procPatch_.neighbProcNo(),
331 scalarRecvBuf_.data_bytes(),
332 scalarRecvBuf_.size_bytes(),
341 procPatch_.neighbProcNo(),
342 scalarSendBuf_.cdata_bytes(),
343 scalarSendBuf_.size_bytes(),
350 procPatch_.send(commsType, scalarSendBuf_);
353 this->updatedMatrix(
false);
370 if (this->updatedMatrix())
388 scalarRecvBuf_.resize_nocopy(this->size());
389 procPatch_.receive(commsType, scalarRecvBuf_);
393 if (pTraits<Type>::rank)
396 transformCoupleField(scalarRecvBuf_, cmpt);
400 this->addToInternalField(result, !
add, faceCells, coeffs, scalarRecvBuf_);
402 this->updatedMatrix(
true);
418 this->
patch().patchInternalField(psiInternal, sendBuf_);
423 if (
debug && !this->all_ready())
426 <<
"Outstanding request(s) on patch " << procPatch_.name()
430 recvBuf_.resize_nocopy(sendBuf_.size());
436 procPatch_.neighbProcNo(),
437 recvBuf_.data_bytes(),
438 recvBuf_.size_bytes(),
447 procPatch_.neighbProcNo(),
448 sendBuf_.cdata_bytes(),
449 sendBuf_.size_bytes(),
456 procPatch_.send(commsType, sendBuf_);
459 this->updatedMatrix(
false);
475 if (this->updatedMatrix())
493 recvBuf_.resize_nocopy(this->size());
494 procPatch_.receive(commsType, recvBuf_);
499 transformCoupleField(recvBuf_);
502 this->addToInternalField(result, !
add, faceCells, coeffs, recvBuf_);
504 this->updatedMatrix(
true);
const faPatch & patch() const noexcept
Return the patch.
virtual void initEvaluate(const Pstream::commsTypes commsType)
Initialise the evaluation of the patch field.
static label read(const UPstream::commsTypes commsType, const int fromProcNo, char *buf, const std::streamsize bufSize, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm, UPstream::Request *req=nullptr)
Read buffer contents from given processor.
errorManipArg< error, int > exit(error &err, const int errNo=1)
commsTypes
Communications types.
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
static label nRequests() noexcept
Number of outstanding requests (on the internal list of requests)
Type & refCast(U &obj)
A dynamic_cast (for references). Generates a FatalError on failed casts and uses the virtual type() m...
static bool & parRun() noexcept
Test if this a parallel run.
const DimensionedField< Type, areaMesh > & internalField() const noexcept
Return const-reference to the dimensioned internal field.
static bool finishedRequest(const label i)
Non-blocking comms: has request i finished? Corresponds to MPI_Test()
void extrapolateInternal()
Assign the patch field from the internal field.
UList< label > labelUList
A UList of labels.
virtual void updateInterfaceMatrix(solveScalarField &result, const bool add, const lduAddressing &lduAddr, const label patchId, const solveScalarField &psiInternal, const scalarField &coeffs, const direction cmpt, const Pstream::commsTypes commsType) const
Update result field based on interface functionality.
static bool finishedRequestPair(label &req0, label &req1)
Non-blocking comms: have both requests finished? Corresponds to pair of MPI_Test() ...
static const char *const typeName
Typename for Field.
Generic templated field type.
Author Zeljko Tukovic, FMENA Hrvoje Jasak, Wikki Ltd.
virtual void initInterfaceMatrixUpdate(solveScalarField &result, const bool add, const lduAddressing &lduAddr, const label patchId, const solveScalarField &psiInternal, const scalarField &coeffs, const direction cmpt, const Pstream::commsTypes commsType) const
Initialise neighbour matrix update.
errorManip< error > abort(error &err)
virtual void evaluate(const Pstream::commsTypes commsType)
Evaluate the patch field.
const word & name() const noexcept
The patch name.
void add(FieldField< Field1, typename typeOfSum< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
int debug
Static debugging option.
Finite area patch class. Used for 2-D non-Euclidian finite area method.
#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...
const std::string patch
OpenFOAM patch number as a std::string.
static bool write(const UPstream::commsTypes commsType, const int toProcNo, const char *buf, const std::streamsize bufSize, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm, UPstream::Request *req=nullptr, const UPstream::sendModes sendMode=UPstream::sendModes::normal)
Write buffer contents to given processor.
virtual tmp< Field< Type > > snGrad() const
Return patch-normal gradient.
"nonBlocking" : (MPI_Isend, MPI_Irecv)
The class contains the addressing required by the lduMatrix: upper, lower and losort.
A class for managing temporary objects.
dimensionSet transform(const dimensionSet &ds)
Return the argument; transformations do not change the dimensions.
A FieldMapper for finite-area patch fields.
static void waitRequest(const label i)
Wait until request i has finished. Corresponds to MPI_Wait()
processorFaPatchField(const faPatch &, const DimensionedField< Type, areaMesh > &)
Construct from patch and internal field.
virtual bool ready() const
Are all (receive) data available?
bool readValueEntry(const dictionary &dict, IOobjectOption::readOption readOpt=IOobjectOption::LAZY_READ)
Read the "value" entry into *this.
Author Zeljko Tukovic, FMENA Hrvoje Jasak, Wikki Ltd.
tmp< Field< Type > > patchNeighbourField() const
Return neighbour field given internal field.
IOerror FatalIOError
Error stream (stdout output on all processes), with additional 'FOAM FATAL IO ERROR' header text and ...