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()
219 this->patchInternalField(sendBuf_);
227 if (!is_contiguous<Type>::value)
230 <<
"Invalid for non-contiguous data types" 235 this->resize_nocopy(sendBuf_.size());
241 procPatch_.neighbProcNo(),
252 procPatch_.neighbProcNo(),
253 sendBuf_.cdata_bytes(),
254 sendBuf_.size_bytes(),
261 procPatch_.compressedSend(commsType, sendBuf_);
290 procPatch_.compressedReceive<Type>(commsType, *
this);
295 transform(*
this, procPatch_.forwardT(), *
this);
308 return deltaCoeffs*(*
this - this->patchInternalField());
329 scalarSendBuf_.resize_nocopy(this->
patch().size());
330 forAll(scalarSendBuf_, facei)
332 scalarSendBuf_[facei] = psiInternal[
faceCells[facei]];
342 if (
debug && !this->all_ready())
345 <<
"Outstanding request(s) on patch " << procPatch_.name()
349 scalarRecvBuf_.resize_nocopy(scalarSendBuf_.size());
355 procPatch_.neighbProcNo(),
356 scalarRecvBuf_.data_bytes(),
357 scalarRecvBuf_.size_bytes(),
366 procPatch_.neighbProcNo(),
367 scalarSendBuf_.cdata_bytes(),
368 scalarSendBuf_.size_bytes(),
375 procPatch_.compressedSend(commsType, scalarSendBuf_);
378 this->updatedMatrix(
false);
395 if (this->updatedMatrix())
417 scalarRecvBuf_.resize_nocopy(this->size());
418 procPatch_.compressedReceive(commsType, scalarRecvBuf_);
425 transformCoupleField(scalarRecvBuf_, cmpt);
429 this->addToInternalField(result, !
add, faceCells, coeffs, scalarRecvBuf_);
431 this->updatedMatrix(
true);
447 sendBuf_.resize_nocopy(this->
patch().size());
453 sendBuf_[facei] = psiInternal[
faceCells[facei]];
463 if (
debug && !this->all_ready())
466 <<
"Outstanding request(s) on patch " << procPatch_.name()
470 recvBuf_.resize_nocopy(sendBuf_.size());
476 procPatch_.neighbProcNo(),
477 recvBuf_.data_bytes(),
478 recvBuf_.size_bytes(),
487 procPatch_.neighbProcNo(),
488 sendBuf_.cdata_bytes(),
489 sendBuf_.size_bytes(),
496 procPatch_.compressedSend(commsType, sendBuf_);
499 this->updatedMatrix(
false);
515 if (this->updatedMatrix())
537 recvBuf_.resize_nocopy(this->size());
538 procPatch_.compressedReceive(commsType, recvBuf_);
543 transformCoupleField(recvBuf_);
546 this->addToInternalField(result, !
add, faceCells, coeffs, recvBuf_);
548 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()
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.
#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" (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.
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.
static std::streamsize 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.
IOerror FatalIOError
Error stream (stdout output on all processes), with additional 'FOAM FATAL IO ERROR' header text and ...