Loading...
Searching...
No Matches
GAMGProcAgglomeration.H
Go to the documentation of this file.
1/*---------------------------------------------------------------------------*\
2 ========= |
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4 \\ / O peration |
5 \\ / A nd | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2013-2014 OpenFOAM Foundation
9 Copyright (C) 2023 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27Class
28 Foam::GAMGProcAgglomeration
29
30Description
31 Processor agglomeration of GAMGAgglomerations.
32
33SourceFiles
34 GAMGProcAgglomeration.C
35
36\*---------------------------------------------------------------------------*/
37
38#ifndef Foam_GAMGProcAgglomeration_H
39#define Foam_GAMGProcAgglomeration_H
40
42#include "labelList.H"
43#include "DynamicList.H"
44
45// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46
47namespace Foam
48{
49
50// Forward Declarations
52class lduMesh;
55/*---------------------------------------------------------------------------*\
56 Class GAMGProcAgglomeration Declaration
57\*---------------------------------------------------------------------------*/
58
60{
61protected:
62
63 // Protected Data
64
65 //- Reference to agglomeration
67
68 //- Allocated communicators
70
71
72 // Protected Member Functions
73
74 //- Debug: write agglomeration info
75 void printStats(Ostream& os, GAMGAgglomeration& agglom) const;
76
77 //- Agglomerate a level. Return true if anything has changed
78 bool agglomerate
79 (
80 const label fineLevelIndex,
81 const labelList& procAgglomMap,
82 const labelList& masterProcs,
83 const List<label>& agglomProcIDs,
84 const label procAgglomComm
85 );
86
87 //- Debug: calculate global cell-cells
89
90 //- Clear/free allocated communicators
91 void clearCommunicators();
92
93
94public:
95
96 //- Runtime type information
97 TypeName("GAMGProcAgglomeration");
98
99
100 // Declare run-time constructor selection tables
101
102 //- Runtime selection table for pure geometric agglomerators
104 (
105 autoPtr,
108 (
109 GAMGAgglomeration& agglom,
111 ),
112 (
113 agglom,
115 )
116 );
117
118
119 //- No copy construct
121
122 //- No copy assignment
123 void operator=(const GAMGProcAgglomeration&) = delete;
124
125
126 // Constructors
127
128 //- Construct given agglomerator and controls
130 (
131 GAMGAgglomeration& agglom,
133 );
134
135
136 // Selectors
137
138 //- Return the selected agglomerator
140 (
141 const word& type,
142 GAMGAgglomeration& agglom,
144 );
145
146
147 //- Destructor. Clears allocated communicators
148 virtual ~GAMGProcAgglomeration();
149
150
151 // Member Functions
152
153 //- Modify agglomeration. \returns True if modified
154 virtual bool agglomerate() = 0;
155};
156
157
158// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
159
160} // End namespace Foam
161
162// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
163
164#endif
165
166// ************************************************************************* //
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
Definition DynamicList.H:68
Geometric agglomerated algebraic multigrid agglomeration class.
virtual bool agglomerate()=0
Modify agglomeration.
GAMGAgglomeration & agglom_
Reference to agglomeration.
static autoPtr< GAMGProcAgglomeration > New(const word &type, GAMGAgglomeration &agglom, const dictionary &controlDict)
Return the selected agglomerator.
void printStats(Ostream &os, GAMGAgglomeration &agglom) const
Debug: write agglomeration info.
void clearCommunicators()
Clear/free allocated communicators.
DynamicList< label > comms_
Allocated communicators.
static labelListList globalCellCells(const lduMesh &)
Debug: calculate global cell-cells.
declareRunTimeSelectionTable(autoPtr, GAMGProcAgglomeration, GAMGAgglomeration,(GAMGAgglomeration &agglom, const dictionary &controlDict),(agglom, controlDict))
Runtime selection table for pure geometric agglomerators.
TypeName("GAMGProcAgglomeration")
Runtime type information.
virtual ~GAMGProcAgglomeration()
Destructor. Clears allocated communicators.
void operator=(const GAMGProcAgglomeration &)=delete
No copy assignment.
GAMGProcAgglomeration(const GAMGProcAgglomeration &)=delete
No copy construct.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition List.H:72
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition Ostream.H:59
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition autoPtr.H:65
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
Abstract base class for meshes which provide LDU addressing for the construction of lduMatrix and LDU...
Definition lduMesh.H:54
Simplest concrete lduMesh that stores the addressing needed by lduMatrix.
A class for handling words, derived from Foam::string.
Definition word.H:66
runTime controlDict().readEntry("adjustTimeStep"
OBJstream os(runTime.globalPath()/outputName)
Namespace for OpenFOAM.
List< labelList > labelListList
List of labelList.
Definition labelList.H:38
List< label > labelList
A List of labels.
Definition List.H:62
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.
Definition typeInfo.H:68