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/>.
25 coupledIterativeSolver
28 Virtual base class for coupled iterative solvers
31 Hrvoje Jasak, Wikki Ltd. All rights reserved.
34 coupledIterativeSolver.C
36 \*---------------------------------------------------------------------------*/
38 #ifndef coupledIterativeSolver_H
39 #define coupledIterativeSolver_H
41 #include "coupledLduSolver.H"
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 /*---------------------------------------------------------------------------*\
49 Class coupledIterativeSolver Declaration
50 \*---------------------------------------------------------------------------*/
52 class coupledIterativeSolver
54 public coupledLduSolver
58 //- Control data dictionary
62 // Private Member Functions
64 //- Disallow default bitwise copy construct
65 coupledIterativeSolver(const coupledIterativeSolver&);
67 //- Disallow default bitwise assignment
68 void operator=(const coupledIterativeSolver&);
78 //- Relative tolerance
81 //- Minimum number of iterations
82 // (forced irrespective of convergence)
85 //- Maximum number of iterations
89 // Protected Member Functions
92 const dictionary& dict() const;
95 //- Is the stop criterion reached
96 bool stop(coupledSolverPerformance& solverPerf) const;
98 //- Read the control parameters from the dictionary
99 virtual void readControls();
101 //- Return the matrix norm used to normalise the residual for the
102 // stopping criterion
105 const FieldField<Field, scalar>& x,
106 const FieldField<Field, scalar>& b,
107 const FieldField<Field, scalar>& Ax,
108 FieldField<Field, scalar>& tmpField,
114 const FieldField<Field, scalar>& x,
115 const FieldField<Field, scalar>& b,
124 //- Construct from matrix components and solver data stream
125 coupledIterativeSolver
127 const word& fieldName,
128 const coupledLduMatrix& matrix,
129 const PtrList<FieldField<Field, scalar> >& bouCoeffs,
130 const PtrList<FieldField<Field, scalar> >& intCoeffs,
131 const lduInterfaceFieldPtrsListList& interfaces,
132 const dictionary& solverData
138 virtual ~coupledIterativeSolver()
146 scalar tolerance() const
151 scalar relTolerance() const
153 return relTolerance_;
156 label minIter() const
161 label maxIter() const
168 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
170 } // End namespace Foam
172 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
176 // ************************************************************************* //