GAMGProcAgglomeration.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2013-2019 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::GAMGProcAgglomeration
26 
27 Description
28  Processor agglomeration of GAMGAgglomerations.
29 
30 SourceFiles
31  GAMGProcAgglomeration.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef GAMGProcAgglomeration_H
36 #define GAMGProcAgglomeration_H
37 
38 #include "runTimeSelectionTables.H"
39 #include "labelList.H"
40 
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 
43 namespace Foam
44 {
45 
46 class GAMGAgglomeration;
47 class lduMesh;
48 
49 /*---------------------------------------------------------------------------*\
50  Class GAMGProcAgglomeration Declaration
51 \*---------------------------------------------------------------------------*/
52 
54 {
55 
56 protected:
57 
58  // Protected data
59 
60  //- Reference to agglomeration
62 
63  // Protected Member Functions
64 
65  //- Debug: write agglomeration info
66  void printStats(Ostream& os, GAMGAgglomeration& agglom) const;
67 
68  //- Agglomerate a level. Return true if anything has changed
69  bool agglomerate
70  (
71  const label fineLevelIndex,
72  const labelList& procAgglomMap,
73  const labelList& masterProcs,
74  const List<label>& agglomProcIDs,
75  const label procAgglomComm
76  );
77 
78  //- Debug: calculate global cell-cells
79  static labelListList globalCellCells(const lduMesh&);
80 
81 
82 public:
83 
84  //- Runtime type information
85  TypeName("GAMGProcAgglomeration");
86 
87 
88  // Declare run-time constructor selection tables
89 
90  //- Runtime selection table for pure geometric agglomerators
92  (
93  autoPtr,
96  (
97  GAMGAgglomeration& agglom,
98  const dictionary& controlDict
99  ),
100  (
101  agglom,
102  controlDict
103  )
104  );
105 
106 
107  // Constructors
108 
109  //- Construct given agglomerator and controls
111  (
112  GAMGAgglomeration& agglom,
113  const dictionary& controlDict
114  );
115 
116  //- Disallow default bitwise copy construction
118 
119 
120  // Selectors
121 
122  //- Return the selected agglomerator
124  (
125  const word& type,
126  GAMGAgglomeration& agglom,
127  const dictionary& controlDict
128  );
129 
130 
131  //- Destructor
132  virtual ~GAMGProcAgglomeration();
133 
134 
135  // Member Functions
136 
137  //- Modify agglomeration. Return true if modified
138  virtual bool agglomerate() = 0;
139 
140 
141  // Member Operators
142 
143  //- Disallow default bitwise assignment
144  void operator=(const GAMGProcAgglomeration&) = delete;
145 };
146 
147 
148 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
149 
150 } // End namespace Foam
151 
152 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
153 
154 #endif
155 
156 // ************************************************************************* //
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
GAMGAgglomeration & agglom_
Reference to agglomeration.
runTime controlDict().lookup("adjustTimeStep") >> adjustTimeStep
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:158
Abstract base class for meshes which provide LDU addressing for the construction of lduMatrix and LDU...
Definition: lduMesh.H:59
void printStats(Ostream &os, GAMGAgglomeration &agglom) const
Debug: write agglomeration info.
TypeName("GAMGProcAgglomeration")
Runtime type information.
static autoPtr< GAMGProcAgglomeration > New(const word &type, GAMGAgglomeration &agglom, const dictionary &controlDict)
Return the selected agglomerator.
A class for handling words, derived from string.
Definition: word.H:59
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53
void operator=(const GAMGProcAgglomeration &)=delete
Disallow default bitwise assignment.
static labelListList globalCellCells(const lduMesh &)
Debug: calculate global cell-cells.
virtual bool agglomerate()=0
Modify agglomeration. Return true if modified.
Processor agglomeration of GAMGAgglomerations.
declareRunTimeSelectionTable(autoPtr, GAMGProcAgglomeration, GAMGAgglomeration,(GAMGAgglomeration &agglom, const dictionary &controlDict),(agglom, controlDict))
Runtime selection table for pure geometric agglomerators.
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
Definition: POSIX.C:488
virtual ~GAMGProcAgglomeration()
Destructor.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:52
Macros to ease declaration of run-time selection tables.
GAMGProcAgglomeration(GAMGAgglomeration &agglom, const dictionary &controlDict)
Construct given agglomerator and controls.
Geometric agglomerated algebraic multigrid agglomeration class.
Namespace for OpenFOAM.