40 #ifndef Foam_GAMGAgglomeration_H 41 #define Foam_GAMGAgglomeration_H 60 class GAMGProcAgglomeration;
68 public MeshObject<lduMesh, GeometricMeshObject, GAMGAgglomeration>
174 const label nCreatedLevels,
175 const bool doProcessorAgglomerate
181 const label nCellsInCoarsestLevel,
183 const label nCoarseCells,
207 const label allMeshComm,
208 const label levelIndex
219 const label levelIndex
382 label
nCells(
const label leveli)
const 388 label
nFaces(
const label leveli)
const 408 const Field<Type>&
ff,
409 const label fineLevelIndex,
410 const bool procAgglom
418 const Field<Type>&
ff,
419 const label fineLevelIndex
437 const label coarseLevelIndex,
438 const bool procAgglom
449 const label coarseLevelIndex
519 const label nCellsInCoarsestLevel,
520 const label startLevel,
522 const bool doProcessorAgglomerate =
true autoPtr< GAMGProcAgglomeration > procAgglomeratorPtr_
PtrList< labelListList > procBoundaryMap_
Mapping from processor to procMeshLevel boundary.
const labelList & faceRestrictAddressing(const label leveli) const
Return face restrict addressing of given level.
bool hasProcMesh(const label fineLeveli) const
Check that level has combined mesh.
static bool checkRestriction(labelList &newRestrict, label &nNewCoarse, const lduAddressing &fineAddressing, const labelUList &restriction, const label nCoarse)
Given restriction determines if coarse cells are connected.
const labelList & nPatchFaces(const label leveli) const
Return number of coarse patch faces (before processor agglomeration)
bool continueAgglomerating(const label nCellsInCoarsestLevel, const label nCells, const label nCoarseCells, const label comm) const
Check the need for further agglomeration.
PtrList< labelListList > procFaceMap_
Mapping from processor to procMeshLevel face.
void restrictField(Field< Type > &cf, const Field< Type > &ff, const label fineLevelIndex, const bool procAgglom) const
Restrict (integrate by summation) cell field.
const boolList & faceFlipMap(const label leveli) const
Return face flip map of given level.
PtrList< labelListList > patchFaceRestrictAddressing_
Patch-local face restriction addressing array.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
PtrList< labelListListList > procBoundaryFaceMap_
Mapping from processor to procMeshLevel boundary face.
GAMGAgglomeration(const GAMGAgglomeration &)=delete
No copy construct.
label agglomCommunicator(const label fineLeveli) const
Communicator for collecting contributions.
TypeName("GAMGAgglomeration")
Runtime type information.
const lduMesh & meshLevel(const label leveli) const
Return LDU mesh of given level.
PtrList< labelList > procCellOffsets_
Mapping from processor to procMeshLevel cells.
void restrictFaceField(Field< Type > &cf, const Field< Type > &ff, const label fineLevelIndex) const
Restrict (integrate by summation) face field.
const labelListList & boundaryMap(const label fineLeveli) const
Mapping from processor to procMesh boundary.
~GAMGAgglomeration()
Destructor.
Abstract base class for meshes which provide LDU addressing for the construction of lduMatrix and LDU...
static const GAMGAgglomeration & New(const lduMesh &mesh, const dictionary &controlDict)
Return the selected geometric agglomerator.
void procAgglomerateLduAddressing(const label comm, const labelList &procAgglomMap, const labelList &procIDs, const label allMeshComm, const label levelIndex)
Collect and combine processor meshes into allMesh:
PtrList< labelList > faceRestrictAddressing_
Face restriction addressing array.
List< labelList > labelListList
List of labelList.
PtrList< labelList > nPatchFaces_
The number of (coarse) patch faces in each level.
void clearLevel(const label leveli)
PtrList< labelList > agglomProcIDs_
Per level the set of processors to agglomerate. Element 0 is.
label procCommunicator(const label fineLeveli) const
Communicator for current level or -1.
labelList procCommunicator_
Communicator for given level.
Templated abstract base-class for optional mesh objects used to automate their allocation to the mesh...
const lduInterfacePtrsList meshInterfaces_
Cached mesh interfaces.
bool processorAgglomerate() const
Whether to agglomerate across processors.
PtrList< lduPrimitiveMesh > meshLevels_
Hierarchy of mesh addressing.
const lduMesh & mesh() const noexcept
Reference to the mesh.
PtrList< UPstream::communicator > procAgglomCommunicator_
Communicator for collecting contributions. Note self-contained.
const labelList & agglomProcIDs(const label fineLeveli) const
Set of processors to agglomerate. Element 0 is the master processor. (local, same only on those proce...
void printLevels() const
Print level overview.
labelList nCells_
The number of cells in each level.
void prolongField(Field< Type > &ff, const Field< Type > &cf, const label coarseLevelIndex, const bool procAgglom) const
Prolong (interpolate by injection) cell field.
runTime controlDict().readEntry("adjustTimeStep"
The central control dictionary, the contents of which are either taken directly from the FOAM_CONTROL...
labelList nFaces_
The number of (coarse) faces in each level.
PtrList< labelField > restrictAddressing_
Cell restriction addressing array.
void agglomerateLduAddressing(const label fineLevelIndex)
Assemble coarse mesh addressing.
label nFaces(const label leveli) const
Return number of coarse faces (before processor agglomeration)
const label maxLevels_
Max number of levels.
Specialisations of Field<T> for scalar, vector and tensor.
lduMatrix is a general matrix class in which the coefficients are stored as three arrays...
const labelList & cellOffsets(const label fineLeveli) const
Mapping from processor to procMesh cells.
void procAgglomerateRestrictAddressing(const label comm, const labelList &procIDs, const label levelIndex)
Collect and combine basic restriction addressing:
const labelListListList & boundaryFaceMap(const label fineLeveli) const
Mapping from processor to procMesh boundary face.
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers...
const labelList & procAgglomMap(const label fineLeveli) const
Mapping from processor to agglomerated processor (global, all processors have the same information)...
Processor agglomeration of GAMGAgglomerations.
PtrList< labelList > procAgglomMap_
Per level, per processor the processor it agglomerates into.
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.
declareRunTimeSelectionTable(autoPtr, GAMGAgglomeration, lduMesh,(const lduMesh &mesh, const dictionary &controlDict),(mesh, controlDict))
Runtime selection table for pure geometric agglomerators.
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
The class contains the addressing required by the lduMatrix: upper, lower and losort.
PtrList< boolList > faceFlipMap_
Face flip: for faces mapped to internal faces stores whether.
Macros to ease declaration of run-time selection tables.
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...
List< label > labelList
A List of labels.
const labelListList & patchFaceRestrictAddressing(const label leveli) const
Geometric agglomerated algebraic multigrid agglomeration class.
List< bool > boolList
A List of bools.
GeometricMeshObject(const word &objName, const objectRegistry &obr)
Construct from name and instance on registry.
bool hasMeshLevel(const label leveli) const
Do we have mesh for given level?
static void calculateRegionMaster(const label comm, const labelList &procAgglomMap, labelList &masterProcs, List< label > &agglomProcIDs)
Given fine to coarse processor map determine:
label nCells(const label leveli) const
Return number of coarse cells (before processor agglomeration)
void operator=(const GAMGAgglomeration &)=delete
No copy assignment.
label nCellsInCoarsestLevel_
Number of cells in coarsest level.
void combineLevels(const label curLevel)
Combine a level with the previous one.
const FieldField< fvPatchField, Type > & ff(const FieldField< fvPatchField, Type > &bf)
void compactLevels(const label nCreatedLevels, const bool doProcessorAgglomerate)
Shrink the number of levels to that specified. Optionally do.
const labelListList & faceMap(const label fineLeveli) const
Mapping from processor to procMesh face.