181 bool hasCyclicAMI =
false;
182 if (!processorAgglomerate())
184 const auto& fineInterfaces = interfaceLevel(0);
185 forAll(fineInterfaces, inti)
187 if (fineInterfaces.set(inti))
189 const auto& intf = fineInterfaces[inti];
199 <<
"Detected cyclicA(C)MI at interface " << inti
200 <<
".Redoing patch agglomeration" <<
endl;
214 label fineLevelIndex = 0;
215 fineLevelIndex < size();
222 const auto& fineMesh = meshLevel(fineLevelIndex);
223 const auto& fineInterfaces = interfaceLevel(fineLevelIndex);
228 restrictAddressing(fineLevelIndex);
231 forAll(fineInterfaces, inti)
233 if (fineInterfaces.set(inti))
235 const auto& intf = fineInterfaces[inti];
243 if (fineLevelIndex == 0)
245 intf.initInternalFieldTransfer
249 fineMeshAddr.patchAddr(inti)
254 intf.initInternalFieldTransfer
270 forAll(fineInterfaces, inti)
272 if (fineInterfaces.set(inti))
274 const auto& intf = fineInterfaces[inti];
288 if (fineLevelIndex == 0)
290 restrictMapInternalField =
291 intf.interfaceInternalField
294 fineMeshAddr.patchAddr(inti)
299 restrictMapInternalField =
300 intf.interfaceInternalField
307 intf.internalFieldTransfer
314 meshLevels_[fineLevelIndex];
321 coarseMesh.rawInterfaces(),
323 restrictMapInternalField(),
324 nbrRestrictMapInternalField(),
331 coarseMesh.interfaces().set
336 coarseMesh.primitiveInterfaces().set
339 &coarseMesh.interfaces()[inti]
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
Geometric agglomerated algebraic multigrid agglomeration class.
virtual bool movePoints()
Update when the mesh moves.
bool processorAgglomerate() const
Whether to agglomerate across processors.
label nCellsInCoarsestLevel_
Number of cells in coarsest level.
bool requireUpdate_
Does agglomeration require update.
PtrList< lduPrimitiveMesh > meshLevels_
Hierarchy of mesh addressing.
bool requiresUpdate() const
Does the agglomeration need to be fully updated?
void printLevels() const
Print level overview.
const lduInterfacePtrsList & interfaceLevel(const label leveli) const
Return LDU interface addressing of given level.
const labelField & restrictAddressing(const label leveli) const
Return cell restrict addressing of given level.
const lduMesh & meshLevel(const label leveli) const
Return LDU mesh of given level.
static autoPtr< GAMGInterface > New(const label index, const lduInterfacePtrsList &coarseInterfaces, const lduInterface &fineInterface, const labelField &localRestrictAddressing, const labelField &neighbourRestrictAddressing, const label fineLevelIndex, const label coarseComm)
Return a pointer to a new interface created on freestore given.
const Internal::FieldType & primitiveField() const noexcept
Return a const-reference to the internal field values.
const lduMesh & mesh() const noexcept
static label nRequests() noexcept
Number of outstanding requests (on the internal list of requests).
@ nonBlocking
"nonBlocking" (immediate) : (MPI_Isend, MPI_Irecv)
static void waitRequests()
Wait for all requests to finish.
const T * set(const label i) const
Return const pointer to element (can be nullptr), or nullptr for out-of-range access (ie,...
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
T * ptr() noexcept
Same as release().
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Agglomerate using the pair algorithm.
virtual bool movePoints()
Update when the mesh moves.
faceAreaPairGAMGAgglomeration(const lduMesh &mesh, const dictionary &controlDict)
Construct given mesh and controls.
Mesh data needed to do the Finite Volume discretisation.
const surfaceVectorField & Sf() const
Return cell face area vectors.
const surfaceScalarField & magSf() const
Return cell face area magnitudes.
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.
Abstract base class for meshes which provide LDU addressing for the construction of lduMatrix and LDU...
Simplest concrete lduMesh that stores the addressing needed by lduMatrix.
const lduInterfacePtrsList & rawInterfaces() const
Return a list of pointers for each patch.
PtrList< const lduInterface > & primitiveInterfaces()
Return a non-const list of primitive interfaces.
virtual lduInterfacePtrsList interfaces() const
Return a list of pointers for each patch with only those pointing to interfaces being set.
Agglomerate using the pair algorithm.
static tmp< labelField > agglomerate(label &nCoarseCells, const lduAddressing &fineMatrixAddressing, const scalarField &faceWeights)
Calculate and return agglomeration.
pairGAMGAgglomeration(const pairGAMGAgglomeration &)=delete
No copy construct.
A class for managing temporary objects.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
runTime controlDict().readEntry("adjustTimeStep"
#define DebugPoutInFunction
Report an information message using Foam::Pout.
Namespace for handling debugging switches.
Type & refCast(U &obj)
A dynamic_cast (for references) to Type reference.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Ostream & endl(Ostream &os)
Add newline and flush stream.
dimensionedScalar sqrt(const dimensionedScalar &ds)
const Type * isA(const U &obj)
Attempt dynamic_cast to Type.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
Field< vector > vectorField
Specialisation of Field<T> for vector.
Field< label > labelField
Specialisation of Field<T> for label.
dimensioned< Type > cmptMultiply(const dimensioned< Type > &, const dimensioned< Type > &)
#define forAll(list, i)
Loop across all elements in list.