TimeState.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) 2011-2023 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 Class
25  Foam::TimeState
26 
27 Description
28  The time value with time-stepping information, user-defined remapping, etc.
29 
30 SourceFiles
31  TimeState.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef TimeState_H
36 #define TimeState_H
37 
38 #include "dimensionedScalar.H"
39 
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
41 
42 namespace Foam
43 {
44 
45 // Forward declaration of classes
46 class Time;
47 
48 
49 /*---------------------------------------------------------------------------*\
50  Class TimeState Declaration
51 \*---------------------------------------------------------------------------*/
52 
53 class TimeState
54 :
55  public dimensionedScalar
56 {
57  // Private Member Data
58 
59  label timeIndex_;
60  scalar deltaT_;
61  scalar deltaTSave_;
62  scalar deltaT0_;
63  bool deltaTchanged_;
64  label writeTimeIndex_;
65  bool writeTime_;
66 
67 
68 public:
69 
70  //- Declare friendship with the Time class
71  friend class Time;
72 
73 
74  // Constructors
75 
76  TimeState();
77 
78 
79  // Member Functions
80 
81  // Access
82 
83  //- Return current time index
84  inline label timeIndex() const;
85 
86  //- Return time step value
87  inline scalar deltaTValue() const;
88 
89  //- Return old time step value
90  inline scalar deltaT0Value() const;
91 
92  //- Return time step
93  inline dimensionedScalar deltaT() const;
94 
95  //- Return old time step
96  inline dimensionedScalar deltaT0() const;
97 
98 
99  // Check
100 
101  //- Return true if this is a write time
102  inline bool writeTime() const;
103 };
104 
105 
106 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
107 
108 } // End namespace Foam
109 
110 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
111 
112 #include "TimeStateI.H"
113 
114 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
115 
116 #endif
117 
118 // ************************************************************************* //
The time value with time-stepping information, user-defined remapping, etc.
Definition: TimeState.H:55
scalar deltaT0Value() const
Return old time step value.
Definition: TimeStateI.H:40
label timeIndex() const
Return current time index.
Definition: TimeStateI.H:28
scalar deltaTValue() const
Return time step value.
Definition: TimeStateI.H:34
dimensionedScalar deltaT0() const
Return old time step.
Definition: TimeStateI.H:52
dimensionedScalar deltaT() const
Return time step.
Definition: TimeStateI.H:46
bool writeTime() const
Return true if this is a write time.
Definition: TimeStateI.H:58
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:76
Namespace for OpenFOAM.
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