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 Algebraic multigrid fixed cycle class for the BlockLduMatrix
31 Klas Jareteg, 2012-12-12
36 \*---------------------------------------------------------------------------*/
38 #ifndef BlockAmgCycle_H
39 #define BlockAmgCycle_H
41 #include "BlockAmgLevel.H"
42 #include "NamedEnum.H"
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 // * * * * * * Forward declaration of template friend fuctions * * * * * * * //
52 class fineBlockAmgLevel;
55 class coarseBlockAmgLevel;
58 class BlockMatrixCoarsening;
64 /*---------------------------------------------------------------------------*\
65 Class blockAmgCycleName Declaration
66 \*---------------------------------------------------------------------------*/
68 class blockAmgCycleName
72 // Public enumerations
85 static const NamedEnum<cycleType, 3> cycleNames_;
89 /*---------------------------------------------------------------------------*\
90 Class BlockAmgCycle Declaration
91 \*---------------------------------------------------------------------------*/
96 public blockAmgCycleName
100 //- Pointer to current AMG level
101 autoPtr<BlockAmgLevel<Type> > levelPtr_;
103 //- Pointer to coarse AMG cycle
104 BlockAmgCycle<Type>* coarseLevelPtr_;
106 //- Number of coarse levels
110 // Private Member Functions
112 //- Disallow default bitwise copy construct
113 BlockAmgCycle(const BlockAmgCycle<Type>&);
115 //- Disallow default bitwise assignment
116 void operator=(const BlockAmgCycle<Type>&);
121 //- Runtime type information
122 TypeName("BlockAmgCycle");
127 //- Construct from AMG level
128 BlockAmgCycle(autoPtr<BlockAmgLevel<Type> > levelPtr);
133 virtual ~BlockAmgCycle();
138 //- Make coarse levels
139 void makeCoarseLevels(const label nMaxLevels);
141 //- Return number of levels
142 label nLevels() const
147 //- Calculate residual
150 const Field<Type>& x,
151 const Field<Type>& b,
155 levelPtr_->residual(x, b, res);
163 const Field<Type>& b,
164 Field<Type>& xBuffer,
165 const BlockAmgCycle::cycleType cycle,
166 const label nPreSweeps,
167 const label nPostSweeps,
173 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
175 } // End namespace Foam
177 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
180 # include "BlockAmgCycle.C"
183 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
187 // ************************************************************************* //