61Foam::cyclicAMIGAMGInterfaceField::cyclicAMIGAMGInterfaceField
75 doTransform_ =
p.doTransform();
80Foam::cyclicAMIGAMGInterfaceField::cyclicAMIGAMGInterfaceField
83 const bool doTransform,
94Foam::cyclicAMIGAMGInterfaceField::cyclicAMIGAMGInterfaceField
100 GAMGInterfaceField(GAMGCp, is),
107Foam::cyclicAMIGAMGInterfaceField::cyclicAMIGAMGInterfaceField
121 doTransform_ =
p.doTransform();
134 recvRequests_.start(),
139 recvRequests1_.start(),
140 recvRequests1_.size()
144 recvRequests_.clear();
145 recvRequests1_.clear();
151 sendRequests_.start(),
156 sendRequests1_.start(),
157 sendRequests1_.size()
161 sendRequests_.clear();
162 sendRequests1_.clear();
176 const lduAddressing& lduAddr,
186 cyclicAMIInterface_.owner()
187 ? cyclicAMIInterface_.AMI()
188 : cyclicAMIInterface_.neighbPatch().AMI()
190 if (AMI.distributed() && AMI.comm() != -1)
204 <<
"Can only evaluate distributed AMI with nonBlocking"
210 lduAddr.patchAddr(cyclicAMIInterface_.neighbPatchID());
215 transformCoupleField(pnf, cmpt);
218 if (!recvRequests_.empty() || !recvRequests1_.empty())
221 <<
"Outstanding recv request(s) on patch "
222 << cyclicAMIInterface_.index()
226 const auto& cache = AMI.cache();
228 if (cache.index0() == -1 && cache.index1() == -1)
232 cyclicAMIInterface_.owner()
247 19462+cyclicAMIInterface_.index()
253 cache.setDirection(cyclicAMIInterface_.owner());
255 if (cache.index0() != -1)
257 const auto& map0 = cache.cTgtMapPtr0()();
265 19462+cyclicAMIInterface_.index()
269 if (cache.index1() != -1)
271 const auto& map1 = cache.cTgtMapPtr1()();
279 19463+cyclicAMIInterface_.index()
285 this->updatedMatrix(
false);
307 cyclicAMIInterface_.owner()
308 ? cyclicAMIInterface_.AMI()
309 : cyclicAMIInterface_.neighbPatch().AMI()
313 if (AMI.applyLowWeightCorrection())
326 const auto& cache = AMI.cache();
329 sendRequests_.clear();
330 sendRequests1_.clear();
332 if (AMI.distributed() && AMI.comm() != -1)
337 <<
"Can only evaluate distributed AMI with nonBlocking"
341 if (cache.index0() == -1 && cache.index1() == -1)
345 cyclicAMIInterface_.owner()
358 19462+cyclicAMIInterface_.index()
362 recvRequests_.clear();
367 cyclicAMIInterface_.owner(),
374 this->addToInternalField(result, !
add,
faceCells, coeffs, pnf);
378 cache.setDirection(cyclicAMIInterface_.owner());
383 if (cache.index0() != -1)
388 cache.cTgtMapPtr0()().receive
393 19462+cyclicAMIInterface_.index()
397 recvRequests_.clear();
402 AMI.lowWeightCorrection(),
403 cache.cSrcAddress0(),
404 cache.cSrcWeights0(),
405 cache.cSrcWeightsSum0(),
412 pnf *= (1-cache.weight());
415 this->addToInternalField(result, !
add,
faceCells, coeffs, pnf);
418 if (cache.index1() != -1)
423 cache.cTgtMapPtr1()().receive
428 19463+cyclicAMIInterface_.index()
432 recvRequests1_.clear();
437 AMI.lowWeightCorrection(),
438 cache.cSrcAddress1(),
439 cache.cSrcWeights1(),
440 cache.cSrcWeightsSum1(),
447 pnf *= cache.weight();
450 this->addToInternalField(result, !
add,
faceCells, coeffs, pnf);
458 lduAddr.patchAddr(cyclicAMIInterface_.neighbPatchID());
463 transformCoupleField(work, cmpt);
467 if (cache.index0() == -1 && cache.index1() == -1)
472 cyclicAMIInterface_.owner(),
479 this->addToInternalField(result, !
add,
faceCells, coeffs, pnf);
483 cache.setDirection(cyclicAMIInterface_.owner());
485 if (cache.index0() != -1)
490 AMI.lowWeightCorrection(),
491 cache.cSrcAddress0(),
492 cache.cSrcWeights0(),
493 cache.cSrcWeightsSum0(),
500 pnf *= (1 - cache.weight());
503 this->addToInternalField(result, !
add,
faceCells, coeffs, pnf);
506 if (cache.index1() != -1)
511 AMI.lowWeightCorrection(),
512 cache.cSrcAddress1(),
513 cache.cSrcWeights1(),
514 cache.cSrcWeightsSum1(),
521 pnf *= cache.weight();
524 this->addToInternalField(result, !
add,
faceCells, coeffs, pnf);
529 this->updatedMatrix(
true);
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
static void weightedSum(const scalar lowWeightCorrection, const labelListList &allSlots, const scalarListList &allWeights, const scalarField &weightsSum, const UList< Type > &fld, const CombineOp &cop, List< Type > &result, const UList< Type > &defaultValues)
Weighted sum of contributions. Note: cop operates on single Type only.
Abstract base class for GAMG agglomerated interface fields.
Abstract base class for GAMG agglomerated interfaces.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
static bool finishedRequests(label pos, label len=-1)
Non-blocking comms: have all requests (from position onwards) finished? Corresponds to MPI_Testall().
commsTypes
Communications types.
@ nonBlocking
"nonBlocking" (immediate) : (MPI_Isend, MPI_Irecv)
static label commWarn(const label communicator) noexcept
Alter communicator debugging setting. Warns for use of any communicator differing from specified....
A list of pointers to objects of type <T>, without allocation/deallocation management of the pointers...
GAMG agglomerated cyclic interface field.
virtual bool doTransform() const
Cyclic interface functions.
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 int rank() const
Return rank of component for transform.
virtual void write(Ostream &) const
Write to stream.
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 ready() const
Are all (receive) data available?
GAMG agglomerated cyclic AMI interface.
Abstract base class for cyclic AMI coupled interfaces.
cyclicAMILduInterfaceField()
Construct null.
void transformCoupleField(Field< Type > &f) const
Transform given patch field.
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.
An abstract base class for implicitly-coupled interface fields e.g. processor and cyclic patch fields...
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.
An abstract base class for implicitly-coupled interfaces e.g. processor and cyclic patches.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
OBJstream os(runTime.globalPath()/outputName)
::Foam::direction rank(const expressions::valueTypeCode) noexcept
The vector-space rank associated with given valueTypeCode.
Type & refCast(U &obj)
A dynamic_cast (for references) to Type reference.
label readLabel(const char *buf)
Parse entire buffer as a label, skipping leading/trailing whitespace.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
void add(DimensionedField< scalar, GeoMesh > &result, const dimensioned< scalar > &dt1, const DimensionedField< scalar, GeoMesh > &f2)
errorManip< error > abort(error &err)
Field< solveScalar > solveScalarField
static constexpr const zero Zero
Global zero (0).
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
errorManipArg< error, int > exit(error &err, const int errNo=1)
UList< label > labelUList
A UList of labels.
bool readBool(Istream &is)
Read bool from stream using Foam::Switch(Istream&).
dict add("bounds", meshBb)