TimeStateI.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) 2021 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 Foam::scalar Foam::TimeState::timeOutputValue() const
32 {
33  return timeToUserTime(value());
34 }
35 
36 
37 inline Foam::label Foam::TimeState::timeIndex() const noexcept
38 {
39  return timeIndex_;
40 }
41 
42 
43 inline Foam::scalar Foam::TimeState::deltaTValue() const noexcept
44 {
45  return deltaT_;
46 }
47 
48 
49 inline Foam::scalar Foam::TimeState::deltaT0Value() const noexcept
50 {
51  return deltaT0_;
52 }
53 
54 
56 {
57  return dimensionedScalar("deltaT", dimTime, deltaT_);
58 }
59 
60 
62 {
63  return dimensionedScalar("deltaT0", dimTime, deltaT0_);
64 }
65 
66 
67 inline bool Foam::TimeState::writeTime() const noexcept
68 {
69  return writeTime_;
70 }
71 
72 
73 // ************************************************************************* //
const Type & value() const noexcept
Return const reference to value.
dimensionedScalar deltaT0() const
Return old time step.
Definition: TimeStateI.H:54
scalar deltaTValue() const noexcept
Return time step value.
Definition: TimeStateI.H:36
bool writeTime() const noexcept
True if this is a write time.
Definition: TimeStateI.H:60
virtual scalar timeToUserTime(const scalar t) const
Convert the real-time (s) into user-time (e.g. CA deg)
Definition: TimeState.C:48
label timeIndex() const noexcept
Return current time index.
Definition: TimeStateI.H:30
const direction noexcept
Definition: Scalar.H:258
scalar deltaT0Value() const noexcept
Return old time step value.
Definition: TimeStateI.H:42
scalar timeOutputValue() const
Return current time value.
Definition: TimeStateI.H:24
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
Definition: dimensionSets.H:51
dimensionedScalar deltaT() const
Return time step.
Definition: TimeStateI.H:48