54 procInterface_(ptf.procInterface_),
68 procInterface_(ptf.procInterface_),
79 return UPstream::finishedRequestPair(recvRequest_, sendRequest_);
86 const bool ok = UPstream::finishedRequest(recvRequest_);
90 if (UPstream::finishedRequest(sendRequest_)) sendRequest_ = -1;
103 <<
"Outstanding request on patch of size " 104 << procInterface_.faceCells().size()
105 <<
" between proc " << procInterface_.myProcNo()
106 <<
" and " << procInterface_.neighbProcNo()
122 <<
"Outstanding request on patch of size " 123 << procInterface_.faceCells().size()
124 <<
" between proc " << procInterface_.myProcNo()
125 <<
" and " << procInterface_.neighbProcNo()
135 const Pstream::commsTypes commsType
138 if (UPstream::parRun())
140 if constexpr (!is_contiguous_v<Type>)
143 <<
"Invalid for non-contiguous data types" 149 Field<Type>&
self = *
this;
152 const Field<Type>& psiInternal = this->internalField();
153 const labelUList& faceCells = procInterface_.faceCells();
155 sendBuf_.resize_nocopy(faceCells.size());
156 self.resize_nocopy(faceCells.size());
160 sendBuf_[i] = psiInternal[faceCells[i]];
164 recvRequest_ = UPstream::nRequests();
167 UPstream::commsTypes::nonBlocking,
168 procInterface_.neighbProcNo(),
170 procInterface_.tag(),
171 procInterface_.comm()
174 sendRequest_ = UPstream::nRequests();
177 UPstream::commsTypes::nonBlocking,
178 procInterface_.neighbProcNo(),
180 procInterface_.tag(),
181 procInterface_.comm()
190 const Pstream::commsTypes commsType
193 if (UPstream::parRun())
197 UPstream::waitRequest(recvRequest_); recvRequest_ = -1;
198 if (UPstream::finishedRequest(sendRequest_)) sendRequest_ = -1;
208 const lduAddressing& lduAddr,
213 const Pstream::commsTypes commsType
216 if (!this->all_ready())
219 <<
"Outstanding request(s) on interface " 228 scalarSendBuf_.resize_nocopy(faceCells.size());
229 scalarRecvBuf_.resize_nocopy(faceCells.size());
233 scalarSendBuf_[i] = psiInternal[faceCells[i]];
237 recvRequest_ = UPstream::nRequests();
240 UPstream::commsTypes::nonBlocking,
241 procInterface_.neighbProcNo(),
243 procInterface_.tag(),
244 procInterface_.comm()
247 sendRequest_ = UPstream::nRequests();
250 UPstream::commsTypes::nonBlocking,
251 procInterface_.neighbProcNo(),
253 procInterface_.tag(),
254 procInterface_.comm()
257 this->updatedMatrix(
false);
276 result[
faceCells[elemI]] += coeffs[elemI]*vals[elemI];
283 result[faceCells[elemI]] -= coeffs[elemI]*vals[elemI];
294 const lduAddressing& lduAddr,
299 const Pstream::commsTypes commsType
302 if (this->updatedMatrix())
307 if (UPstream::parRun())
311 UPstream::waitRequest(recvRequest_); recvRequest_ = -1;
312 if (UPstream::finishedRequest(sendRequest_)) sendRequest_ = -1;
318 addToInternalField(result, !
add, coeffs, scalarRecvBuf_);
320 this->updatedMatrix(
true);
void addToInternalField(solveScalarField &result, const bool add, const scalarField &coeffs, const solveScalarField &vals) const
virtual tmp< Field< Type > > patchNeighbourField() const
Return neighbour field.
Field< solveScalar > solveScalarField
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.
Type & refCast(U &obj)
A dynamic_cast (for references) to Type reference.
virtual void evaluate(const Pstream::commsTypes commsType)
Evaluate the patch field.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
interfaceProperties interface(alpha1, U, thermo->transportPropertiesDict())
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.
void write(vtk::formatter &fmt, const Type &val, const label n=1)
Component-wise write of a value (N times)
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
virtual void initEvaluate(const Pstream::commsTypes commsType)
Initialise the evaluation of the patch field.
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.
virtual bool all_ready() const
Receive and send requests have both completed.
errorManip< error > abort(error &err)
Abstract base class for coupled patches.
virtual bool ready() const
Are all (receive) data available?
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.
void add(FieldField< Field1, typename typeOfSum< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
Concrete implementation of processor interface. Used to temporarily store settings.
calculatedProcessorFvPatchField(const lduInterface &interface, const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
An abstract base class for implicitly-coupled interfaces e.g. processor and cyclic patches...
A processorFvPatchField type bypassing fvPatch.
A class for managing temporary objects.