realTime.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) 2021 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::userTimes::real
26 
27 Description
28  A simple userTime which simply returns the real-time is seconds.
29 
30 SourceFiles
31  realTime.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef realTime_H
36 #define realTime_H
37 
38 #include "userTime.H"
39 
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
41 
42 namespace Foam
43 {
44 namespace userTimes
45 {
46 
47 /*---------------------------------------------------------------------------*\
48  Class real Declaration
49 \*---------------------------------------------------------------------------*/
50 
51 class real
52 :
53  public userTime
54 {
55 
56 public:
57 
58  //- Runtime type information
59  TypeName("real");
60 
61 
62  // Constructors
63 
64  //- Construct from controlDict
65  real(const dictionary& controlDict);
66 
67 
68  //- Destructor
69  virtual ~real();
70 
71 
72  // Member Functions
73 
74  //- Return tau (s)
75  virtual scalar userTimeToTime(const scalar tau) const;
76 
77  //- Return t (s)
78  virtual scalar timeToUserTime(const scalar t) const;
79 
80  //- Return real-time unit (s)
81  virtual word unit() const;
82 
83  //- Read the controlDict and set all the parameters
84  virtual bool read(const dictionary& controlDict);
85 };
86 
87 
88 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
89 
90 } // End namespace userTimes
91 } // End namespace Foam
92 
93 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
94 
95 #endif
96 
97 // ************************************************************************* //
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:160
A simple userTime which simply returns the real-time is seconds.
Definition: realTime.H:53
virtual scalar timeToUserTime(const scalar t) const
Return t (s)
Definition: realTime.C:63
real(const dictionary &controlDict)
Construct from controlDict.
Definition: realTime.C:43
virtual scalar userTimeToTime(const scalar tau) const
Return tau (s)
Definition: realTime.C:57
virtual ~real()
Destructor.
Definition: realTime.C:51
virtual bool read(const dictionary &controlDict)
Read the controlDict and set all the parameters.
Definition: realTime.C:75
TypeName("real")
Runtime type information.
virtual word unit() const
Return real-time unit (s)
Definition: realTime.C:69
A class for handling words, derived from string.
Definition: word.H:62
Namespace for OpenFOAM.
runTime controlDict().lookup("adjustTimeStep") >> adjustTimeStep