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)),
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()
124 << abort(FatalError);
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()
149 << abort(FatalError);
166 if (
debug && !ptf.all_ready())
169 <<
"Outstanding request(s) on patch " << procPatch_.name()
170 << abort(FatalError);
178bool Foam::processorFvPatchField<Type>::all_ready()
const
201 if (debug && !this->ready())
204 <<
"Outstanding request on patch " << procPatch_.name()
217 if (debug && !this->ready())
220 <<
"Outstanding request on patch " << procPatch_.name()
235 sendBuf_.resize_nocopy(this->patch().size());
236 this->patchInternalField(sendBuf_);
247 <<
"Invalid for non-contiguous data types"
259 procPatch_.neighbProcNo(),
269 procPatch_.neighbProcNo(),
277 procPatch_.compressedSend(commsType, sendBuf_);
306 procPatch_.compressedReceive<Type>(commsType, *
this);
325 this->patchInternalField(result);
326 const auto& pif = result;
328 const auto& pnf = *
this;
330 const label len = result.size();
332 for (label i = 0; i < len; ++i)
334 result[i] = deltaCoeffs[i]*(pnf[i] - pif[i]);
370 scalarSendBuf_.resize_nocopy(
faceCells.size());
371 scalarRecvBuf_.resize_nocopy(
faceCells.size());
375 scalarSendBuf_[i] = psiInternal[
faceCells[i]];
386 if (debug && !this->all_ready())
389 <<
"Outstanding request(s) on patch " << procPatch_.name()
397 procPatch_.neighbProcNo(),
407 procPatch_.neighbProcNo(),
415 procPatch_.compressedSend(commsType, scalarSendBuf_);
418 this->updatedMatrix(
false);
427 const lduAddressing& lduAddr,
435 if (this->updatedMatrix())
457 scalarRecvBuf_.resize_nocopy(
faceCells.size());
458 procPatch_.compressedReceive(commsType, scalarRecvBuf_);
465 transformCoupleField(scalarRecvBuf_, cmpt);
490 sendBuf_.resize_nocopy(
faceCells.size());
491 recvBuf_.resize_nocopy(
faceCells.size());
506 if (
debug && !this->all_ready())
509 <<
"Outstanding request(s) on patch " << procPatch_.name()
517 procPatch_.neighbProcNo(),
527 procPatch_.neighbProcNo(),
535 procPatch_.compressedSend(commsType, sendBuf_);
538 this->updatedMatrix(
false);
547 const lduAddressing& lduAddr,
554 if (this->updatedMatrix())
576 recvBuf_.resize_nocopy(
faceCells.size());
577 procPatch_.compressedReceive(commsType, recvBuf_);
582 transformCoupleField(recvBuf_);
585 this->addToInternalField(result, !
add,
faceCells, coeffs, recvBuf_);
587 this->updatedMatrix(
true);
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Generic templated field type that is much like a Foam::List except that it is expected to hold numeri...
A simple container of IOobject preferences. Can also be used for general handling of read/no-read/rea...
const word & name() const noexcept
Return the object name.
fileName objectPath() const
The complete path + object name.
void resize_nocopy(const label len)
Adjust allocated size of list without necessarily.
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.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
void deepCopy(const UList< T > &list)
Copy elements of the given UList. Sizes must match!
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 parRun(const bool on) noexcept
Set as parallel run on/off.
static bool floatTransfer
Should compact transfer be used in which floats replace doubles reducing the bandwidth requirement at...
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().
static bool & parRun() noexcept
Test if this a parallel run.
Abstract base class for coupled patches.
virtual tmp< Field< Type > > snGrad() const
Return patch-normal gradient.
coupledFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Smooth ATC in cells next to a set of patches supplied by type.
const fvPatch & patch() const noexcept
Return the patch.
A FieldMapper for finite-volume patch fields.
virtual tmp< Field< Type > > patchInternalField() const
Return internal field next to patch.
const DimensionedField< Type, volMesh > & internalField() const noexcept
Return const-reference to the dimensioned internal field.
bool readValueEntry(const dictionary &dict, IOobjectOption::readOption readOpt=IOobjectOption::LAZY_READ)
Read the "value" entry into *this.
void extrapolateInternal()
Assign the patch field from the internal field.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
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.
bool updatedMatrix() const noexcept
Whether matrix has been updated.
void addToInternalField(Field< Type > &result, const bool add, const labelUList &faceCells, const scalarField &coeffs, const Field< Type > &vals) const
Add/subtract weighted contributions to internal field.
A traits class, which is primarily used for primitives and vector-space.
This boundary condition enables processor communication across patches.
virtual bool doTransform() const
Does the patch field perform the transformation.
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.
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 void initEvaluate(const Pstream::commsTypes commsType)
Initialise the evaluation of the patch field.
processorFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
virtual void evaluate(const Pstream::commsTypes commsType)
Evaluate the patch field.
virtual bool ready() const
Are all (receive) data available?
virtual tmp< Field< Type > > patchNeighbourField() const
Return neighbour field.
Abstract base class for processor coupled interfaces.
processorLduInterfaceField()=default
Default construct.
void transformCoupleField(Field< Type > &f) const
Transform given patch field.
A class for managing temporary objects.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Namespace for handling debugging switches.
Type & refCast(U &obj)
A dynamic_cast (for references) to Type reference.
refinementData transform(const tensor &, const refinementData val)
No-op rotational transform for base types.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
const word GlobalIOList< Tuple2< scalar, vector > >::typeName("scalarVectorTable")
void add(DimensionedField< scalar, GeoMesh > &result, const dimensioned< scalar > &dt1, const DimensionedField< scalar, GeoMesh > &f2)
const Type * isA(const U &obj)
Attempt dynamic_cast to Type.
errorManip< error > abort(error &err)
Field< solveScalar > solveScalarField
IOerror FatalIOError
Error stream (stdout output on all processes), with additional 'FOAM FATAL IO ERROR' header text and ...
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
constexpr bool is_contiguous_v
The is_contiguous value of Type (after stripping of qualifiers).
errorManipArg< error, int > exit(error &err, const int errNo=1)
UList< label > labelUList
A UList of labels.
dict add("bounds", meshBb)
#define forAll(list, i)
Loop across all elements in list.