Preconditioning bugfix by Alexander Monakov
[OpenFOAM-1.6-ext.git] / src / lduSolvers / lduSolver / amgSolver / amgSolver.H
blob18474088f4d6c37867a6b8904fc8f45cab70c5f1
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 2004-6 H. Jasak All rights reserved
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
9     This file is part of OpenFOAM.
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 the
13     Free Software Foundation; either version 2 of the License, or (at your
14     option) any later version.
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.
21     You should have received a copy of the GNU General Public License
22     along with OpenFOAM; if not, write to the Free Software Foundation,
23     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 Class
26     amgSolver
28 Description
29     Algebraic Multigrid solver with run-time selection of policy and cycle
31 Author
32     Hrvoje Jasak, Wikki Ltd.  All rights reserved
34 SourceFiles
35     amgSolver.C
37 \*---------------------------------------------------------------------------*/
39 #ifndef amgSolver_H
40 #define amgSolver_H
42 #include "lduMatrix.H"
43 #include "amgPrecon.H"
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 namespace Foam
50 /*---------------------------------------------------------------------------*\
51                            Class amgSolver Declaration
52 \*---------------------------------------------------------------------------*/
54 class amgSolver
56     public lduSolver
58 private:
60     // Private data
62         //- AMG preconditioner
63         amgPrecon amg_;
66     // Private Member Functions
68         //- Disallow default bitwise copy construct
69         amgSolver(const amgSolver&);
71         //- Disallow default bitwise assignment
72         void operator=(const amgSolver&);
75 public:
77     //- Runtime type information
78     TypeName("amgSolver");
81     // Constructors
83         //- Construct from matrix components and solver data stream
84         amgSolver
85         (
86             const word& fieldName,
87             const lduMatrix& matrix,
88             const FieldField<Field, scalar>& coupleBouCoeffs,
89             const FieldField<Field, scalar>& coupleIntCoeffs,
90             const lduInterfaceFieldPtrsList& interfaces,
91             const dictionary& dict
92         );
95     // Destructor
97         virtual ~amgSolver()
98         {}
101     // Member Functions
103         //- Solve the matrix with this solver
104         virtual lduSolverPerformance solve
105         (
106             scalarField& x,
107             const scalarField& b,
108             const direction cmpt = 0
109         ) const;
113 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
115 } // End namespace Foam
117 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
119 #endif
121 // ************************************************************************* //