78 if (!isA<processorFvPatch>(
p))
81 <<
"\n patch type '" <<
p.type()
82 <<
"' not constraint type '" <<
typeName <<
"'" 83 <<
"\n for patch " <<
p.name()
100 const processorFvPatchField<Type>& ptf,
102 const DimensionedField<Type, volMesh>& iF,
103 const fvPatchFieldMapper& mapper
106 coupledFvPatchField<Type>(ptf,
p, iF, mapper),
107 procPatch_(
refCast<const processorFvPatch>(
p)),
111 if (!isA<processorFvPatch>(this->
patch()))
114 <<
"\n patch type '" << p.type()
115 <<
"' not constraint type '" <<
typeName <<
"'" 116 <<
"\n for patch " <<
p.name()
121 if (
debug && !ptf.all_ready())
124 <<
"Outstanding request(s) on patch " << procPatch_.
name()
133 const processorFvPatchField<Type>& ptf
136 processorLduInterfaceField(),
137 coupledFvPatchField<Type>(ptf),
138 procPatch_(
refCast<const processorFvPatch>(ptf.
patch())),
141 sendBuf_(
std::move(ptf.sendBuf_)),
142 recvBuf_(
std::move(ptf.recvBuf_)),
143 scalarSendBuf_(
std::move(ptf.scalarSendBuf_)),
144 scalarRecvBuf_(
std::move(ptf.scalarRecvBuf_))
146 if (
debug && !ptf.all_ready())
149 <<
"Outstanding request(s) on patch " << procPatch_.
name()
158 const processorFvPatchField<Type>& ptf,
159 const DimensionedField<Type, volMesh>& iF
162 coupledFvPatchField<Type>(ptf, iF),
163 procPatch_(
refCast<const processorFvPatch>(ptf.
patch())),
167 if (
debug && !ptf.all_ready())
170 <<
"Outstanding request(s) on patch " << procPatch_.
name()
202 if (
debug && !this->ready())
205 <<
"Outstanding request on patch " << procPatch_.name()
220 this->patchInternalField(sendBuf_);
228 if (!is_contiguous<Type>::value)
231 <<
"Invalid for non-contiguous data types" 236 this->resize_nocopy(sendBuf_.size());
242 procPatch_.neighbProcNo(),
253 procPatch_.neighbProcNo(),
254 sendBuf_.cdata_bytes(),
255 sendBuf_.size_bytes(),
262 procPatch_.compressedSend(commsType, sendBuf_);
291 procPatch_.compressedReceive<Type>(commsType, *
this);
296 transform(*
this, procPatch_.forwardT(), *
this);
309 return deltaCoeffs*(*
this - this->patchInternalField());
330 scalarSendBuf_.resize_nocopy(this->
patch().size());
331 forAll(scalarSendBuf_, facei)
333 scalarSendBuf_[facei] = psiInternal[
faceCells[facei]];
343 if (
debug && !this->all_ready())
346 <<
"Outstanding request(s) on patch " << procPatch_.name()
350 scalarRecvBuf_.resize_nocopy(scalarSendBuf_.size());
356 procPatch_.neighbProcNo(),
357 scalarRecvBuf_.data_bytes(),
358 scalarRecvBuf_.size_bytes(),
367 procPatch_.neighbProcNo(),
368 scalarSendBuf_.cdata_bytes(),
369 scalarSendBuf_.size_bytes(),
376 procPatch_.compressedSend(commsType, scalarSendBuf_);
379 this->updatedMatrix(
false);
396 if (this->updatedMatrix())
418 scalarRecvBuf_.resize_nocopy(this->size());
419 procPatch_.compressedReceive(commsType, scalarRecvBuf_);
426 transformCoupleField(scalarRecvBuf_, cmpt);
430 this->addToInternalField(result, !
add, faceCells, coeffs, scalarRecvBuf_);
432 this->updatedMatrix(
true);
448 sendBuf_.resize_nocopy(this->
patch().size());
454 sendBuf_[facei] = psiInternal[
faceCells[facei]];
464 if (
debug && !this->all_ready())
467 <<
"Outstanding request(s) on patch " << procPatch_.name()
471 recvBuf_.resize_nocopy(sendBuf_.size());
477 procPatch_.neighbProcNo(),
478 recvBuf_.data_bytes(),
479 recvBuf_.size_bytes(),
488 procPatch_.neighbProcNo(),
489 sendBuf_.cdata_bytes(),
490 sendBuf_.size_bytes(),
497 procPatch_.compressedSend(commsType, sendBuf_);
500 this->updatedMatrix(
false);
516 if (this->updatedMatrix())
538 recvBuf_.resize_nocopy(this->size());
539 procPatch_.compressedReceive(commsType, recvBuf_);
544 transformCoupleField(recvBuf_);
547 this->addToInternalField(result, !
add, faceCells, coeffs, recvBuf_);
549 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...
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)
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). Generates a FatalError on failed casts and uses the virtual type() m...
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()
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.
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)
int debug
Static debugging option.
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.
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.
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.
::Foam::direction rank(const expressions::valueTypeCode) noexcept
The vector-space rank associated with given valueTypeCode.
"nonBlocking" : (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.
dimensionSet transform(const dimensionSet &ds)
Return the argument; transformations do not change the dimensions.
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 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.
IOerror FatalIOError
Error stream (stdout output on all processes), with additional 'FOAM FATAL IO ERROR' header text and ...