timeStepFunctionObject.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) 2020-2022 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::functionObjects::timeStep
26 
27 Description
28  Writes the time step
29 
30  Example of function object specification:
31  \verbatim
32  timeStep
33  {
34  type timeStep;
35 
36  libs ("libutilityFunctionObjects.so");
37 
38  writeControl timeStep;
39  writeInterval 1;
40  }
41  \endverbatim
42 
43  Output data is written to the dir postProcessing/timeStep/<timeDir>/
44 
45 See also
46  Foam::functionObject
47  Foam::functionObjects::regionFunctionObject
48  Foam::functionObjects::logFiles
49 
50 SourceFiles
51  timeStep.C
52 
53 \*---------------------------------------------------------------------------*/
54 
55 #ifndef timeStepFunctionObject_H
56 #define timeStepFunctionObject_H
57 
58 #include "regionFunctionObject.H"
59 #include "logFiles.H"
60 
61 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
62 
63 namespace Foam
64 {
65 namespace functionObjects
66 {
67 
68 /*---------------------------------------------------------------------------*\
69  Class timeStep Declaration
70 \*---------------------------------------------------------------------------*/
71 
72 class timeStep
73 :
74  public regionFunctionObject,
75  public logFiles
76 {
77 
78 protected:
79 
80  // Protected Member Functions
81 
82  //- Output file header information
83  virtual void writeFileHeader(const label i);
84 
85 
86 public:
87 
88  //- Runtime type information
89  TypeName("timeStep");
90 
91 
92  // Constructors
93 
94  //- Construct from Time and dictionary
95  timeStep
96  (
97  const word& name,
98  const Time& runTime,
99  const dictionary& dict
100  );
101 
102  //- Disallow default bitwise copy construction
103  timeStep(const timeStep&) = delete;
104 
105 
106  //- Destructor
107  virtual ~timeStep();
108 
109 
110  // Member Functions
111 
112  //- Read the controls
113  virtual bool read(const dictionary&);
114 
115  //- Return the list of fields required
116  virtual wordList fields() const
117  {
118  return wordList::null();
119  }
120 
121  //- Execute, currently does nothing
122  virtual bool execute();
123 
124  //- Write the time step value
125  virtual bool write();
126 
127 
128  // Member Operators
129 
130  //- Disallow default bitwise assignment
131  void operator=(const timeStep&) = delete;
132 };
133 
134 
135 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
136 
137 } // End namespace functionObjects
138 } // End namespace Foam
139 
140 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
141 
142 #endif
143 
144 // ************************************************************************* //
Specialisation of Foam::functionObject for a region and providing a reference to the region Foam::obj...
TypeName("timeStep")
Runtime type information.
dictionary dict
virtual wordList fields() const
Return the list of fields required.
const word & name() const
Return the name of this functionObject.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
virtual void writeFileHeader(const label i)
Output file header information.
static const List< T > & null()
Return a null List.
Definition: ListI.H:118
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:69
void operator=(const timeStep &)=delete
Disallow default bitwise assignment.
virtual bool write()
Write the time step value.
timeStep(const word &name, const Time &runTime, const dictionary &dict)
Construct from Time and dictionary.
A class for handling words, derived from string.
Definition: word.H:59
virtual bool execute()
Execute, currently does nothing.
virtual bool read(const dictionary &)
Read the controls.
Namespace for OpenFOAM.
functionObject base class for creating, maintaining and writing log files e.g. integrated of averaged...
Definition: logFiles.H:57