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()
116 const Pstream::commsTypes commsType
119 if (UPstream::parRun())
121 if (!is_contiguous<Type>::value)
124 <<
"Invalid for non-contiguous data types" 131 const Field<Type>& iF = this->internalField();
132 const labelList& fc = procInterface_.faceCells();
136 sendBuf_[i] = iF[fc[i]];
141 this->resize_nocopy(sendBuf_.size());
143 recvRequest_ = UPstream::nRequests();
146 UPstream::commsTypes::nonBlocking,
147 procInterface_.neighbProcNo(),
150 procInterface_.tag(),
151 procInterface_.comm()
154 sendRequest_ = UPstream::nRequests();
157 UPstream::commsTypes::nonBlocking,
158 procInterface_.neighbProcNo(),
159 sendBuf_.cdata_bytes(),
160 sendBuf_.size_bytes(),
161 procInterface_.tag(),
162 procInterface_.comm()
171 const Pstream::commsTypes commsType
174 if (UPstream::parRun())
178 UPstream::waitRequest(recvRequest_); recvRequest_ = -1;
179 if (UPstream::finishedRequest(sendRequest_)) sendRequest_ = -1;
189 const lduAddressing& lduAddr,
194 const Pstream::commsTypes commsType
197 if (!this->all_ready())
200 <<
"Outstanding request(s) on interface " 211 scalarSendBuf_[i] = psiInternal[fc[i]];
214 scalarRecvBuf_.resize_nocopy(scalarSendBuf_.size());
216 recvRequest_ = UPstream::nRequests();
219 UPstream::commsTypes::nonBlocking,
220 procInterface_.neighbProcNo(),
221 scalarRecvBuf_.data_bytes(),
222 scalarRecvBuf_.size_bytes(),
223 procInterface_.tag(),
224 procInterface_.comm()
227 sendRequest_ = UPstream::nRequests();
230 UPstream::commsTypes::nonBlocking,
231 procInterface_.neighbProcNo(),
232 scalarSendBuf_.cdata_bytes(),
233 scalarSendBuf_.size_bytes(),
234 procInterface_.tag(),
235 procInterface_.comm()
238 this->updatedMatrix(
false);
257 result[
faceCells[elemI]] += coeffs[elemI]*vals[elemI];
264 result[faceCells[elemI]] -= coeffs[elemI]*vals[elemI];
275 const lduAddressing& lduAddr,
280 const Pstream::commsTypes commsType
283 if (this->updatedMatrix())
288 if (UPstream::parRun())
292 UPstream::waitRequest(recvRequest_); recvRequest_ = -1;
293 if (UPstream::finishedRequest(sendRequest_)) sendRequest_ = -1;
299 addToInternalField(result, !
add, coeffs, scalarRecvBuf_);
301 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 of internal 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). Generates a FatalError on failed casts and uses the virtual type() m...
virtual void evaluate(const Pstream::commsTypes commsType)
Evaluate the patch field.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
void resize_nocopy(const label len)
Adjust allocated size of list without necessarily.
interfaceProperties interface(alpha1, U, thermo->transportPropertiesDict())
Smooth ATC in cells next to a set of patches supplied by type.
#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.
List< label > labelList
A List of labels.
A class for managing temporary objects.