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 Selector class for relaxation factors, solver type and solution.
33 \*---------------------------------------------------------------------------*/
38 #include "IOdictionary.H"
39 #include "debugSwitch.H"
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 /*---------------------------------------------------------------------------*\
47 Class solution Declaration
48 \*---------------------------------------------------------------------------*/
56 //- Dictionary of relaxation factors for all the fields
57 dictionary relaxationFactors_;
59 //- Optional default relaxation factor for all the fields
60 scalar defaultRelaxationFactor_;
62 //- Dictionary of solver parameters for all the fields
66 // Private Member Functions
68 //- Disallow default bitwise copy construct and assignment
69 solution(const solution&);
70 void operator=(const solution&);
75 //- Update from older solver controls syntax
76 // Usually verbose, since we want to know about the changes
77 // Returns the number of settings changed
78 static label upgradeSolverDict(dictionary& dict, const bool verbose=true);
81 static debug::debugSwitch debug;
86 //- Construct for given objectRegistry and dictionary
87 solution(const objectRegistry& obr, const fileName& dictName);
94 //- Return true if the relaxation factor is given for the field
95 bool relax(const word& name) const;
97 //- Return the relaxation factor for the given field
98 scalar relaxationFactor(const word& name) const;
100 //- Return the solver controls dictionary for the given field
101 const dictionary& solverDict(const word& name) const;
103 //- Return the solver controls dictionary for the given field
104 const dictionary& solver(const word& name) const;
109 //- Return access to relaxation factors dictionary
110 dictionary& relaxationFactors()
112 return relaxationFactors_;
115 //- Return access to solvers dictionary
116 dictionary& solvers()
124 //- Read the solution dictionary
130 //- WriteData function required for regIOobject write operation
131 virtual bool writeData(Ostream&) const;
135 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
137 } // End namespace Foam
139 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
143 // ************************************************************************* //