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  // Protected data
65 
66  //- Number of V-cycles to perform
67  label nVcycles_;
68 
69  //- Read the control parameters from the controlDict_
70  virtual void readControls();
71 
72 public:
73 
74  //- Runtime type information
75  TypeName("GAMG");
76 
77 
78  // Constructors
79 
80  //- Construct from matrix components and preconditioner solver controls
82  (
83  const lduMatrix::solver&,
84  const dictionary& solverControls
85  );
86 
87 
88  //- Destructor
89  virtual ~GAMGPreconditioner();
90 
91 
92  // Member Functions
93 
94  //- Return wA the preconditioned form of residual rA
95  virtual void precondition
96  (
97  solveScalarField& wA,
98  const solveScalarField& rA,
99  const direction cmpt=0
100  ) const;
101 };
102 
103 
104 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
105 
106 } // End namespace Foam
107 
108 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
109 
110 #endif
111 
112 // ************************************************************************* //
Foam::GAMGPreconditioner::GAMGPreconditioner
GAMGPreconditioner(const lduMatrix::solver &, const dictionary &solverControls)
Construct from matrix components and preconditioner solver controls.
Definition: GAMGPreconditioner.C:49
Foam::lduMatrix::solver
Abstract base-class for lduMatrix solvers.
Definition: lduMatrix.H:98
Foam::Field< solveScalar >
Foam::GAMGPreconditioner::nVcycles_
label nVcycles_
Number of V-cycles to perform.
Definition: GAMGPreconditioner.H:66
Foam::GAMGPreconditioner::readControls
virtual void readControls()
Read the control parameters from the controlDict_.
Definition: GAMGPreconditioner.C:78
Foam::GAMGPreconditioner::TypeName
TypeName("GAMG")
Runtime type information.
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam::GAMGPreconditioner::~GAMGPreconditioner
virtual ~GAMGPreconditioner()
Destructor.
Definition: GAMGPreconditioner.C:72
Foam::GAMGPreconditioner
Geometric agglomerated algebraic multigrid preconditioner.
Definition: GAMGPreconditioner.H:57
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::GAMGPreconditioner::precondition
virtual void precondition(solveScalarField &wA, const solveScalarField &rA, const direction cmpt=0) const
Return wA the preconditioned form of residual rA.
Definition: GAMGPreconditioner.C:86
Foam::GAMGSolver
Geometric agglomerated algebraic multigrid solver.
Definition: GAMGSolver.H:76
Foam::direction
uint8_t direction
Definition: direction.H:52
Foam::lduMatrix::preconditioner
Abstract base-class for lduMatrix preconditioners.
Definition: lduMatrix.H:433
GAMGSolver.H