1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2004-6 H. Jasak All rights reserved
7 -------------------------------------------------------------------------------
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
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
29 Block LDU matrix preconditioner virtual base class
32 Hrvoje Jasak, Wikki Ltd. All rights reserved.
37 \*---------------------------------------------------------------------------*/
39 #ifndef BlockLduPrecon_H
40 #define BlockLduPrecon_H
42 #include "BlockLduMatrix.H"
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 /*---------------------------------------------------------------------------*\
50 Class BlockLduPrecon Declaration
51 \*---------------------------------------------------------------------------*/
56 // Private Member Functions
58 //- Disallow default bitwise copy construct
59 BlockLduPrecon(const BlockLduPrecon&);
61 //- Disallow default bitwise assignment
62 void operator=(const BlockLduPrecon&);
70 const BlockLduMatrix<Type>& matrix_;
73 // Protected member functions
75 //- Find the smoother name (directly or from a sub-dictionary)
76 static word getName(const dictionary&);
81 //- Runtime type information
82 TypeName("BlockLduPrecon");
85 // Declare run-time constructor selection tables
87 declareRunTimeSelectionTable
93 const BlockLduMatrix<Type>& matrix,
94 const dictionary& dict
105 //- Construct from matrix
106 BlockLduPrecon(const BlockLduMatrix<Type>& matrix)
114 //- Select given matrix and dictionary
115 static autoPtr<BlockLduPrecon<Type> > New
117 const BlockLduMatrix<Type>& matrix,
118 const dictionary& dict
124 virtual ~BlockLduPrecon()
130 //- Execute preconditioning
131 virtual void precondition
137 //- Execute preconditioning on a transposed matrix
138 virtual void preconditionT
141 const Field<Type>& bT
146 type() +"::preconditionT"
147 "(Field<Type>& xT, const Field<Type>& bT) const"
153 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
155 } // End namespace Foam
157 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
160 # include "BlockLduPrecon.C"
163 #define makeBlockPrecon(PreconType, typePreconType) \
165 defineNamedTemplateTypeNameAndDebug(typePreconType, 0); \
167 addToRunTimeSelectionTable(PreconType, typePreconType, dictionary);
169 #define makeBlockPrecons(preconType) \
171 makeBlockPrecon(blockScalarPrecon, preconType##Scalar); \
172 makeBlockPrecon(blockVectorPrecon, preconType##Vector); \
173 makeBlockPrecon(blockTensorPrecon, preconType##Tensor);
176 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
180 // ************************************************************************* //