timeControlI.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) 2016 OpenFOAM Foundation
9 Copyright (C) 2019 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27\*---------------------------------------------------------------------------*/
28
29// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
30
32{
33 return time_;
34}
35
36
38{
39 return prefix_;
40}
41
42
44{
45 return controlNames_[timeControl_];
46}
47
48
50{
51 return timeControl_;
52}
53
54
55inline bool Foam::timeControl::always() const
56{
57 return
58 (
59 (timeControls::ocAlways == timeControl_)
60 || (timeControls::ocTimeStep == timeControl_ && intInterval_ <= 1)
61 );
62}
63
64
65inline Foam::scalar Foam::timeControl::interval() const
66{
67 return interval_;
68}
69
70
71inline Foam::label Foam::timeControl::executionIndex() const
72{
73 return executionIndex_;
74}
75
76
77// ************************************************************************* //
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:80
scalar interval() const
Return interval.
Definition: timeControlI.H:65
const Time & time() const
Return the Time.
Definition: timeControlI.H:31
timeControls control() const
Return the control enumeration.
Definition: timeControlI.H:49
timeControls
The time control options.
Definition: timeControl.H:67
label executionIndex() const
Return the index of the previous execution.
Definition: timeControlI.H:71
const word & name() const
Return the name (prefix)
Definition: timeControlI.H:37
bool always() const
Return true if the control will always execute - ie, no intervention.
Definition: timeControlI.H:55
const word & type() const
Return the named control enumeration as its 'type'.
Definition: timeControlI.H:43
A class for handling words, derived from Foam::string.
Definition: word.H:68