solverControlI.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2007-2019 PCOpt/NTUA
9  Copyright (C) 2013-2019 FOSS GP
10  Copyright (C) 2019 OpenCFD Ltd.
11 -------------------------------------------------------------------------------
12 License
13  This file is part of OpenFOAM.
14 
15  OpenFOAM is free software: you can redistribute it and/or modify it
16  under the terms of the GNU General Public License as published by
17  the Free Software Foundation, either version 3 of the License, or
18  (at your option) any later version.
19 
20  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
21  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
22  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
23  for more details.
24 
25  You should have received a copy of the GNU General Public License
26  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
27 
28 
29 \*---------------------------------------------------------------------------*/
30 
31 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
32 
34 {
35  return solver_.dict();
36 }
37 
38 
40 {
41  return solverDict().subDict("solutionControls");
42 }
43 
44 
46 {
47  return printMaxMags_;
48 }
49 
50 
52 {
53  return storeInitValues_;
54 }
55 
56 
57 inline Foam::label Foam::solverControl::iter() const
58 {
59  return iter_;
60 }
61 
62 
63 inline Foam::label& Foam::solverControl::averageIter()
64 {
65  return averageIter_;
66 }
67 
68 
69 inline Foam::label Foam::solverControl::averageIter() const
70 {
71  return averageIter_;
72 }
73 
74 
75 inline Foam::label Foam::solverControl::averageStartIter() const
76 {
77  return averageStartIter_;
78 }
79 
80 
82 {
83  if (average_ && iter_ >= averageStartIter_)
84  {
85  return true;
86  }
87  else
88  {
89  return false;
90  }
91 }
92 
93 
95 {
96  if (average_ && averageIter_)
97  {
98  return true;
99  }
100  else
101  {
102  return false;
103  }
104 }
105 
106 
107 inline bool Foam::solverControl::average() const
108 {
109  return average_;
110 }
111 
112 
113 // ************************************************************************* //
Foam::solverControl::doAverageIter
bool doAverageIter() const
Definition: solverControlI.H:81
Foam::solverControl::iter
label iter() const
Return iteration index.
Definition: solverControlI.H:57
Foam::solverControl::storeInitValues
bool storeInitValues() const
Re-initialize.
Definition: solverControlI.H:51
Foam::solverControl::averageStartIter
label averageStartIter() const
Return iteration index.
Definition: solverControlI.H:75
Foam::solverControl::printMaxMags
bool printMaxMags() const
Print max mags of solver fields.
Definition: solverControlI.H:45
Foam::dictionary::subDict
const dictionary & subDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a sub-dictionary.
Definition: dictionary.C:460
Foam::solverControl::useAveragedFields
bool useAveragedFields() const
Definition: solverControlI.H:94
Foam::solverControl::averageIter
label & averageIter()
Return average iteration index reference.
Definition: solverControlI.H:63
Foam::solverControl::solver_
const solver & solver_
Reference to the underlaying solver.
Definition: solverControl.H:58
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam::solverControl::solutionDict
virtual const dictionary solutionDict() const
Return the solutionControls dictionary.
Definition: solverControlI.H:39
Foam::solverControl::solverDict
virtual const dictionary solverDict() const
Read controls from optimisationDict.
Definition: solverControlI.H:33
Foam::solverControl::average
bool average() const
Whether averaging is enabled or not.
Definition: solverControlI.H:107
Foam::solver::dict
virtual const dictionary & dict() const
Return the solver dictionary.
Definition: solver.C:113