fixed writing out entries in advective bc
[OpenFOAM-1.6-ext.git] / src / OpenFOAM / matrices / blockLduMatrix / BlockLduSolvers / BlockGMRES / BlockGMRESSolver.H
blob2844cbffafefa1dcc5057460b85bdd56255c8d44
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 Class
26     BlockGMRESSolver
28 Description
29     Preconditioned Generalised Minimal Residual solver with
30     run-time selectable preconditioning
32 Author
33     Hrvoje Jasak, Wikki Ltd.  All rights reserved
35 SourceFiles
36     BlockGMRESSolver.C
38 \*---------------------------------------------------------------------------*/
40 #ifndef BlockGMRESSolver_H
41 #define BlockGMRESSolver_H
43 #include "blockLduSolvers.H"
44 #include "BlockIterativeSolver.H"
45 #include "blockLduPrecons.H"
47 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 namespace Foam
52 /*---------------------------------------------------------------------------*\
53                        Class BlockGMRESSolver Declaration
54 \*---------------------------------------------------------------------------*/
56 template<class Type>
57 class BlockGMRESSolver
59     public BlockIterativeSolver<Type>
61     // Private data
63         //- Preconditioner
64         autoPtr<BlockLduPrecon<Type> > preconPtr_;
66         //- Krylov space dimension
67         label nDirs_;
70     // Private Member Functions
72         //- Disallow default bitwise copy construct
73         BlockGMRESSolver(const BlockGMRESSolver<Type>&);
75         //- Disallow default bitwise assignment
76         void operator=(const BlockGMRESSolver<Type>&);
78         //- Givens rotation
79         void givensRotation
80         (
81             const scalar& H,
82             const scalar& beta,
83             scalar& c,
84             scalar& s
85         ) const;
88 public:
90     //- Runtime type information
91     TypeName("GMRES");
94     // Constructors
96         //- Construct from matrix components and solver data stream
97         BlockGMRESSolver
98         (
99             const word& fieldName,
100             const BlockLduMatrix<Type>& matrix,
101             const dictionary& dict
102         );
105         // Destructor
107             virtual ~BlockGMRESSolver()
108             {}
111     // Member Functions
113         //- Solve the matrix with this solver
114         virtual BlockSolverPerformance<Type> solve
115         (
116             Field<Type>& x,
117             const Field<Type>& b
118         );
122 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
124 } // End namespace Foam
126 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
128 #ifdef NoRepository
129 #   include "BlockGMRESSolver.C"
130 #endif
132 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
134 #endif
136 // ************************************************************************* //