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 Coarse AMG level stores matrix, x and b locally
31 Hrvoje Jasak, Wikki Ltd. All rights reserved
36 \*---------------------------------------------------------------------------*/
38 #ifndef coarseAmgLevel_H
39 #define coarseAmgLevel_H
42 #include "amgMatrix.H"
43 #include "lduPrimitiveMesh.H"
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50 /*---------------------------------------------------------------------------*\
51 Class coarseAmgLevel Declaration
52 \*---------------------------------------------------------------------------*/
61 autoPtr<amgMatrix> matrixPtr_;
70 const dictionary& dict_;
73 autoPtr<amgPolicy> policyPtr_;
76 autoPtr<lduSmoother> smootherPtr_;
79 // Private Member Functions
81 //- Disallow default bitwise copy construct
82 coarseAmgLevel(const coarseAmgLevel&);
84 //- Disallow default bitwise assignment
85 void operator=(const coarseAmgLevel&);
90 //- Construct from components
93 autoPtr<amgMatrix> matrixPtr,
94 const dictionary& dict,
95 const word& policyType,
96 const label groupSize,
97 const label minCoarseEqns,
98 const word& smootherType
104 virtual ~coarseAmgLevel();
109 //- Return reference to x
110 virtual scalarField& x();
112 //- Return reference to b
113 virtual scalarField& b();
115 //- Return reference to dictionary
116 const dictionary& dict() const
121 //- Calculate residual
122 virtual void residual
124 const scalarField& x,
125 const scalarField& b,
126 const direction cmpt,
130 //- Restrict residual
131 virtual void restrictResidual
133 const scalarField& x,
134 const scalarField& b,
135 const direction cmpt,
136 scalarField& xBuffer,
137 scalarField& coarseRes,
141 //- Prolongate correction
142 virtual void prolongateCorrection
145 const scalarField& coarseX
152 const scalarField& b,
153 const direction cmpt,
161 const scalarField& b,
162 const direction cmpt,
163 const scalar tolerance,
171 const scalarField& b,
172 const direction cmpt,
177 //- Create next level from current level
178 virtual autoPtr<amgLevel> makeNextLevel() const;
182 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
184 } // End namespace Foam
186 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
190 // ************************************************************************* //