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 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::GAMGProcAgglomeration
28 
29 Description
30  Processor agglomeration of GAMGAgglomerations.
31 
32 SourceFiles
33  GAMGProcAgglomeration.C
34 
35 \*---------------------------------------------------------------------------*/
36 
37 #ifndef GAMGProcAgglomeration_H
38 #define GAMGProcAgglomeration_H
39 
40 #include "runTimeSelectionTables.H"
41 #include "labelList.H"
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 
48 class GAMGAgglomeration;
49 class lduMesh;
50 
51 /*---------------------------------------------------------------------------*\
52  Class GAMGProcAgglomeration Declaration
53 \*---------------------------------------------------------------------------*/
54 
56 {
57 
58 protected:
59 
60  // Protected data
61 
62  //- Reference to agglomeration
64 
65  // Protected Member Functions
66 
67  //- Debug: write agglomeration info
68  void printStats(Ostream& os, GAMGAgglomeration& agglom) const;
69 
70  //- Agglomerate a level. Return true if anything has changed
71  bool agglomerate
72  (
73  const label fineLevelIndex,
74  const labelList& procAgglomMap,
75  const labelList& masterProcs,
76  const List<label>& agglomProcIDs,
77  const label procAgglomComm
78  );
79 
80  //- Debug: calculate global cell-cells
81  static labelListList globalCellCells(const lduMesh&);
82 
83 private:
84 
85  // Private data
86 
87  // Private Member Functions
88 
89  //- No copy construct
91 
92  //- No copy assignment
93  void operator=(const GAMGProcAgglomeration&) = delete;
94 
95 
96 public:
97 
98  //- Runtime type information
99  TypeName("GAMGProcAgglomeration");
100 
101 
102  // Declare run-time constructor selection tables
103 
104  //- Runtime selection table for pure geometric agglomerators
106  (
107  autoPtr,
110  (
111  GAMGAgglomeration& agglom,
112  const dictionary& controlDict
113  ),
114  (
115  agglom,
117  )
118  );
119 
120 
121  // Constructors
122 
123  //- Construct given agglomerator and controls
125  (
126  GAMGAgglomeration& agglom,
127  const dictionary& controlDict
128  );
129 
130 
131  // Selectors
132 
133  //- Return the selected agglomerator
135  (
136  const word& type,
137  GAMGAgglomeration& agglom,
138  const dictionary& controlDict
139  );
140 
141 
142  //- Destructor
143  virtual ~GAMGProcAgglomeration();
144 
145 
146  // Member Functions
147 
148  //- Modify agglomeration. Return true if modified
149  virtual bool agglomerate() = 0;
150 
151 };
152 
153 
154 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
155 
156 } // End namespace Foam
157 
158 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
159 
160 #endif
161 
162 // ************************************************************************* //
Foam::GAMGProcAgglomeration::TypeName
TypeName("GAMGProcAgglomeration")
Runtime type information.
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::GAMGAgglomeration
Geometric agglomerated algebraic multigrid agglomeration class.
Definition: GAMGAgglomeration.H:64
Foam::GAMGProcAgglomeration::agglom_
GAMGAgglomeration & agglom_
Reference to agglomeration.
Definition: GAMGProcAgglomeration.H:62
labelList.H
Foam::GAMGProcAgglomeration::agglomerate
virtual bool agglomerate()=0
Modify agglomeration. Return true if modified.
controlDict
runTime controlDict().readEntry("adjustTimeStep"
Definition: debug.C:143
Foam::GAMGProcAgglomeration::New
static autoPtr< GAMGProcAgglomeration > New(const word &type, GAMGAgglomeration &agglom, const dictionary &controlDict)
Return the selected agglomerator.
Definition: GAMGProcAgglomeration.C:360
Foam::GAMGProcAgglomeration::printStats
void printStats(Ostream &os, GAMGAgglomeration &agglom) const
Debug: write agglomeration info.
Definition: GAMGProcAgglomeration.C:45
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
os
OBJstream os(runTime.globalPath()/outputName)
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::GAMGProcAgglomeration::declareRunTimeSelectionTable
declareRunTimeSelectionTable(autoPtr, GAMGProcAgglomeration, GAMGAgglomeration,(GAMGAgglomeration &agglom, const dictionary &controlDict),(agglom, controlDict))
Runtime selection table for pure geometric agglomerators.
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
runTimeSelectionTables.H
Macros to ease declaration of run-time selection tables.
Foam::List< label >
Foam::type
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
Definition: MSwindows.C:590
Foam::GAMGProcAgglomeration::globalCellCells
static labelListList globalCellCells(const lduMesh &)
Debug: calculate global cell-cells.
Definition: GAMGProcAgglomeration.C:122
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::GAMGProcAgglomeration
Processor agglomeration of GAMGAgglomerations.
Definition: GAMGProcAgglomeration.H:54
Foam::lduMesh
Abstract base class for meshes which provide LDU addressing for the construction of lduMatrix and LDU...
Definition: lduMesh.H:62
Foam::GAMGProcAgglomeration::~GAMGProcAgglomeration
virtual ~GAMGProcAgglomeration()
Destructor.
Definition: GAMGProcAgglomeration.C:386