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-------------------------------------------------------------------------------
12License
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
57inline Foam::label Foam::solverControl::iter() const
58{
59 return iter_;
60}
61
62
64{
65 return averageIter_;
66}
67
68
69inline Foam::label Foam::solverControl::averageIter() const
70{
71 return averageIter_;
72}
73
74
75inline 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
108{
109 return average_;
110}
111
112
113// ************************************************************************* //
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
const dictionary & subDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a sub-dictionary.
Definition: dictionary.C:460
bool doAverageIter() const
const solver & solver_
Reference to the underlaying solver.
Definition: solverControl.H:58
bool storeInitValues() const
Re-initialize.
label averageStartIter() const
Return iteration index.
label & averageIter()
Return average iteration index reference.
virtual const dictionary solutionDict() const
Return the solutionControls dictionary.
bool printMaxMags() const
Print max mags of solver fields.
bool useAveragedFields() const
virtual const dictionary solverDict() const
Read controls from optimisationDict.
bool average() const
Whether averaging is enabled or not.
label iter() const
Return iteration index.