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/>.
28 Fine AMG level refers to matrix, x and b data from the solver or
29 preconditioner, implemented for the BlockLduMatrix
32 Klas Jareteg, 2012-12-13
37 \*---------------------------------------------------------------------------*/
39 #ifndef fineBlockAmgLevel_H
40 #define fineBlockAmgLevel_H
42 #include "BlockAmgLevel.H"
43 #include "BlockLduSmoother.H"
44 #include "BlockLduMatrix.H"
47 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
52 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
55 class coarseBlockAmgLevel;
58 class BlockMatrixCoarsening;
60 /*---------------------------------------------------------------------------*\
61 Class fineBlockAmgLevel Declaration
62 \*---------------------------------------------------------------------------*/
65 class fineBlockAmgLevel
67 public BlockAmgLevel<Type>
71 //- Reference to matrix
72 const BlockLduMatrix<Type>& matrix_;
75 const dictionary& dict_;
78 autoPtr<BlockMatrixCoarsening<Type> > coarseningPtr_;
81 autoPtr<BlockLduSmoother<Type> > smootherPtr_;
84 mutable Field<Type> Ax_;
87 // Private Member Functions
89 //- Disallow default bitwise copy construct
90 fineBlockAmgLevel(const fineBlockAmgLevel<Type>&);
92 //- Disallow default bitwise assignment
93 void operator=(const fineBlockAmgLevel<Type>&);
98 //- Runtime type information
99 TypeName("fineBlockAmgLevel");
104 //- Construct from components
107 const BlockLduMatrix<Type>& matrix,
108 const dictionary& dict,
109 const word& coarseningType,
110 const label groupSize,
111 const label minCoarseEqns
117 virtual ~fineBlockAmgLevel()
123 //- Return reference to dictionary
124 const dictionary& dict() const
129 //- Return reference to x
130 virtual Field<Type>& x();
132 //- Return reference to b
133 virtual Field<Type>& b();
135 //- Calculate residual
136 virtual void residual
138 const Field<Type>& x,
139 const Field<Type>& b,
143 //- Restrict residual
144 virtual void restrictResidual
146 const Field<Type>& x,
147 const Field<Type>& b,
148 Field<Type>& xBuffer,
149 Field<Type>& coarseRes,
153 //- Prolongate correction
154 virtual void prolongateCorrection
157 const Field<Type>& coarseX
164 const Field<Type>& b,
172 const Field<Type>& b,
173 const scalar tolerance,
181 const Field<Type>& b,
185 //- Create next level from current level
186 virtual autoPtr<BlockAmgLevel<Type> > makeNextLevel() const;
190 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
192 } // End namespace Foam
194 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
197 # include "fineBlockAmgLevel.C"
200 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
204 // ************************************************************************* //