61Foam::cyclicACMIGAMGInterfaceField::cyclicACMIGAMGInterfaceField
75 doTransform_ =
p.doTransform();
80Foam::cyclicACMIGAMGInterfaceField::cyclicACMIGAMGInterfaceField
83 const bool doTransform,
94Foam::cyclicACMIGAMGInterfaceField::cyclicACMIGAMGInterfaceField
100 GAMGInterfaceField(GAMGCp, is),
107Foam::cyclicACMIGAMGInterfaceField::cyclicACMIGAMGInterfaceField
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 cyclicACMIInterface_.owner()
187 ? cyclicACMIInterface_.AMI()
188 : cyclicACMIInterface_.neighbPatch().AMI()
191 if (AMI.distributed() && AMI.comm() != -1)
193 DebugPout<<
"cyclicACMIFvPatchField::initInterfaceMatrixUpdate() :"
194 <<
" interface:" << cyclicACMIInterface_.index()
195 <<
" size:" << cyclicACMIInterface_.size()
196 <<
" owner:" << cyclicACMIInterface_.owner()
197 <<
" AMI distributed:" << AMI.distributed()
204 <<
"Can only evaluate distributed AMI with nonBlocking"
210 lduAddr.patchAddr(cyclicACMIInterface_.neighbPatchID());
215 transformCoupleField(pnf, cmpt);
219 if (!recvRequests_.empty() || !recvRequests1_.empty())
222 <<
"Outstanding recv request(s) on patch "
223 << cyclicACMIInterface_.index()
227 const auto& cache = AMI.cache();
229 if (cache.index0() == -1 && cache.index1() == -1)
233 cyclicACMIInterface_.owner()
248 19462+cyclicACMIInterface_.index()
254 cache.setDirection(cyclicACMIInterface_.owner());
256 if (cache.index0() != -1)
258 const auto& map0 = cache.cTgtMapPtr0()();
266 19462+cyclicACMIInterface_.index()
270 if (cache.index1() != -1)
272 const auto& map1 = cache.cTgtMapPtr1()();
280 19463+cyclicACMIInterface_.index()
286 this->updatedMatrix(
false);
308 cyclicACMIInterface_.owner()
309 ? cyclicACMIInterface_.AMI()
310 : cyclicACMIInterface_.neighbPatch().AMI()
313 const auto& cache = AMI.cache();
315 if (AMI.distributed() && AMI.comm() != -1)
317 if (cache.index0() == -1 && cache.index1() == -1)
321 cyclicACMIInterface_.owner()
334 19462+cyclicACMIInterface_.index()
338 recvRequests_.clear();
343 cyclicACMIInterface_.owner(),
350 this->addToInternalField(result, !
add,
faceCells, coeffs, pnf);
354 cache.setDirection(cyclicACMIInterface_.owner());
359 if (cache.index0() != -1)
364 cache.cTgtMapPtr0()().receive
369 19462+cyclicACMIInterface_.index()
373 recvRequests_.clear();
378 AMI.lowWeightCorrection(),
379 cache.cSrcAddress0(),
380 cache.cSrcWeights0(),
381 cache.cSrcWeightsSum0(),
388 pnf *= (1-cache.weight());
391 this->addToInternalField(result, !
add,
faceCells, coeffs, pnf);
394 if (cache.index1() != -1)
399 cache.cTgtMapPtr1()().receive
404 19463+cyclicACMIInterface_.index()
408 recvRequests1_.clear();
413 AMI.lowWeightCorrection(),
414 cache.cSrcAddress1(),
415 cache.cSrcWeights1(),
416 cache.cSrcWeightsSum1(),
423 pnf *= cache.weight();
426 this->addToInternalField(result, !
add,
faceCells, coeffs, pnf);
434 lduAddr.patchAddr(cyclicACMIInterface_.neighbPatchID());
439 transformCoupleField(work, cmpt);
441 if (cache.index0() == -1 && cache.index1() == -1)
447 cyclicACMIInterface_.owner(),
455 this->addToInternalField(result, !
add,
faceCells, coeffs, pnf);
459 cache.setDirection(cyclicACMIInterface_.owner());
463 if (cache.index0() != -1)
468 AMI.lowWeightCorrection(),
469 cache.cSrcAddress0(),
470 cache.cSrcWeights0(),
471 cache.cSrcWeightsSum0(),
478 pnf *= (1 - cache.weight());
480 this->addToInternalField(result, !
add,
faceCells, coeffs, pnf);
483 if (cache.index1() != -1)
488 AMI.lowWeightCorrection(),
489 cache.cSrcAddress1(),
490 cache.cSrcWeights1(),
491 cache.cSrcWeightsSum1(),
498 pnf *= cache.weight();
500 this->addToInternalField(result, !
add,
faceCells, coeffs, pnf);
505 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.
static const Field< solveScalar > & null() noexcept
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 for Arbitrarily Coupled Mesh Interface (ACMI) fields.
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 ACMI interface.
void transformCoupleField(Field< Type > &f) const
Transform given patch field.
Abstract base class for cyclic AMI coupled interfaces.
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)
#define DebugPout
Report an information message using Foam::Pout.
::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.
Ostream & endl(Ostream &os)
Add newline and flush stream.
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)