Forward compatibility: flex
[foam-extend-3.2.git] / src / foam / matrices / lduMatrix / solvers / PCG / PCG.H
blob48d45d2148cd5e0cbd6448af873e24e2eedc01a6
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | foam-extend: Open Source CFD
4    \\    /   O peration     | Version:     3.2
5     \\  /    A nd           | Web:         http://www.foam-extend.org
6      \\/     M anipulation  | For copyright notice see file Copyright
7 -------------------------------------------------------------------------------
8 License
9     This file is part of foam-extend.
11     foam-extend 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 3 of the License, or (at your
14     option) any later version.
16     foam-extend is distributed in the hope that it will be useful, but
17     WITHOUT ANY WARRANTY; without even the implied warranty of
18     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
19     General Public License for more details.
21     You should have received a copy of the GNU General Public License
22     along with foam-extend.  If not, see <http://www.gnu.org/licenses/>.
24 Class
25     Foam::PCG
27 Description
28     Preconditioned conjugate gradient solver for symmetric lduMatrices
29     using a run-time selectable preconditioner.
31 SourceFiles
32     PCG.C
34 \*---------------------------------------------------------------------------*/
36 #ifndef PCG_H
37 #define PCG_H
39 #include "lduMatrix.H"
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 namespace Foam
46 /*---------------------------------------------------------------------------*\
47                            Class PCG Declaration
48 \*---------------------------------------------------------------------------*/
50 class PCG
52     public lduMatrix::solver
54     // Private Member Functions
56         //- Disallow default bitwise copy construct
57         PCG(const PCG&);
59         //- Disallow default bitwise assignment
60         void operator=(const PCG&);
63 public:
65     //- Runtime type information
66     TypeName("PCG");
69     // Constructors
71         //- Construct from matrix components and solver controls
72         PCG
73         (
74             const word& fieldName,
75             const lduMatrix& matrix,
76             const FieldField<Field, scalar>& coupleBouCoeffs,
77             const FieldField<Field, scalar>& coupleIntCoeffs,
78             const lduInterfaceFieldPtrsList& interfaces,
79             const dictionary& dict
80         );
83     // Destructor
85         virtual ~PCG()
86         {}
89     // Member Functions
91         //- Solve the matrix with this solver
92         virtual lduSolverPerformance solve
93         (
94             scalarField& x,
95             const scalarField& b,
96             const direction cmpt = 0
97         ) const;
101 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
103 } // End namespace Foam
105 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
107 #endif
109 // ************************************************************************* //