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 Pairwise agglomerative AMG policy. Legacy implementation
31 Hrvoje Jasak, Wikki Ltd. All rights reserved
36 \*---------------------------------------------------------------------------*/
41 #include "amgPolicy.H"
42 #include "lduMatrix.H"
43 #include "tolerancesSwitch.H"
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50 /*---------------------------------------------------------------------------*\
51 Class pamgPolicy Declaration
52 \*---------------------------------------------------------------------------*/
60 //- Reference to matrix
61 const lduMatrix& matrix_;
63 //- Child array: for each fine equation give coarse cluster index
66 //- Number of solo cells
69 //- Number of coarse equations
72 //- Can a coarse level be constructed?
76 // Private Member Functions
78 //- Disallow default bitwise copy construct
79 pamgPolicy(const pamgPolicy&);
81 //- Disallow default bitwise assignment
82 void operator=(const pamgPolicy&);
88 // Private Static Data
90 //- Diagonal scaling factor
91 static const debug::tolerancesSwitch diagFactor_;
96 //- Runtime type information
102 //- Construct from matrix and group size
105 const lduMatrix& matrix,
106 const label groupSize,
107 const label minCoarseEqns
112 virtual ~pamgPolicy();
117 //- Can a coarse level be constructed?
118 virtual bool coarsen() const
124 virtual autoPtr<amgMatrix> restrictMatrix
126 const FieldField<Field, scalar>& bouCoeffs,
127 const FieldField<Field, scalar>& intCoeffs,
128 const lduInterfaceFieldPtrsList& interfaces
131 //- Restrict residual
132 virtual void restrictResidual
134 const scalarField& res,
135 scalarField& coarseRes
138 //- Prolongate correction
139 virtual void prolongateCorrection
142 const scalarField& coarseX
148 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
150 } // End namespace Foam
152 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
156 // ************************************************************************* //