TimeStateI.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2016-2018 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 \*---------------------------------------------------------------------------*/
25 
26 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
27 
28 
29 inline Foam::scalar Foam::TimeState::timeOutputValue() const
30 {
31  return timeToUserTime(value());
32 }
33 
34 
36 {
37  return timeIndex_;
38 }
39 
40 
41 inline Foam::scalar Foam::TimeState::deltaTValue() const
42 {
43  return deltaT_;
44 }
45 
46 
47 inline Foam::scalar Foam::TimeState::deltaT0Value() const
48 {
49  return deltaT0_;
50 }
51 
52 
54 {
55  return dimensionedScalar("deltaT", dimTime, deltaT_);
56 }
57 
58 
60 {
61  return dimensionedScalar("deltaT0", dimTime, deltaT0_);
62 }
63 
64 
65 inline bool Foam::TimeState::writeTime() const
66 {
67  return writeTime_;
68 }
69 
70 
71 inline bool Foam::TimeState::outputTime() const
72 {
73  return writeTime_;
74 }
75 
76 
77 // ************************************************************************* //
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
scalar deltaT_
Definition: TimeState.H:56
dimensionedScalar deltaT0() const
Return old time step.
Definition: TimeStateI.H:59
virtual scalar timeToUserTime(const scalar t) const
Convert the real-time (s) into user-time (e.g. CA deg)
Definition: TimeState.C:58
bool writeTime() const
Return true if this is a write time.
Definition: TimeStateI.H:65
scalar deltaT0_
Definition: TimeState.H:58
scalar deltaT0Value() const
Return old time step value.
Definition: TimeStateI.H:47
scalar deltaTValue() const
Return time step value.
Definition: TimeStateI.H:41
const scalar & value() const
Return const reference to value.
label timeIndex() const
Return current time index.
Definition: TimeStateI.H:35
scalar timeOutputValue() const
Return current time value.
Definition: TimeStateI.H:29
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
bool outputTime() const
Return true if this is a write time.
Definition: TimeStateI.H:71
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
Definition: dimensionSets.H:51
dimensionedScalar deltaT() const
Return time step.
Definition: TimeStateI.H:53
label timeIndex_
Definition: TimeState.H:55