|
|
|
solution.HGo to the documentation of this file.00001 /*---------------------------------------------------------------------------*\ 00002 ========= | 00003 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox 00004 \\ / O peration | 00005 \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. 00006 \\/ M anipulation | 00007 ------------------------------------------------------------------------------- 00008 License 00009 This file is part of OpenFOAM. 00010 00011 OpenFOAM is free software; you can redistribute it and/or modify it 00012 under the terms of the GNU General Public License as published by the 00013 Free Software Foundation; either version 2 of the License, or (at your 00014 option) any later version. 00015 00016 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT 00017 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00018 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 00019 for more details. 00020 00021 You should have received a copy of the GNU General Public License 00022 along with OpenFOAM; if not, write to the Free Software Foundation, 00023 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 00024 00025 Class 00026 Foam::solution 00027 00028 Description 00029 Selector class for relaxation factors, solver type and solution. 00030 00031 SourceFiles 00032 solution.C 00033 00034 \*---------------------------------------------------------------------------*/ 00035 00036 #ifndef solution_H 00037 #define solution_H 00038 00039 #include "IOdictionary.H" 00040 00041 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00042 00043 namespace Foam 00044 { 00045 00046 /*---------------------------------------------------------------------------*\ 00047 Class solution Declaration 00048 \*---------------------------------------------------------------------------*/ 00049 00050 class solution 00051 : 00052 public IOdictionary 00053 { 00054 // Private data 00055 00056 //- Dictionary of relaxation factors for all the fields 00057 dictionary relaxationFactors_; 00058 00059 //- Optional default relaxation factor for all the fields 00060 scalar defaultRelaxationFactor_; 00061 00062 //- Dictionary of solver parameters for all the fields 00063 dictionary solvers_; 00064 00065 // Private Member Functions 00066 00067 //- Disallow default bitwise copy construct and assignment 00068 solution(const solution&); 00069 void operator=(const solution&); 00070 00071 00072 public: 00073 00074 //- Update from older solver controls syntax 00075 // Usually verbose, since we want to know about the changes 00076 // Returns the number of settings changed 00077 static label upgradeSolverDict(dictionary& dict, const bool verbose=true); 00078 00079 //- Debug switch 00080 static int debug; 00081 00082 00083 // Constructors 00084 00085 //- Construct for given objectRegistry and dictionary 00086 solution(const objectRegistry& obr, const fileName& dictName); 00087 00088 00089 // Member Functions 00090 00091 // Access 00092 00093 //- Return the selected sub-dictionary of solvers if the "select" 00094 // keyword is given, otherwise return the complete dictionary 00095 const dictionary& solutionDict() const; 00096 00097 //- Return true if the relaxation factor is given for the field 00098 bool relax(const word& name) const; 00099 00100 //- Return the relaxation factor for the given field 00101 scalar relaxationFactor(const word& name) const; 00102 00103 //- Return the solver controls dictionary for the given field 00104 const dictionary& solverDict(const word& name) const; 00105 00106 //- Return the solver controls dictionary for the given field 00107 const dictionary& solver(const word& name) const; 00108 00109 // Read 00110 00111 //- Read the solution dictionary 00112 bool read(); 00113 }; 00114 00115 00116 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00117 00118 } // End namespace Foam 00119 00120 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00121 00122 #endif 00123 00124 // ************************************************************************* // |