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 -------------------------------------------------------------------------------
11 License
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 
31 inline const Foam::Time& Foam::timeControl::time() const
32 {
33  return time_;
34 }
35 
36 
37 inline const Foam::word& Foam::timeControl::name() const
38 {
39  return prefix_;
40 }
41 
42 
43 inline const Foam::word& Foam::timeControl::type() const
44 {
45  return controlNames_[timeControl_];
46 }
47 
48 
50 {
51  return timeControl_;
52 }
53 
54 
55 inline bool Foam::timeControl::always() const
56 {
57  return
58  (
59  (timeControls::ocAlways == timeControl_)
60  || (timeControls::ocTimeStep == timeControl_ && intInterval_ <= 1)
61  );
62 }
63 
64 
65 inline Foam::scalar Foam::timeControl::interval() const
66 {
67  return interval_;
68 }
69 
70 
71 inline Foam::label Foam::timeControl::executionIndex() const
72 {
73  return executionIndex_;
74 }
75 
76 
77 // ************************************************************************* //
Foam::timeControl::always
bool always() const
Return true if the control will always execute - ie, no intervention.
Definition: timeControlI.H:55
Foam::timeControl::timeControls
timeControls
The time control options.
Definition: timeControl.H:66
Foam::Time
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:73
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::timeControl::interval
scalar interval() const
Return interval.
Definition: timeControlI.H:65
Foam::timeControl::name
const word & name() const
Return the name (prefix)
Definition: timeControlI.H:37
Foam::timeControl::executionIndex
label executionIndex() const
Return the index of the previous execution.
Definition: timeControlI.H:71
Foam::timeControl::control
timeControls control() const
Return the control enumeration.
Definition: timeControlI.H:49
Foam::timeControl::type
const word & type() const
Return the named control enumeration as its 'type'.
Definition: timeControlI.H:43
Foam::timeControl::time
const Time & time() const
Return the Time.
Definition: timeControlI.H:31