Fix tutorials: coupled/conjugateHeatFoam/conjugateCavity: fix Allrun file
[OpenFOAM-1.6-ext.git] / src / coupledMatrix / coupledLduSolver / cgSolver / coupledCgSolver.H
blob9d813170a67ae9396aac727070df4e3be656821e
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright held by original author
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     coupledCgSolver
28 Description
29     Preconditioned Conjugate Gradient solver for coupled matrices with
30     run-time selectable preconditioning.
32 Author
33     Hrvoje Jasak, Wikki Ltd.  All rights reserved.
35 SourceFiles
36     coupledCgSolver.C
38 \*---------------------------------------------------------------------------*/
40 #ifndef coupledCgSolver_H
41 #define coupledCgSolver_H
43 #include "coupledIterativeSolver.H"
44 #include "coupledLduPrecon.H"
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 namespace Foam
51 /*---------------------------------------------------------------------------*\
52                       Class coupledCgSolver Declaration
53 \*---------------------------------------------------------------------------*/
55 class coupledCgSolver
57     public coupledIterativeSolver
59     // Private Data
61         // Preconditioner
62         autoPtr<coupledLduPrecon> preconPtr_;
65     // Private Member Functions
67         //- Disallow default bitwise copy construct
68         coupledCgSolver(const coupledCgSolver&);
70         //- Disallow default bitwise assignment
71         void operator=(const coupledCgSolver&);
74 public:
76     //- Runtime type information
77     TypeName("CG");
80     // Constructors
82         //- Construct from matrix
83         coupledCgSolver
84         (
85             const word& fieldName,
86             const coupledLduMatrix& matrix,
87             const PtrList<FieldField<Field, scalar> >& bouCoeffs,
88             const PtrList<FieldField<Field, scalar> >& intCoeffs,
89             const lduInterfaceFieldPtrsListList& interfaces,
90             const dictionary& solverData
91         );
94     // Destructor
96         virtual ~coupledCgSolver()
97         {}
100     // Member Functions
102         //- Solve the matrix with this solver
103         virtual coupledSolverPerformance solve
104         (
105             FieldField<Field, scalar>& x,
106             const FieldField<Field, scalar>& b,
107             const direction cmpt = 0
108         ) const;
112 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
114 } // End namespace Foam
116 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
118 #endif
120 // ************************************************************************* //