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()
216 if (
debug && !this->ready())
219 <<
"Outstanding request on patch " << procPatch_.name()
234 sendBuf_.resize_nocopy(this->
patch().size());
235 this->patchInternalField(sendBuf_);
239 if constexpr (!is_contiguous_v<Type>)
242 <<
"Invalid for non-contiguous data types" 247 Field<Type>&
self = *
this;
248 self.resize_nocopy(sendBuf_.size());
254 procPatch_.neighbProcNo(),
264 procPatch_.neighbProcNo(),
272 procPatch_.send(commsType, sendBuf_);
297 procPatch_.receive<Type>(commsType, *
this);
311 return this->
patch().deltaCoeffs()*(*
this - this->patchInternalField());
331 scalarSendBuf_.resize_nocopy(
faceCells.size());
332 scalarRecvBuf_.resize_nocopy(
faceCells.size());
336 scalarSendBuf_[i] = psiInternal[
faceCells[i]];
343 if (
debug && !this->all_ready())
346 <<
"Outstanding request(s) on patch " << procPatch_.name()
354 procPatch_.neighbProcNo(),
364 procPatch_.neighbProcNo(),
372 procPatch_.send(commsType, scalarSendBuf_);
375 this->updatedMatrix(
false);
392 if (this->updatedMatrix())
410 scalarRecvBuf_.resize_nocopy(faceCells.size());
411 procPatch_.receive(commsType, scalarRecvBuf_);
418 transformCoupleField(scalarRecvBuf_, cmpt);
422 this->addToInternalField(result, !
add, faceCells, coeffs, scalarRecvBuf_);
424 this->updatedMatrix(
true);
443 sendBuf_.resize_nocopy(
faceCells.size());
444 recvBuf_.resize_nocopy(
faceCells.size());
456 if (
debug && !this->all_ready())
459 <<
"Outstanding request(s) on patch " << procPatch_.name()
467 procPatch_.neighbProcNo(),
477 procPatch_.neighbProcNo(),
485 procPatch_.send(commsType, sendBuf_);
488 this->updatedMatrix(
false);
504 if (this->updatedMatrix())
522 recvBuf_.resize_nocopy(faceCells.size());
523 procPatch_.receive(commsType, recvBuf_);
528 transformCoupleField(recvBuf_);
531 this->addToInternalField(result, !
add, faceCells, coeffs, recvBuf_);
533 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.
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) to Type reference.
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.
static std::streamsize read(const UPstream::commsTypes commsType, const int fromProcNo, Type *buffer, std::streamsize count, const int tag=UPstream::msgType(), const int communicator=UPstream::worldComm, UPstream::Request *req=nullptr)
Receive buffer contents (contiguous types) from given processor.
Smooth ATC in cells next to a set of patches supplied by type.
UList< label > labelUList
A UList of labels.
#define forAll(list, i)
Loop across all elements in list.
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.
virtual const labelUList & patchAddr(const label patchNo) const =0
Return patch to internal addressing given patch number.
Author Zeljko Tukovic, FMENA Hrvoje Jasak, Wikki Ltd.
static bool write(const UPstream::commsTypes commsType, const int toProcNo, const Type *buffer, std::streamsize count, const int tag=UPstream::msgType(), const int communicator=UPstream::worldComm, UPstream::Request *req=nullptr, const UPstream::sendModes sendMode=UPstream::sendModes::normal)
Write buffer contents (contiguous types only) to given processor.
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)
refinementData transform(const tensor &, const refinementData val)
No-op rotational transform for base types.
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.
virtual tmp< Field< Type > > snGrad() const
Return patch-normal gradient.
::Foam::direction rank(const expressions::valueTypeCode) noexcept
The vector-space rank associated with given valueTypeCode.
"nonBlocking" (immediate) : (MPI_Isend, MPI_Irecv)
The class contains the addressing required by the lduMatrix: upper, lower and losort.
A class for managing temporary objects.
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.
virtual 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 ...