GAMGPreconditioner.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-2016 OpenFOAM Foundation
9  Copyright (C) 2019 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::GAMGPreconditioner
29 
30 Group
31  grpLduMatrixPreconditioners
32 
33 Description
34  Geometric agglomerated algebraic multigrid preconditioner.
35 
36 See also
37  GAMGSolver for more details.
38 
39 SourceFiles
40  GAMGPreconditioner.C
41 
42 \*---------------------------------------------------------------------------*/
43 
44 #ifndef GAMGPreconditioner_H
45 #define GAMGPreconditioner_H
46 
47 #include "GAMGSolver.H"
48 
49 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50 
51 namespace Foam
52 {
53 
54 /*---------------------------------------------------------------------------*\
55  Class GAMGPreconditioner Declaration
56 \*---------------------------------------------------------------------------*/
57 
59 :
60  public GAMGSolver,
62 {
63 protected:
64 
65  // Protected Data
66 
67  //- Number of V-cycles to perform
68  label nVcycles_;
69 
70  //- Read the control parameters from the controlDict_
71  virtual void readControls();
72 
73 public:
74 
75  //- Runtime type information
76  TypeName("GAMG");
77 
78 
79  // Constructors
80 
81  //- Construct from matrix components and preconditioner solver controls
83  (
84  const lduMatrix::solver&,
85  const dictionary& solverControls
86  );
87 
88 
89  //- Destructor
90  virtual ~GAMGPreconditioner() = default;
91 
92 
93  // Member Functions
94 
95  //- Return wA the preconditioned form of residual rA
96  virtual void precondition
97  (
98  solveScalarField& wA,
99  const solveScalarField& rA,
100  const direction cmpt=0
101  ) const;
102 };
103 
104 
105 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
106 
107 } // End namespace Foam
108 
109 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
110 
111 #endif
112 
113 // ************************************************************************* //
uint8_t direction
Definition: direction.H:46
GAMGPreconditioner(const lduMatrix::solver &, const dictionary &solverControls)
Construct from matrix components and preconditioner solver controls.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
Geometric agglomerated algebraic multigrid preconditioner.
virtual void readControls()
Read the control parameters from the controlDict_.
TypeName("GAMG")
Runtime type information.
Abstract base-class for lduMatrix solvers.
Definition: lduMatrix.H:141
label nVcycles_
Number of V-cycles to perform.
Geometric agglomerated algebraic multigrid solver.
Definition: GAMGSolver.H:72
Abstract base-class for lduMatrix preconditioners.
Definition: lduMatrix.H:563
virtual void precondition(solveScalarField &wA, const solveScalarField &rA, const direction cmpt=0) const
Return wA the preconditioned form of residual rA.
virtual ~GAMGPreconditioner()=default
Destructor.
Namespace for OpenFOAM.