1 /*---------------------------------------------------------------------------*\
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 -------------------------------------------------------------------------------
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 \*---------------------------------------------------------------------------*/
26 #include "blockLduMatrices.H"
27 #include "addToRunTimeSelectionTable.H"
29 #include "blockLduPrecons.H"
30 #include "BlockNoPrecon.H"
31 #include "blockDiagonalPrecons.H"
32 #include "blockGaussSeidelPrecons.H"
33 #include "BlockCholeskyPrecon.H"
35 #include "blockLduSmoothers.H"
36 #include "blockGaussSeidelSmoothers.H"
37 #include "BlockILUSmoother.H"
39 #include "blockLduSolvers.H"
40 #include "BlockDiagonalSolver.H"
41 #include "BlockBiCGStabSolver.H"
42 #include "BlockCGSolver.H"
43 #include "BlockGaussSeidelSolver.H"
44 #include "BlockGMRESSolver.H"
46 // KRJ: 2012-12-15: Multigrid solver
47 #include "blockAmgSolvers.H"
48 #include "blockAmgPrecons.H"
49 #include "blockMatrixCoarsenings.H"
50 #include "blockMatrixAgglomerations.H"
51 #include "blockCoeffNorms.H"
52 #include "blockCoeffTwoNorms.H"
53 #include "blockCoeffMaxNorms.H"
54 #include "blockCoeffComponentNorms.H"
56 #include "VectorTensorNFields.H"
57 #include "ExpandTensorN.H"
58 #include "ExpandTensorNField.H"
59 #include "VectorNFieldTypes.H"
61 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
66 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
68 #define makeSolver(type, Type, args...) \
69 /* Preconditioners */ \
70 typedef BlockLduPrecon<type > block##Type##Precon; \
71 defineNamedTemplateTypeNameAndDebug(block##Type##Precon, 0); \
72 defineTemplateRunTimeSelectionTable(block##Type##Precon, dictionary); \
74 typedef BlockNoPrecon<type > block##Type##NoPrecon; \
75 makeBlockPrecon(block##Type##Precon, block##Type##NoPrecon); \
77 typedef BlockDiagonalPrecon<type > block##Type##DiagonalPrecon; \
78 makeBlockPrecon(block##Type##Precon, block##Type##DiagonalPrecon); \
80 typedef BlockGaussSeidelPrecon<type > block##Type##GaussSeidelPrecon; \
81 makeBlockPrecon(block##Type##Precon, block##Type##GaussSeidelPrecon); \
83 typedef BlockCholeskyPrecon<type > block##Type##CholeskyPrecon; \
84 makeBlockPrecon(block##Type##Precon, block##Type##CholeskyPrecon); \
87 typedef BlockLduSmoother<type > block##Type##Smoother; \
88 defineNamedTemplateTypeNameAndDebug(block##Type##Smoother, 0); \
89 defineTemplateRunTimeSelectionTable(block##Type##Smoother, dictionary); \
91 typedef BlockGaussSeidelSmoother<type > block##Type##GaussSeidelSmoother; \
92 makeBlockSmoother(block##Type##Smoother, block##Type##GaussSeidelSmoother); \
94 typedef BlockILUSmoother<type > block##Type##ILUSmoother; \
95 makeBlockSmoother(block##Type##Smoother, block##Type##ILUSmoother); \
99 typedef BlockLduSolver<type > block##Type##Solver; \
100 defineNamedTemplateTypeNameAndDebug(block##Type##Solver, 0); \
101 defineTemplateRunTimeSelectionTable \
103 block##Type##Solver, \
107 defineTemplateRunTimeSelectionTable \
109 block##Type##Solver, \
113 typedef BlockDiagonalSolver<type > block##Type##DiagonalSolver; \
114 defineNamedTemplateTypeNameAndDebug(block##Type##DiagonalSolver, 0); \
116 typedef BlockBiCGStabSolver<type > block##Type##BiCGStabSolver; \
117 makeBlockSolverTypeName(block##Type##BiCGStabSolver); \
118 addSolverToBlockMatrix(Type, block##Type##BiCGStabSolver, symMatrix); \
119 addSolverToBlockMatrix(Type, block##Type##BiCGStabSolver, asymMatrix); \
121 typedef BlockCGSolver<type > block##Type##CGSolver; \
122 makeBlockSolverTypeName(block##Type##CGSolver); \
123 addSolverToBlockMatrix(Type, block##Type##CGSolver, symMatrix); \
125 typedef BlockGaussSeidelSolver<type > block##Type##GaussSeidelSolver; \
126 makeBlockSolverTypeName(block##Type##GaussSeidelSolver); \
127 addSolverToBlockMatrix(Type, block##Type##GaussSeidelSolver, symMatrix); \
128 addSolverToBlockMatrix(Type, block##Type##GaussSeidelSolver, asymMatrix); \
130 typedef BlockGMRESSolver<type > block##Type##GMRESSolver; \
131 makeBlockSolverTypeName(block##Type##GMRESSolver); \
132 addSolverToBlockMatrix(Type, block##Type##GMRESSolver, symMatrix); \
133 addSolverToBlockMatrix(Type, block##Type##GMRESSolver, asymMatrix); \
135 typedef BlockMatrixCoarsening<type > block##Type##MatrixCoarsening; \
136 defineNamedTemplateTypeNameAndDebug(block##Type##MatrixCoarsening, 0); \
137 defineTemplateRunTimeSelectionTable(block##Type##MatrixCoarsening, matrix); \
139 typedef BlockMatrixAgglomeration<type > block##Type##MatrixAgglomeration; \
140 makeBlockMatrixCoarsening(block##Type##MatrixCoarsening, block##Type##MatrixAgglomeration); \
142 typedef BlockCoeffNorm<type > block##Type##CoeffNorm; \
143 defineNamedTemplateTypeNameAndDebug(block##Type##CoeffNorm, 0); \
144 defineTemplateRunTimeSelectionTable(block##Type##CoeffNorm, dictionary); \
146 typedef BlockCoeffTwoNorm<type > block##Type##CoeffTwoNorm; \
147 makeBlockCoeffNorm(block##Type##CoeffNorm, block##Type##CoeffTwoNorm); \
149 typedef BlockCoeffComponentNorm<type > block##Type##CoeffComponentNorm; \
150 makeBlockCoeffNorm(block##Type##CoeffNorm, block##Type##CoeffComponentNorm); \
152 typedef BlockCoeffMaxNorm<type > block##Type##CoeffMaxNorm; \
153 makeBlockCoeffNorm(block##Type##CoeffNorm, block##Type##CoeffMaxNorm); \
155 typedef BlockAmgSolver<type > block##Type##AmgSolver; \
156 makeBlockSolverTypeName(block##Type##AmgSolver); \
157 addSolverToBlockMatrix(Type, block##Type##AmgSolver, symMatrix); \
158 addSolverToBlockMatrix(Type, block##Type##AmgSolver, asymMatrix); \
160 typedef BlockAmgPrecon<type > block##Type##AmgPrecon; \
161 makeBlockPrecon(block##Type##Precon, block##Type##AmgPrecon); \
163 forAllVectorNTypes(makeSolver)
167 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
169 } // End namespace Foam
171 // ************************************************************************* //