46 outstandingSendRequest_(-1),
47 outstandingRecvRequest_(-1)
58 procInterface_(ptf.procInterface_),
59 sendBuf_(procInterface_.
faceCells().size()),
60 receiveBuf_(procInterface_.
faceCells().size()),
61 scalarSendBuf_(procInterface_.
faceCells().size()),
62 scalarReceiveBuf_(procInterface_.
faceCells().size()),
63 outstandingSendRequest_(-1),
64 outstandingRecvRequest_(-1)
77 procInterface_(ptf.procInterface_),
78 sendBuf_(procInterface_.
faceCells().size()),
79 receiveBuf_(procInterface_.
faceCells().size()),
80 scalarSendBuf_(procInterface_.
faceCells().size()),
81 scalarReceiveBuf_(procInterface_.
faceCells().size()),
82 outstandingSendRequest_(-1),
83 outstandingRecvRequest_(-1)
94 this->outstandingSendRequest_ >= 0
95 && this->outstandingSendRequest_ < UPstream::nRequests()
98 if (!UPstream::finishedRequest(this->outstandingSendRequest_))
103 this->outstandingSendRequest_ = -1;
107 this->outstandingRecvRequest_ >= 0
108 && this->outstandingRecvRequest_ < UPstream::nRequests()
111 if (!UPstream::finishedRequest(this->outstandingRecvRequest_))
116 this->outstandingRecvRequest_ = -1;
129 <<
"On patch of size " << procInterface_.faceCells().size()
130 <<
" between proc " << procInterface_.myProcNo()
131 <<
" and " << procInterface_.neighbProcNo()
132 <<
" outstanding request." 142 const Pstream::commsTypes commsType
145 if (Pstream::parRun())
147 if (!is_contiguous<Type>::value)
150 <<
"Invalid for non-contiguous data types" 157 const Field<Type>& iF = this->internalField();
158 const labelList& fc = procInterface_.faceCells();
162 sendBuf_[i] = iF[fc[i]];
167 this->
setSize(sendBuf_.size());
168 outstandingRecvRequest_ = UPstream::nRequests();
171 Pstream::commsTypes::nonBlocking,
172 procInterface_.neighbProcNo(),
175 procInterface_.tag(),
176 procInterface_.comm()
179 outstandingSendRequest_ = UPstream::nRequests();
182 Pstream::commsTypes::nonBlocking,
183 procInterface_.neighbProcNo(),
184 sendBuf_.cdata_bytes(),
185 sendBuf_.size_bytes(),
186 procInterface_.tag(),
187 procInterface_.comm()
196 const Pstream::commsTypes commsType
199 if (Pstream::parRun())
203 outstandingRecvRequest_ >= 0
204 && outstandingRecvRequest_ < UPstream::nRequests()
207 UPstream::waitRequest(outstandingRecvRequest_);
209 outstandingSendRequest_ = -1;
210 outstandingRecvRequest_ = -1;
220 const lduAddressing& lduAddr,
225 const Pstream::commsTypes commsType
232 scalarSendBuf_.
setSize(fc.size());
235 scalarSendBuf_[i] = psiInternal[fc[i]];
242 <<
" outstanding request." 248 scalarReceiveBuf_.setSize(scalarSendBuf_.size());
249 outstandingRecvRequest_ = UPstream::nRequests();
253 Pstream::commsTypes::nonBlocking,
254 procInterface_.neighbProcNo(),
255 scalarReceiveBuf_.data_bytes(),
256 scalarReceiveBuf_.size_bytes(),
257 procInterface_.tag(),
258 procInterface_.comm()
261 outstandingSendRequest_ = UPstream::nRequests();
265 Pstream::commsTypes::nonBlocking,
266 procInterface_.neighbProcNo(),
267 scalarSendBuf_.cdata_bytes(),
268 scalarSendBuf_.size_bytes(),
269 procInterface_.tag(),
270 procInterface_.comm()
273 const_cast<lduInterfaceField&
> 276 ).updatedMatrix() =
false;
295 result[
faceCells[elemI]] += coeffs[elemI]*vals[elemI];
302 result[faceCells[elemI]] -= coeffs[elemI]*vals[elemI];
313 const lduAddressing& lduAddr,
318 const Pstream::commsTypes commsType
321 if (this->updatedMatrix())
329 outstandingRecvRequest_ >= 0
330 && outstandingRecvRequest_ < UPstream::nRequests()
333 UPstream::waitRequest(outstandingRecvRequest_);
336 outstandingSendRequest_ = -1;
337 outstandingRecvRequest_ = -1;
341 addToInternalField(result, !
add, coeffs, scalarReceiveBuf_);
343 const_cast<lduInterfaceField&
> 345 static_cast<const lduInterfaceField&
>(*this)
346 ).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) that generates FatalError on failed casts, uses the virtual type() me...
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.
An abstract base class for implicitly-coupled interface fields e.g. processor and cyclic patch fields...
#define forAll(list, i)
Loop across all elements in list.
points setSize(newPointi)
void write(vtk::formatter &fmt, const Type &val, const label n=1)
Component-wise write of a value (N times)
void setSize(const label n)
Alias for resize()
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.
errorManip< error > abort(error &err)
Abstract base class for coupled patches.
virtual bool ready() const
Is all 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.