80 <<
"\n patch type '" <<
p.type()
81 <<
"' not constraint type '" <<
typeName <<
"'"
82 <<
"\n for patch " <<
p.name()
87 if (debug && !ptf.all_ready())
90 <<
"Outstanding request(s) on patch " << procPatch_.name()
112 <<
"\n patch type '" <<
p.type()
113 <<
"' not constraint type '" <<
typeName <<
"'"
114 <<
"\n for patch " <<
p.name()
131 const processorFaPatchField<Type>& ptf
134 processorLduInterfaceField(),
135 coupledFaPatchField<Type>(ptf),
136 procPatch_(
refCast<const processorFaPatch>(ptf.patch())),
139 sendBuf_(std::move(ptf.sendBuf_)),
140 recvBuf_(std::move(ptf.recvBuf_)),
141 scalarSendBuf_(std::move(ptf.scalarSendBuf_)),
142 scalarRecvBuf_(std::move(ptf.scalarRecvBuf_))
144 if (debug && !ptf.all_ready())
147 <<
"Outstanding request(s) on patch " << procPatch_.name()
148 << abort(FatalError);
165 if (
debug && !ptf.all_ready())
168 <<
"Outstanding request(s) on patch " << procPatch_.name()
169 << abort(FatalError);
177bool Foam::processorFaPatchField<Type>::all_ready()
const
200 if (debug && !this->ready())
203 <<
"Outstanding request on patch " << procPatch_.name()
216 if (debug && !this->ready())
219 <<
"Outstanding request on patch " << procPatch_.name()
234 sendBuf_.resize_nocopy(this->patch().size());
235 this->patchInternalField(sendBuf_);
242 <<
"Invalid for non-contiguous data types"
254 procPatch_.neighbProcNo(),
264 procPatch_.neighbProcNo(),
272 procPatch_.send(commsType, sendBuf_);
297 procPatch_.receive<Type>(commsType, *
this);
315 this->patchInternalField(result);
316 const auto& pif = result;
319 const auto& deltaCoeffs = this->
patch().deltaCoeffs();
321 const label len = result.size();
323 for (label i = 0; i < len; ++i)
325 result[i] = deltaCoeffs[i]*(pnf[i] - pif[i]);
357 scalarSendBuf_.resize_nocopy(
faceCells.size());
358 scalarRecvBuf_.resize_nocopy(
faceCells.size());
362 scalarSendBuf_[i] = psiInternal[
faceCells[i]];
369 if (debug && !this->all_ready())
372 <<
"Outstanding request(s) on patch " << procPatch_.name()
380 procPatch_.neighbProcNo(),
390 procPatch_.neighbProcNo(),
398 procPatch_.send(commsType, scalarSendBuf_);
401 this->updatedMatrix(
false);
410 const lduAddressing& lduAddr,
418 if (this->updatedMatrix())
436 scalarRecvBuf_.resize_nocopy(
faceCells.size());
437 procPatch_.receive(commsType, scalarRecvBuf_);
444 transformCoupleField(scalarRecvBuf_, cmpt);
469 sendBuf_.resize_nocopy(
faceCells.size());
470 recvBuf_.resize_nocopy(
faceCells.size());
482 if (
debug && !this->all_ready())
485 <<
"Outstanding request(s) on patch " << procPatch_.name()
493 procPatch_.neighbProcNo(),
503 procPatch_.neighbProcNo(),
511 procPatch_.send(commsType, sendBuf_);
514 this->updatedMatrix(
false);
523 const lduAddressing& lduAddr,
530 if (this->updatedMatrix())
548 recvBuf_.resize_nocopy(
faceCells.size());
549 procPatch_.receive(commsType, recvBuf_);
554 transformCoupleField(recvBuf_);
557 this->addToInternalField(result, !
add,
faceCells, coeffs, recvBuf_);
559 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 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.
Author Zeljko Tukovic, FMENA Hrvoje Jasak, Wikki Ltd.
coupledFaPatchField(const faPatch &, const DimensionedField< Type, areaMesh > &)
Construct from patch and internal field.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
const faPatch & patch() const noexcept
Return the patch.
A FieldMapper for finite-area patch fields.
virtual tmp< Field< Type > > patchInternalField() const
Return internal field next to patch.
const DimensionedField< Type, areaMesh > & 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.
Finite area patch class. Used for 2-D non-Euclidian finite area method.
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.
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.
Author Zeljko Tukovic, FMENA Hrvoje Jasak, Wikki Ltd.
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 tmp< Field< Type > > snGrad() const
Return patch-normal gradient.
virtual void initEvaluate(const Pstream::commsTypes commsType)
Initialise the evaluation of the patch field.
processorFaPatchField(const faPatch &, const DimensionedField< Type, areaMesh > &)
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 given internal field.
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.
const std::string patch
OpenFOAM patch number as a std::string.
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)
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 ...
bool isType(const U &obj)
Check if typeid of the object and Type are identical.
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.