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 Virtual base class for AMG coarsening policy
31 Hrvoje Jasak, Wikki Ltd. All rights reserved
36 \*---------------------------------------------------------------------------*/
41 #include "runTimeSelectionTables.H"
42 #include "primitiveFieldsFwd.H"
43 #include "FieldFields.H"
44 #include "lduInterfaceFieldPtrsList.H"
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
54 /*---------------------------------------------------------------------------*\
55 Class amgPolicy Declaration
56 \*---------------------------------------------------------------------------*/
65 //- Minimum number of coarse level equations
69 // Private Member Functions
71 //- Disallow default bitwise copy construct
72 amgPolicy(const amgPolicy&);
74 //- Disallow default bitwise assignment
75 void operator=(const amgPolicy&);
80 //- Runtime type information
81 virtual const word& type() const = 0;
84 // Declare run-time constructor selection tables
86 declareRunTimeSelectionTable
92 const lduMatrix& matrix,
93 const label groupSize,
94 const label minCoarseEqns
96 (matrix, groupSize, minCoarseEqns)
102 //- Select given name, group size and matrix
103 static autoPtr<amgPolicy> New
105 const word& policyType,
106 const lduMatrix& matrix,
107 const label groupSize,
108 const label minCoarseEqns
114 //- Construct from components
117 const label groupSize,
118 const label minCoarseEqns
121 groupSize_(groupSize),
122 minCoarseEqns_(minCoarseEqns)
134 //- Return group size
135 label groupSize() const
140 //- Return minimum number of coarse level equations
141 label minCoarseEqns() const
143 return minCoarseEqns_;
146 //- Can a coarse level be constructed?
147 virtual bool coarsen() const = 0;
150 virtual autoPtr<amgMatrix> restrictMatrix
152 const FieldField<Field, scalar>& bouCoeffs,
153 const FieldField<Field, scalar>& intCoeffs,
154 const lduInterfaceFieldPtrsList& interfaces
157 //- Restrict residual
158 virtual void restrictResidual
160 const scalarField& res,
161 scalarField& coarseRes
164 //- Prolongate correction
165 virtual void prolongateCorrection
168 const scalarField& coarseX
173 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
175 } // End namespace Foam
177 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
181 // ************************************************************************* //