52 procInterface_(ptf.procInterface_),
83 solveScalarField& result,
85 const lduAddressing& lduAddr,
87 const solveScalarField& psiInternal,
88 const scalarField& coeffs,
90 const Pstream::commsTypes commsType
93 if (!this->all_ready())
96 <<
"Outstanding request(s) on interface "
105 scalarSendBuf_.resize_nocopy(fc.size());
106 scalarRecvBuf_.resize_nocopy(fc.size());
110 scalarSendBuf_[i] = psiInternal[fc[i]];
114 recvRequest_ = UPstream::nRequests();
117 UPstream::commsTypes::nonBlocking,
118 procInterface_.neighbProcNo(),
120 procInterface_.tag(),
121 procInterface_.comm()
124 sendRequest_ = UPstream::nRequests();
127 UPstream::commsTypes::nonBlocking,
128 procInterface_.neighbProcNo(),
130 procInterface_.tag(),
131 procInterface_.comm()
153 result[
faceCells[elemI]] += coeffs[elemI]*vals[elemI];
169 solveScalarField& result,
171 const lduAddressing& lduAddr,
173 const solveScalarField& psiInternal,
174 const scalarField& coeffs,
175 const direction cmpt,
176 const Pstream::commsTypes commsType
179 if (this->updatedMatrix())
187 UPstream::waitRequest(recvRequest_); recvRequest_ = -1;
188 if (UPstream::finishedRequest(sendRequest_)) sendRequest_ = -1;
193 addToInternalField(result, !
add, coeffs, scalarRecvBuf_);
195 this->updatedMatrix(
true);
An abstract base class for implicitly-coupled interface fields e.g. processor and cyclic patch fields...
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.
void size(const label n)
Older name for setAddressableSize.
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.
static label nRequests() noexcept
Number of outstanding requests (on the internal list of requests).
commsTypes
Communications types.
@ nonBlocking
"nonBlocking" (immediate) : (MPI_Isend, MPI_Irecv)
static bool finishedRequestPair(label &req0, label &req1)
Non-blocking comms: have both requests finished? Corresponds to pair of MPI_Test().
static bool finishedRequest(const label i)
Non-blocking comms: has request i finished? Corresponds to MPI_Test().
static void waitRequest(const label i)
Wait until request i has finished. Corresponds to MPI_Wait().
Smooth ATC in cells next to a set of patches supplied by type.
The class contains the addressing required by the lduMatrix: upper, lower and losort.
virtual const labelUList & patchAddr(const label patchNo) const =0
Return patch to internal addressing given patch number.
A lduProcessorField type bypassing coupledFvPatchField.
const lduPrimitiveProcessorInterface & procInterface_
Local reference cast into the interface.
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.
lduCalculatedProcessorField(const lduInterface &interface)
Construct from ldu interface.
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.
solveScalarField scalarSendBuf_
Scalar send buffer.
virtual bool all_ready() const
Receive and send requests have both completed.
label recvRequest_
Current (non-blocking) recv request.
solveScalarField scalarRecvBuf_
Scalar recv buffer.
label sendRequest_
Current (non-blocking) send request.
void addToInternalField(solveScalarField &result, const bool add, const scalarField &coeffs, const solveScalarField &vals) const
virtual bool ready() const
Are all (receive) data available?
bool updatedMatrix() const noexcept
Whether matrix has been updated.
const lduInterface & interface() const noexcept
Return the interface.
An abstract base class for implicitly-coupled interfaces e.g. processor and cyclic patches.
Concrete implementation of processor interface. Used to temporarily store settings.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Type & refCast(U &obj)
A dynamic_cast (for references) to Type reference.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
void add(DimensionedField< scalar, GeoMesh > &result, const dimensioned< scalar > &dt1, const DimensionedField< scalar, GeoMesh > &f2)
errorManip< error > abort(error &err)
Field< solveScalar > solveScalarField
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
UList< label > labelUList
A UList of labels.
dict add("bounds", meshBb)
#define forAll(list, i)
Loop across all elements in list.