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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
29 Linear equation solver for BlockLduMatrix.
32 Hrvoje Jasak, Wikki Ltd. All rights reserved
37 \*---------------------------------------------------------------------------*/
39 #ifndef BlockLduSolver_H
40 #define BlockLduSolver_H
42 #include "blockLduMatrices.H"
43 #include "runTimeSelectionTables.H"
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50 // * * * * * * Forward declaration of template friend fuctions * * * * * * * //
53 class BlockSolverPerformance;
55 /*---------------------------------------------------------------------------*\
56 Class BlockLduSolver Declaration
57 \*---------------------------------------------------------------------------*/
64 //- Name of field being solved for
67 //- Control data dictionary
73 // Protected data types
75 typedef Field<Type> TypeField;
81 const BlockLduMatrix<Type>& matrix_;
84 // Protected Member Functions
87 const dictionary& dict() const
92 //- Read a control parameter from the dictionary
96 const dictionary& dict,
98 const word& controlName
104 //- Runtime type information
105 TypeName("BlockLduSolver");
110 //- Large value for the use in solvers
111 static const scalar great_;
113 //- Small value for the use in solvers
114 static const scalar small_;
117 // Declare run-time constructor selection tables
119 declareRunTimeSelectionTable
125 const word& fieldName,
126 BlockLduMatrix<Type>& matrix,
127 const dictionary& dict
136 declareRunTimeSelectionTable
142 const word& fieldName,
143 BlockLduMatrix<Type>& matrix,
144 const dictionary& dict
157 //- Construct from field name and matrix
160 const word& fieldName,
161 const BlockLduMatrix<Type>& matrix
164 //- Construct from dictionary
167 const word& fieldName,
168 const BlockLduMatrix<Type>& matrix,
169 const dictionary& dict
175 //- Return a new solver
176 static autoPtr<BlockLduSolver<Type> > New
178 const word& fieldName,
179 BlockLduMatrix<Type>& matrix,
180 const dictionary& dict
186 virtual ~BlockLduSolver()
192 //- Return field name
193 const word& fieldName() const
199 virtual BlockSolverPerformance<Type> solve
207 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
209 } // End namespace Foam
211 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
214 # include "BlockLduSolver.C"
218 #define makeBlockSolverTypeName(typeSolverType) \
220 defineNamedTemplateTypeNameAndDebug(typeSolverType, 0);
222 #define makeBlockSolvers(solverType) \
224 makeBlockSolverTypeName(solverType##Scalar); \
225 makeBlockSolverTypeName(solverType##Vector); \
226 makeBlockSolverTypeName(solverType##Tensor);
229 #define addSolverToBlockMatrix(Type, typeSolverType, typeMatrix) \
231 addToRunTimeSelectionTable(block##Type##Solver, typeSolverType, typeMatrix);
233 #define addSolversToBlockMatrix(solverType, typeMatrix) \
235 addSolverToBlockMatrix(Scalar, solverType##Scalar, typeMatrix); \
236 addSolverToBlockMatrix(Vector, solverType##Vector, typeMatrix); \
237 addSolverToBlockMatrix(Tensor, solverType##Tensor, typeMatrix);
239 #define addSymSolverToBlockMatrix(solverType) \
241 addSolversToBlockMatrix(solverType, symMatrix);
243 #define addAsymSolverToBlockMatrix(solverType) \
245 addSolversToBlockMatrix(solverType, asymMatrix);
248 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
252 // ************************************************************************* //