1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
11 OpenFOAM is free software: you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by
13 the Free Software Foundation, either version 3 of the License, or
14 (at your option) any later version.
16 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 You should have received a copy of the GNU General Public License
22 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
28 Selector class for relaxation factors, solver type and solution.
33 \*---------------------------------------------------------------------------*/
38 #include "IOdictionary.H"
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 /*---------------------------------------------------------------------------*\
46 Class solution Declaration
47 \*---------------------------------------------------------------------------*/
55 //- Dictionary of temporary fields to cache
58 //- Switch for the caching mechanism
61 //- Dictionary of relaxation factors for all the fields
62 dictionary relaxationFactors_;
64 //- Optional default relaxation factor for all the fields
65 scalar defaultRelaxationFactor_;
67 //- Dictionary of solver parameters for all the fields
71 // Private Member Functions
73 //- Read settings from the dictionary
74 void read(const dictionary&);
76 //- Disallow default bitwise copy construct and assignment
77 solution(const solution&);
78 void operator=(const solution&);
83 //- Update from older solver controls syntax
84 // Usually verbose, since we want to know about the changes
85 // Returns the number of settings changed
86 static label upgradeSolverDict(dictionary& dict, const bool verbose=true);
94 //- Construct for given objectRegistry and dictionary
97 const objectRegistry& obr,
98 const fileName& dictName
106 //- Return true if the given field should be cached
107 bool cache(const word& name) const;
109 //- Return true if the relaxation factor is given for the field
110 bool relax(const word& name) const;
112 //- Return the relaxation factor for the given field
113 scalar relaxationFactor(const word& name) const;
115 //- Return the selected sub-dictionary of solvers if the "select"
116 // keyword is given, otherwise return the complete dictionary
117 const dictionary& solutionDict() const;
119 //- Return the solver controls dictionary for the given field
120 const dictionary& solverDict(const word& name) const;
122 //- Return the solver controls dictionary for the given field
123 const dictionary& solver(const word& name) const;
127 //- Read the solution dictionary
132 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
134 } // End namespace Foam
136 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
140 // ************************************************************************* //