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
32 Hrvoje Jasak, Wikki Ltd. All rights reserved
37 \*---------------------------------------------------------------------------*/
39 #ifndef fineAmgLevel_H
40 #define fineAmgLevel_H
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 /*---------------------------------------------------------------------------*\
50 Class fineAmgLevel Declaration
51 \*---------------------------------------------------------------------------*/
59 //- Reference to matrix
60 const lduMatrix& matrix_;
62 //- Coupling coefficients, upper
63 const FieldField<Field, scalar>& coupleBouCoeffs_;
65 //- Coupling coefficients, lower
66 const FieldField<Field, scalar>& coupleIntCoeffs_;
68 //- Coupling interface fields
69 const lduInterfaceFieldPtrsList& interfaceFields_;
72 const dictionary& dict_;
75 autoPtr<amgPolicy> policyPtr_;
78 autoPtr<lduSmoother> smootherPtr_;
81 // Private Member Functions
83 //- Disallow default bitwise copy construct
84 fineAmgLevel(const fineAmgLevel&);
86 //- Disallow default bitwise assignment
87 void operator=(const fineAmgLevel&);
92 //- Construct from components
95 const lduMatrix& matrix,
96 const FieldField<Field, scalar>& coupleBouCoeffs,
97 const FieldField<Field, scalar>& coupleIntCoeffs,
98 const lduInterfaceFieldPtrsList& interfacesFields,
99 const dictionary& dict,
100 const word& policyType,
101 const label groupSize,
102 const label minCoarseEqns,
103 const word& smootherType
109 virtual ~fineAmgLevel()
115 //- Return reference to dictionary
116 const dictionary& dict() const
121 //- Return reference to x
122 virtual scalarField& x();
124 //- Return reference to b
125 virtual scalarField& b();
127 //- Calculate residual
128 virtual void residual
130 const scalarField& x,
131 const scalarField& b,
132 const direction cmpt,
136 //- Restrict residual
137 virtual void restrictResidual
139 const scalarField& x,
140 const scalarField& b,
141 const direction cmpt,
142 scalarField& xBuffer,
143 scalarField& coarseRes,
147 //- Prolongate correction
148 virtual void prolongateCorrection
151 const scalarField& coarseX
158 const scalarField& b,
159 const direction cmpt,
167 const scalarField& b,
168 const direction cmpt,
169 const scalar tolerance,
177 const scalarField& b,
178 const direction cmpt,
182 //- Create next level from current level
183 virtual autoPtr<amgLevel> makeNextLevel() const;
187 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
189 } // End namespace Foam
191 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
195 // ************************************************************************* //