62#ifndef Foam_GAMGAgglomeration_H
63#define Foam_GAMGAgglomeration_H
90 public MeshObject<lduMesh, MoveableMeshObject, GAMGAgglomeration>
205 const label nCreatedLevels,
206 const bool doProcessorAgglomerate
212 const label nCellsInCoarsestLevel,
214 const label nCoarseCells,
238 const label allMeshComm,
239 const label levelIndex
250 const label levelIndex
417 label
nCells(
const label leveli)
const
423 label
nFaces(
const label leveli)
const
443 const Field<Type>& ff,
444 const label fineLevelIndex,
445 const bool procAgglom
453 const Field<Type>& ff,
454 const label fineLevelIndex
462 const Field<Type>& ff,
472 const label coarseLevelIndex,
473 const bool procAgglom
484 const label coarseLevelIndex
554 const label nCellsInCoarsestLevel,
555 const label startLevel,
557 const bool doProcessorAgglomerate =
true
Generic templated field type that is much like a Foam::List except that it is expected to hold numeri...
const lduInterfacePtrsList meshInterfaces_
Cached mesh interfaces.
virtual bool movePoints()
Update when the mesh moves.
const labelList & nPatchFaces(const label leveli) const
Return number of coarse patch faces (before processor agglomeration).
const labelList & faceRestrictAddressing(const label leveli) const
Return face restrict addressing of given level.
void procAgglomerateRestrictAddressing(const label comm, const labelList &procIDs, const label levelIndex)
Collect and combine basic restriction addressing:
bool processorAgglomerate() const
Whether to agglomerate across processors.
TypeName("GAMGAgglomeration")
Runtime type information.
void clearLevel(const label leveli)
const labelListListList & boundaryFaceMap(const label fineLeveli) const
Mapping from processor to procMesh boundary face.
void restrictField(Field< Type > &cf, const Field< Type > &ff, const label fineLevelIndex, const bool procAgglom) const
Restrict (integrate by summation) cell field.
label agglomCommunicator(const label fineLeveli) const
Communicator for collecting contributions.
static const GAMGAgglomeration & New(const lduMesh &mesh, const dictionary &controlDict)
Return the selected geometric agglomerator.
void agglomerateLduAddressing(const label fineLevelIndex)
Assemble coarse mesh addressing.
static void calculateRegionMaster(const label comm, const labelList &procAgglomMap, labelList &masterProcs, List< label > &agglomProcIDs)
Given fine to coarse processor map determine:
~GAMGAgglomeration()
Destructor.
PtrList< labelListList > patchFaceRestrictAddressing_
Patch-local face restriction addressing array.
PtrList< boolList > faceFlipMap_
Face flip: for faces mapped to internal faces stores whether.
PtrList< UPstream::communicator > procAgglomCommunicator_
Communicator for collecting contributions. Note self-contained.
void prolongField(Field< Type > &ff, const Field< Type > &cf, const label coarseLevelIndex, const bool procAgglom) const
Prolong (interpolate by injection) cell field.
PtrList< labelList > nPatchFaces_
The number of (coarse) patch faces in each level.
void operator=(const GAMGAgglomeration &)=delete
No copy assignment.
void procAgglomerateLduAddressing(const label comm, const labelList &procAgglomMap, const labelList &procIDs, const label allMeshComm, const label levelIndex)
Collect and combine processor meshes into allMesh:
const label maxLevels_
Max number of levels.
void compactLevels(const label nCreatedLevels, const bool doProcessorAgglomerate)
Shrink the number of levels to that specified. Optionally do.
const labelListList & patchFaceRestrictAddressing(const label leveli) const
static bool checkRestriction(labelList &newRestrict, label &nNewCoarse, const lduAddressing &fineAddressing, const labelUList &restriction, const label nCoarse)
Given restriction determines if coarse cells are connected.
label nCellsInCoarsestLevel_
Number of cells in coarsest level.
const labelList & procAgglomMap(const label fineLeveli) const
Mapping from processor to agglomerated processor (global, all processors have the same information)....
autoPtr< GAMGProcAgglomeration > procAgglomeratorPtr_
bool requireUpdate_
Does agglomeration require update.
labelList nFaces_
The number of (coarse) faces in each level.
const boolList & faceFlipMap(const label leveli) const
Return face flip map of given level.
PtrList< lduPrimitiveMesh > meshLevels_
Hierarchy of mesh addressing.
GAMGAgglomeration(const GAMGAgglomeration &)=delete
No copy construct.
const labelList & cellOffsets(const label fineLeveli) const
Mapping from processor to procMesh cells.
labelList nCells_
The number of cells in each level.
bool hasProcMesh(const label fineLeveli) const
Check that level has combined mesh.
declareRunTimeSelectionTable(autoPtr, GAMGAgglomeration, lduMesh,(const lduMesh &mesh, const dictionary &controlDict),(mesh, controlDict))
Runtime selection table for pure geometric agglomerators.
bool continueAgglomerating(const label nCellsInCoarsestLevel, const label nCells, const label nCoarseCells, const label comm) const
Check the need for further agglomeration.
const labelListList & faceMap(const label fineLeveli) const
Mapping from processor to procMesh face.
bool requiresUpdate() const
Does the agglomeration need to be fully updated?
void printLevels() const
Print level overview.
labelList procCommunicator_
Communicator for given level.
PtrList< labelList > agglomProcIDs_
Per level the set of processors to agglomerate. Element 0 is.
void restrictFaceField(Field< Type > &cf, const Field< Type > &ff, const label fineLevelIndex) const
Restrict (integrate by summation) face field.
declareRunTimeSelectionTable(autoPtr, GAMGAgglomeration, lduMatrix,(const lduMatrix &matrix, const dictionary &controlDict),(matrix, controlDict))
Runtime selection table for matrix or mixed geometric/matrix agglomerators.
PtrList< labelList > procAgglomMap_
Per level, per processor the processor it agglomerates into.
PtrList< labelListList > procBoundaryMap_
Mapping from processor to procMeshLevel boundary.
const labelListList & boundaryMap(const label fineLeveli) const
Mapping from processor to procMesh boundary.
void combineLevels(const label curLevel)
Combine a level with the previous one.
const labelList & agglomProcIDs(const label fineLeveli) const
Set of processors to agglomerate. Element 0 is the master processor. (local, same only on those proce...
PtrList< labelList > procCellOffsets_
Mapping from processor to procMeshLevel cells.
PtrList< labelField > restrictAddressing_
Cell restriction addressing array.
PtrList< labelListList > procFaceMap_
Mapping from processor to procMeshLevel face.
PtrList< labelList > faceRestrictAddressing_
Face restriction addressing array.
declareRunTimeSelectionTable(autoPtr, GAMGAgglomeration, geometry,(const lduMesh &mesh, const scalarField &cellVolumes, const vectorField &faceAreas, const dictionary &controlDict),(mesh, cellVolumes, faceAreas, controlDict))
Runtime selection table for matrix or mixed geometric/matrix agglomerators.
friend class GAMGProcAgglomeration
Declare friendship with GAMGProcAgglomeration.
const lduInterfacePtrsList & interfaceLevel(const label leveli) const
Return LDU interface addressing of given level.
const label updateInterval_
Update agglomeration every updateInterval_ steps.
const labelField & restrictAddressing(const label leveli) const
Return cell restrict addressing of given level.
bool hasMeshLevel(const label leveli) const
Do we have mesh for given level?
const Field< Type > & prolongField(Field< Type > &ff, Field< Type > &work, const Field< Type > &cf, const label coarseLevelIndex) const
Prolong (interpolate by injection) cell field. Return reference.
label nCells(const label leveli) const
Return number of coarse cells (before processor agglomeration).
label procCommunicator(const label fineLeveli) const
Communicator for current level or -1.
const lduMesh & meshLevel(const label leveli) const
Return LDU mesh of given level.
virtual void agglomerate(const label nCellsInCoarsestLevel, const label startLevel, const scalarField &startFaceWeights, const bool doProcessorAgglomerate=true)=0
Agglomerate from a starting level. Starting level is usually 0 (initial mesh) but sometimes >0 (resta...
PtrList< labelListListList > procBoundaryFaceMap_
Mapping from processor to procMeshLevel boundary face.
label nFaces(const label leveli) const
Return number of coarse faces (before processor agglomeration).
Processor agglomeration of GAMGAgglomerations.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
MeshObject(const lduMesh &mesh)
const lduMesh & mesh() const noexcept
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
The class contains the addressing required by the lduMatrix: upper, lower and losort.
lduMatrix is a general matrix class in which the coefficients are stored as three arrays,...
Abstract base class for meshes which provide LDU addressing for the construction of lduMatrix and LDU...
Class containing processor-to-processor mapping information.
runTime controlDict().readEntry("adjustTimeStep"
List< labelList > labelListList
List of labelList.
List< label > labelList
A List of labels.
List< labelListList > labelListListList
List of labelListList.
UPtrList< const lduInterface > lduInterfacePtrsList
Store lists of lduInterface as a UPtrList.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Field< vector > vectorField
Specialisation of Field<T> for vector.
Field< label > labelField
Specialisation of Field<T> for label.
List< bool > boolList
A List of bools.
UList< label > labelUList
A UList of labels.
Specialisations of Field<T> for scalar, vector and tensor.
Macros to ease declaration of run-time selection tables.
#define declareRunTimeSelectionTable(ptrWrapper, baseType, argNames, argList, parList)
Declare a run-time selection (variables and adder classes).
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.