77 if (!isA<processorFvPatch>(
p))
80 <<
"\n patch type '" <<
p.type()
81 <<
"' not constraint type '" <<
typeName <<
"'" 82 <<
"\n for patch " <<
p.name()
99 const processorFvPatchField<Type>& ptf,
101 const DimensionedField<Type, volMesh>& iF,
102 const fvPatchFieldMapper& mapper
105 coupledFvPatchField<Type>(ptf,
p, iF, mapper),
106 procPatch_(
refCast<const processorFvPatch>(
p)),
110 if (!isA<processorFvPatch>(this->
patch()))
113 <<
"\n patch type '" << p.type()
114 <<
"' not constraint type '" <<
typeName <<
"'" 115 <<
"\n for patch " <<
p.name()
120 if (
debug && !ptf.all_ready())
123 <<
"Outstanding request(s) on patch " << procPatch_.
name()
132 const processorFvPatchField<Type>& ptf
135 processorLduInterfaceField(),
136 coupledFvPatchField<Type>(ptf),
137 procPatch_(
refCast<const processorFvPatch>(ptf.
patch())),
140 sendBuf_(
std::move(ptf.sendBuf_)),
141 recvBuf_(
std::move(ptf.recvBuf_)),
142 scalarSendBuf_(
std::move(ptf.scalarSendBuf_)),
143 scalarRecvBuf_(
std::move(ptf.scalarRecvBuf_))
145 if (
debug && !ptf.all_ready())
148 <<
"Outstanding request(s) on patch " << procPatch_.
name()
157 const processorFvPatchField<Type>& ptf,
158 const DimensionedField<Type, volMesh>& iF
161 coupledFvPatchField<Type>(ptf, iF),
162 procPatch_(
refCast<const processorFvPatch>(ptf.
patch())),
166 if (
debug && !ptf.all_ready())
169 <<
"Outstanding request(s) on patch " << procPatch_.
name()
201 if (
debug && !this->ready())
204 <<
"Outstanding request on patch " << procPatch_.name()
217 if (
debug && !this->ready())
220 <<
"Outstanding request on patch " << procPatch_.name()
235 sendBuf_.resize_nocopy(this->
patch().size());
236 this->patchInternalField(sendBuf_);
244 if constexpr (!is_contiguous_v<Type>)
247 <<
"Invalid for non-contiguous data types" 252 Field<Type>&
self = *
this;
253 self.resize_nocopy(sendBuf_.size());
259 procPatch_.neighbProcNo(),
269 procPatch_.neighbProcNo(),
277 procPatch_.compressedSend(commsType, sendBuf_);
306 procPatch_.compressedReceive<Type>(commsType, *
this);
311 transform(*
this, procPatch_.forwardT(), *
this);
324 return deltaCoeffs*(*
this - this->patchInternalField());
344 scalarSendBuf_.resize_nocopy(
faceCells.size());
345 scalarRecvBuf_.resize_nocopy(
faceCells.size());
349 scalarSendBuf_[i] = psiInternal[
faceCells[i]];
360 if (
debug && !this->all_ready())
363 <<
"Outstanding request(s) on patch " << procPatch_.name()
371 procPatch_.neighbProcNo(),
381 procPatch_.neighbProcNo(),
389 procPatch_.compressedSend(commsType, scalarSendBuf_);
392 this->updatedMatrix(
false);
409 if (this->updatedMatrix())
431 scalarRecvBuf_.resize_nocopy(faceCells.size());
432 procPatch_.compressedReceive(commsType, scalarRecvBuf_);
439 transformCoupleField(scalarRecvBuf_, cmpt);
443 this->addToInternalField(result, !
add, faceCells, coeffs, scalarRecvBuf_);
445 this->updatedMatrix(
true);
464 sendBuf_.resize_nocopy(
faceCells.size());
465 recvBuf_.resize_nocopy(
faceCells.size());
480 if (
debug && !this->all_ready())
483 <<
"Outstanding request(s) on patch " << procPatch_.name()
491 procPatch_.neighbProcNo(),
501 procPatch_.neighbProcNo(),
509 procPatch_.compressedSend(commsType, sendBuf_);
512 this->updatedMatrix(
false);
528 if (this->updatedMatrix())
550 recvBuf_.resize_nocopy(faceCells.size());
551 procPatch_.compressedReceive(commsType, recvBuf_);
556 transformCoupleField(recvBuf_);
559 this->addToInternalField(result, !
add, faceCells, coeffs, recvBuf_);
561 this->updatedMatrix(
true);
bool readValueEntry(const dictionary &dict, IOobjectOption::readOption readOpt=IOobjectOption::LAZY_READ)
Read the "value" entry into *this.
static bool floatTransfer
Should compact transfer be used in which floats replace doubles reducing the bandwidth requirement at...
errorManipArg< error, int > exit(error &err, const int errNo=1)
virtual void initEvaluate(const Pstream::commsTypes commsType)
Initialise the evaluation of the patch field.
commsTypes
Communications types.
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
A list of keyword definitions, which are a keyword followed by a number of values (eg...
const fvPatch & patch() const noexcept
Return the patch.
#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.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
static bool & parRun() noexcept
Test if this a parallel run.
void extrapolateInternal()
Assign the patch field from the internal field.
static bool finishedRequest(const label i)
Non-blocking comms: has request i finished? Corresponds to MPI_Test()
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.
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.
UList< label > labelUList
A UList of labels.
#define forAll(list, i)
Loop across all elements in list.
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.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
virtual const labelUList & patchAddr(const label patchNo) const =0
Return patch to internal addressing given patch number.
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)
Abstract base class for coupled patches.
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.
virtual void evaluate(const Pstream::commsTypes commsType)
Evaluate the patch field.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
A simple container of IOobject preferences. Can also be used for general handling of read/no-read/rea...
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
const DimensionedField< Type, volMesh > & internalField() const noexcept
Return const-reference to the dimensioned internal field.
const std::string patch
OpenFOAM patch number as a std::string.
::Foam::direction rank(const expressions::valueTypeCode) noexcept
The vector-space rank associated with given valueTypeCode.
"nonBlocking" (immediate) : (MPI_Isend, MPI_Irecv)
This boundary condition enables processor communication across patches.
The class contains the addressing required by the lduMatrix: upper, lower and losort.
virtual const word & name() const
Return name.
A class for managing temporary objects.
virtual bool ready() const
Are all (receive) data available?
static void waitRequest(const label i)
Wait until request i has finished. Corresponds to MPI_Wait()
virtual tmp< Field< Type > > patchNeighbourField() const
Return neighbour field.
virtual tmp< Field< Type > > snGrad() const
Return patch-normal gradient.
processorFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
IOerror FatalIOError
Error stream (stdout output on all processes), with additional 'FOAM FATAL IO ERROR' header text and ...