pairGAMGAgglomeration.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) 2011-2013 OpenFOAM Foundation
9  Copyright (C) 2023 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
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 
27 Class
28  Foam::pairGAMGAgglomeration
29 
30 Description
31  Agglomerate using the pair algorithm.
32 
33 SourceFiles
34  pairGAMGAgglomeration.C
35  pairGAMGAgglomerate.C
36 
37 \*---------------------------------------------------------------------------*/
38 
39 #ifndef pairGAMGAgglomeration_H
40 #define pairGAMGAgglomeration_H
41 
42 #include "GAMGAgglomeration.H"
43 
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 
46 namespace Foam
47 {
48 
49 /*---------------------------------------------------------------------------*\
50  Class pairGAMGAgglomeration Declaration
51 \*---------------------------------------------------------------------------*/
52 
54 :
55  public GAMGAgglomeration
56 {
57  // Private data
58 
59  //- Number of levels to merge, 1 = don't merge, 2 = merge pairs etc.
60  label mergeLevels_;
61 
62  //- Direction of cell loop for the current level
63  static bool forward_;
64 
65 
66 protected:
67 
68  // Protected Member Functions
69 
70  //- No copy construct
72 
73  //- No copy assignment
74  void operator=(const pairGAMGAgglomeration&) = delete;
75 
76 
77 public:
78 
79  //- Runtime type information
80  TypeName("pair");
81 
82 
83  // Constructors
84 
85  //- Construct given mesh and controls
87  (
88  const lduMesh& mesh,
89  const dictionary& controlDict
90  );
91 
92  //- Calculate and return agglomeration
94  (
95  label& nCoarseCells,
96  const lduAddressing& fineMatrixAddressing,
97  const scalarField& faceWeights
98  );
99 
100  //- Agglomerate from a starting level. Starting level is usually 0
101  //- (initial mesh) but sometimes >0 (restarting after processor
102  //- agglomeration)
103  virtual void agglomerate
104  (
105  const label nCellsInCoarsestLevel,
106  const label startLevel,
107  const scalarField& startFaceWeights,
108  const bool doProcessorAgglomerate = true
109  );
110 };
111 
112 
113 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
114 
115 } // End namespace Foam
116 
117 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
118 
119 #endif
120 
121 // ************************************************************************* //
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
Agglomerate using the pair algorithm.
Abstract base class for meshes which provide LDU addressing for the construction of lduMatrix and LDU...
Definition: lduMesh.H:53
pairGAMGAgglomeration(const pairGAMGAgglomeration &)=delete
No copy construct.
static tmp< labelField > agglomerate(label &nCoarseCells, const lduAddressing &fineMatrixAddressing, const scalarField &faceWeights)
Calculate and return agglomeration.
const lduMesh & mesh() const noexcept
Reference to the mesh.
Definition: MeshObject.H:157
runTime controlDict().readEntry("adjustTimeStep"
The central control dictionary, the contents of which are either taken directly from the FOAM_CONTROL...
Definition: debug.C:142
void operator=(const pairGAMGAgglomeration &)=delete
No copy assignment.
TypeName("pair")
Runtime type information.
The class contains the addressing required by the lduMatrix: upper, lower and losort.
A class for managing temporary objects.
Definition: HashPtrTable.H:50
Geometric agglomerated algebraic multigrid agglomeration class.
Namespace for OpenFOAM.