Time.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) 2011-2017 OpenFOAM Foundation
9  Copyright (C) 2016-2019 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 Class
28  Foam::Time
29 
30 Description
31  Class to control time during OpenFOAM simulations that is also the
32  top-level objectRegistry.
33 
34 SourceFiles
35  Time.C
36  TimeIO.C
37  findInstance.C
38 
39 \*---------------------------------------------------------------------------*/
40 
41 #ifndef Time_H
42 #define Time_H
43 
44 #include "TimePaths.H"
45 #include "objectRegistry.H"
46 #include "unwatchedIOdictionary.H"
47 #include "FIFOStack.H"
48 #include "clock.H"
49 #include "cpuTime.H"
50 #include "TimeState.H"
51 #include "Switch.H"
52 #include "instantList.H"
53 #include "Enum.H"
54 #include "typeInfo.H"
55 #include "dlLibraryTable.H"
56 #include "functionObjectList.H"
57 #include "sigWriteNow.H"
58 #include "sigStopAtWriteNow.H"
59 
60 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
61 
62 namespace Foam
63 {
64 
65 // Forward declarations
66 class argList;
67 class profilingTrigger;
68 class OSstream;
69 
70 /*---------------------------------------------------------------------------*\
71  Class Time Declaration
72 \*---------------------------------------------------------------------------*/
73 
74 class Time
75 :
76  public clock,
77  public cpuTime,
78  public TimePaths,
79  public objectRegistry,
80  public TimeState
81 {
82 public:
83 
84  //- Write control options
85  enum writeControls
86  {
93  wcUnknown
94  };
95 
96  //- Stop-run control options, which are primarily used when
97  //- altering the stopAt condition.
98  enum stopAtControls
99  {
104  saUnknown
105  };
106 
107  //- Supported time directory name formats
108  enum fmtflags
109  {
110  general = 0,
113  };
114 
115 
116  //- Names for writeControls
118 
119  //- Names for stopAtControls
121 
122 
123  //- Style for "ExecutionTime = " output
124  // 0 = seconds (with trailing 's')
125  // 1 = day-hh:mm:ss
126  //
127  // \note this is public so registered info switches can modify it.
128  static int printExecutionFormat_;
129 
130 
131 private:
132 
133  // Private data
134 
135  //- Profiling trigger for time-loop (for run, loop)
136  mutable profilingTrigger* loopProfiling_;
137 
138  //- Any loaded dynamic libraries. Make sure to construct before
139  // reading controlDict.
140  dlLibraryTable libs_;
141 
142  //- The controlDict
143  unwatchedIOdictionary controlDict_;
144 
145 
146 protected:
147 
148  // Protected data
149 
151 
152  scalar startTime_;
153 
154  mutable scalar endTime_;
155 
156  mutable stopAtControls stopAt_;
157 
159 
160  scalar writeInterval_;
161 
163 
165 
166  //- The total number of sub-cycles, the current sub-cycle index,
167  //- or 0 if time is not being sub-cycled
169 
170  // One-shot writing
171  bool writeOnce_;
172 
173  //- If time is being sub-cycled this is the previous TimeState
175 
176  //- Signal handler for one-shot writing upon signal
178 
179  //- Signal handler for write and clean exit upon signal
181 
182 
183  //- Time directory name format
184  static fmtflags format_;
185 
186  //- Time directory name precision
187  static int precision_;
188 
189  //- Maximum time directory name precision
190  static const int maxPrecision_;
191 
192 
193  //- Adjust the time step so that writing occurs at the specified time
194  void adjustDeltaT();
195 
196  //- Set the controls from the current controlDict
197  void setControls();
198 
199  //- Set file monitoring, profiling, etc
200  // Optionally force profiling without inspecting the controlDict
201  void setMonitoring(const bool forceProfiling=false);
202 
203  //- Read the control dictionary and set the write controls etc.
204  virtual void readDict();
205 
206 
207 private:
208 
209  //- Default write stream option (format, version, compression)
210  IOstreamOption writeStreamOption_;
211 
212  //- Default graph format
213  word graphFormat_;
214 
215  //- Is runtime modification of dictionaries allowed?
216  Switch runTimeModifiable_;
217 
218  //- Function objects executed at start and on ++, +=
219  mutable functionObjectList functionObjects_;
220 
221 
222 public:
223 
224  TypeName("time");
225 
226  //- The default control dictionary name (normally "controlDict")
227  static word controlDictName;
228 
229 
230  // Constructors
231 
232  //- Construct given name of dictionary to read and argument list
233  Time
234  (
235  const word& ctrlDictName,
236  const argList& args,
237  const word& systemName = "system",
238  const word& constantName = "constant"
239  );
240 
241  //- Construct given name of dictionary to read, rootPath and casePath
242  Time
243  (
244  const word& ctrlDictName,
245  const fileName& rootPath,
246  const fileName& caseName,
247  const word& systemName = "system",
248  const word& constantName = "constant",
249  const bool enableFunctionObjects = true,
250  const bool enableLibs = true
251  );
252 
253  //- Construct given dictionary, rootPath and casePath
254  Time
255  (
256  const dictionary& dict,
257  const fileName& rootPath,
258  const fileName& caseName,
259  const word& systemName = "system",
260  const word& constantName = "constant",
261  const bool enableFunctionObjects = true,
262  const bool enableLibs = true
263  );
264 
265  //- Construct given endTime, rootPath and casePath
266  Time
267  (
268  const fileName& rootPath,
269  const fileName& caseName,
270  const word& systemName = "system",
271  const word& constantName = "constant",
272  const bool enableFunctionObjects = true,
273  const bool enableLibs = true
274  );
275 
276 
277  // Selectors
278 
279  //- Construct dummy time, without functionObjects or libraries
280  static autoPtr<Time> New();
281 
282  //- Construct dummy time, without functionObjects or libraries
283  static autoPtr<Time> New(const fileName& caseDir);
284 
285 
286  //- Destructor
287  virtual ~Time();
288 
289 
290  // Member Functions
291 
292  // Database functions
293 
294  //- Return name from objectRegistry and not TimePaths
295  using objectRegistry::name;
296 
297  //- Return root path
298  using TimePaths::rootPath;
299 
300  //- Return case name
301  using TimePaths::caseName;
302 
303  //- Return path
304  fileName path() const
305  {
306  return rootPath()/caseName();
307  }
308 
309  //- Return read access to the controlDict dictionary
310  const dictionary& controlDict() const
311  {
312  return controlDict_;
313  }
314 
315  virtual const fileName& dbDir() const
316  {
317  return fileName::null;
318  }
319 
320  //- Return current time path
321  fileName timePath() const
322  {
323  return path()/timeName();
324  }
325 
326  //- Default write format
328  {
329  return writeStreamOption_.format();
330  }
331 
332  //- Default write version number
334  {
335  return writeStreamOption_.version();
336  }
337 
338  //- Default write compression
340  {
341  return writeStreamOption_.compression();
342  }
343 
344  //- Default graph format
345  const word& graphFormat() const
346  {
347  return graphFormat_;
348  }
349 
350  //- Supports re-reading
351  const Switch& runTimeModifiable() const
352  {
353  return runTimeModifiable_;
354  }
355 
356  //- Read control dictionary, update controls and time
357  virtual bool read();
358 
359  //- Read the objects that have been modified
360  void readModifiedObjects();
361 
362  //- Return the location of "dir" containing the file "name".
363  //- (eg, used in reading mesh data)
364  // If name is null, search for the directory "dir" only.
365  // Does not search beyond stopInstance (if set) or constant.
367  (
368  const fileName& dir,
369  const word& name = word::null,
371  const word& stopInstance = word::null
372  ) const;
373 
374  //- Search the case for the time directory path
375  //- corresponding to the given instance
377  (
378  const fileName& directory,
379  const instant& t
380  ) const;
381 
382  //- Search the case for the time directory path
383  //- corresponding to the given instance
384  word findInstancePath(const instant& t) const;
385 
386  //- Write time dictionary to the <time>/uniform directory
387  virtual bool writeTimeDict() const;
388 
389  //- Write using given format, version and compression
390  virtual bool writeObject
391  (
395  const bool valid
396  ) const;
397 
398  //- Write the objects immediately (not at end of iteration)
399  //- and continue the run
400  bool writeNow();
401 
402  //- Write the objects now (not at end of iteration) and end the run
403  bool writeAndEnd();
404 
405  //- Write the objects once (one shot) and continue the run
406  void writeOnce();
407 
408  //- Print the elapsed ExecutionTime (cpu-time), ClockTime
409  Ostream& printExecutionTime(OSstream& os) const;
410 
411 
412  // Access
413 
414  //- Return time name of given scalar time
415  //- formatted with the given precision
416  static word timeName
417  (
418  const scalar t,
419  const int precision = precision_
420  );
421 
422  //- Return current time name
423  virtual word timeName() const;
424 
425  //- Return start time index
426  virtual label startTimeIndex() const;
427 
428  //- Return start time
429  virtual dimensionedScalar startTime() const;
430 
431  //- Return end time
432  virtual dimensionedScalar endTime() const;
433 
434  //- Return the stop control information
435  virtual stopAtControls stopAt() const;
436 
437  //- Return true if adjustTimeStep is true
438  virtual bool isAdjustTimeStep() const;
439 
440  //- Return the list of function objects
441  const functionObjectList& functionObjects() const
442  {
443  return functionObjects_;
444  }
445 
446  //- External access to the loaded libraries
447  const dlLibraryTable& libs() const
448  {
449  return libs_;
450  }
451 
452  //- External access to the loaded libraries
454  {
455  return libs_;
456  }
457 
458  //- Zero (tests as false) if time is not being sub-cycled,
459  //- otherwise the current sub-cycle index or the total number of
460  //- sub-cycles.
461  // The interpretation of non-zero values is dependent on the
462  // routine.
463  label subCycling() const
464  {
465  return subCycling_;
466  }
467 
468  //- Return previous TimeState if time is being sub-cycled
469  const TimeState& prevTimeState() const
470  {
471  return *prevTimeState_;
472  }
473 
474 
475  // Check
476 
477  //- Return true if run should continue,
478  // also invokes the functionObjectList::end() method
479  // when the time goes out of range
480  // \note
481  // For correct behaviour, the following style of time-loop
482  // is recommended:
483  // \code
484  // while (runTime.run())
485  // {
486  // ++runTime;
487  // solve;
488  // runTime.write();
489  // }
490  // \endcode
491  virtual bool run() const;
492 
493  //- Return true if run should continue and if so increment time
494  // also invokes the functionObjectList::end() method
495  // when the time goes out of range
496  // \note
497  // For correct behaviour, the following style of time-loop
498  // is recommended:
499  // \code
500  // while (runTime.loop())
501  // {
502  // solve;
503  // runTime.write();
504  // }
505  // \endcode
506  virtual bool loop();
507 
508  //- Return true if end of run,
509  // does not invoke any functionObject methods
510  // \note
511  // The rounding heuristics near endTime mean that
512  // \code run() \endcode and \code !end() \endcode may
513  // not yield the same result
514  virtual bool end() const;
515 
516 
517  // Edit
518 
519  //- Adjust the current stopAtControl.
520  // \param stopCtrl the new stop control, whereby
521  // stopAtControls::saUnknown is treated as a no-op.
522  // \note this value only persists until the next time the
523  // dictionary is read.
524  // \return true if the stopAt() value was changed.
525  virtual bool stopAt(const stopAtControls stopCtrl) const;
526 
527  //- Reset the time and time-index to those of the given time
528  virtual void setTime(const Time& t);
529 
530  //- Reset the time and time-index
531  virtual void setTime(const instant& inst, const label newIndex);
532 
533  //- Reset the time and time-index
534  virtual void setTime
535  (
536  const dimensionedScalar& newTime,
537  const label newIndex
538  );
539 
540  //- Reset the time and time-index
541  virtual void setTime(const scalar newTime, const label newIndex);
542 
543  //- Reset end time
544  virtual void setEndTime(const dimensionedScalar& endTime);
545 
546  //- Reset end time
547  virtual void setEndTime(const scalar endTime);
548 
549  //- Reset time step, normally also calling adjustDeltaT()
550  virtual void setDeltaT
551  (
552  const dimensionedScalar& deltaT,
553  const bool adjust = true
554  );
555 
556  //- Reset time step, normally also calling adjustDeltaT()
557  virtual void setDeltaT
558  (
559  const scalar deltaT,
560  const bool adjust = true
561  );
562 
563  //- Set time to sub-cycle for the given number of steps
564  virtual TimeState subCycle(const label nSubCycles);
565 
566  //- Adjust the reported sub-cycle index.
567  // \param index is the sub-cycle index.
568  // This index is ignored sub-cycling was
569  // not already registered, or if the index is zero or
570  // negative.
571  virtual void subCycleIndex(const label index);
572 
573  //- Reset time after sub-cycling back to previous TimeState
574  virtual void endSubCycle();
575 
576  //- Return non-const access to the list of function objects
578  {
579  return functionObjects_;
580  }
581 
582 
583  // Member operators
584 
585  //- Set deltaT to that specified and increment time via operator++()
586  virtual Time& operator+=(const dimensionedScalar& deltaT);
587 
588  //- Set deltaT to that specified and increment time via operator++()
589  virtual Time& operator+=(const scalar deltaT);
590 
591  //- Prefix increment,
592  // also invokes the functionObjectList::start() or
593  // functionObjectList::execute() method, depending on the time-index
594  virtual Time& operator++();
595 
596  //- Postfix increment, this is identical to the prefix increment
597  virtual Time& operator++(int);
598 };
599 
600 
601 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
602 
603 } // End namespace Foam
604 
605 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
606 
607 #endif
608 
609 // ************************************************************************* //
Foam::TimePaths::rootPath
const fileName & rootPath() const
Return root path.
Definition: TimePathsI.H:42
Foam::Time::writeCompression
IOstream::compressionType writeCompression() const
Default write compression.
Definition: Time.H:338
instantList.H
FIFOStack.H
Foam::Time::writeControls
writeControls
Write control options.
Definition: Time.H:84
Foam::dlLibraryTable
A table of dynamically loaded libraries.
Definition: dlLibraryTable.H:51
Foam::Switch
A simple wrapper around bool so that it can be read as a word: true/false, on/off,...
Definition: Switch.H:70
Foam::Enum< writeControls >
Foam::Time
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:73
Foam::IOobject::name
const word & name() const
Return name.
Definition: IOobjectI.H:46
Foam::Time::end
virtual bool end() const
Return true if end of run,.
Definition: Time.C:952
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
Foam::fileName
A class for handling file names.
Definition: fileName.H:69
Foam::Time::writeOnce_
bool writeOnce_
Definition: Time.H:170
TimePaths.H
typeInfo.H
Foam::TimeState::deltaT
dimensionedScalar deltaT() const
Return time step.
Definition: TimeStateI.H:54
Foam::sigStopAtWriteNow
Signal handler to write and stop the job. The interrupt is defined by OptimisationSwitches::stopAtWri...
Definition: sigStopAtWriteNow.H:53
Foam::Time::saNextWrite
stop at the next data write interval
Definition: Time.H:102
Foam::Time::purgeWrite_
label purgeWrite_
Definition: Time.H:161
Foam::Time::previousWriteTimes_
FIFOStack< word > previousWriteTimes_
Definition: Time.H:163
Foam::Time::writeFormat
IOstream::streamFormat writeFormat() const
Default write format.
Definition: Time.H:326
Foam::Time::writeControlNames
static const Enum< writeControls > writeControlNames
Names for writeControls.
Definition: Time.H:116
Foam::Time::sigWriteNow_
sigWriteNow sigWriteNow_
Signal handler for one-shot writing upon signal.
Definition: Time.H:176
Foam::Time::saUnknown
Dummy no-op. Do not change current value.
Definition: Time.H:103
functionObjectList.H
objectRegistry.H
Foam::IOstreamOption::format
streamFormat format() const noexcept
Get the current stream format.
Definition: IOstreamOption.H:273
Foam::dimensioned< scalar >::name
const word & name() const
Return const reference to name.
Definition: dimensionedType.C:376
Foam::Time::functionObjects
const functionObjectList & functionObjects() const
Return the list of function objects.
Definition: Time.H:440
Foam::Time::stopAt
virtual stopAtControls stopAt() const
Return the stop control information.
Definition: Time.C:863
Foam::TimePaths::caseName
const fileName & caseName() const
Return case name.
Definition: TimePathsI.H:54
Foam::argList
Extract command arguments and options from the supplied argc and argv parameters.
Definition: argList.H:123
Foam::Time::writeOnce
void writeOnce()
Write the objects once (one shot) and continue the run.
Definition: TimeIO.C:608
Foam::Time::controlDictName
static word controlDictName
The default control dictionary name (normally "controlDict")
Definition: Time.H:226
Foam::Time::fmtflags
fmtflags
Supported time directory name formats.
Definition: Time.H:107
Foam::functionObjectList
List of function objects with start(), execute() and end() functions that is called for each object.
Definition: functionObjectList.H:66
Foam::Time::startTimeIndex_
label startTimeIndex_
Definition: Time.H:149
Foam::Time::read
virtual bool read()
Read control dictionary, update controls and time.
Definition: TimeIO.C:434
Foam::Time::wcUnknown
Dummy no-op.
Definition: Time.H:92
Foam::unwatchedIOdictionary
unwatchedIOdictionary is like IOdictionary but stores dependencies as files instead of fileMonitor wa...
Definition: unwatchedIOdictionary.H:49
Foam::Time::writeAndEnd
bool writeAndEnd()
Write the objects now (not at end of iteration) and end the run.
Definition: TimeIO.C:599
Foam::Time::wcTimeStep
"timeStep"
Definition: Time.H:87
Foam::Time::prevTimeState_
autoPtr< TimeState > prevTimeState_
If time is being sub-cycled this is the previous TimeState.
Definition: Time.H:173
Foam::objectRegistry
Registry of regIOobjects.
Definition: objectRegistry.H:60
Foam::Time::saEndTime
Stop when Time reaches prescribed endTime.
Definition: Time.H:99
Foam::Time::subCycling
label subCycling() const
Definition: Time.H:462
Foam::Time::printExecutionTime
Ostream & printExecutionTime(OSstream &os) const
Print the elapsed ExecutionTime (cpu-time), ClockTime.
Definition: TimeIO.C:614
Foam::Time::stopAtControlNames
static const Enum< stopAtControls > stopAtControlNames
Names for stopAtControls.
Definition: Time.H:119
Foam::Time::precision_
static int precision_
Time directory name precision.
Definition: Time.H:186
Foam::Time::timeName
virtual word timeName() const
Return current time name.
Definition: Time.C:774
Foam::Time::adjustDeltaT
void adjustDeltaT()
Adjust the time step so that writing occurs at the specified time.
Definition: Time.C:101
Foam::TimeState
The time value with time-stepping information, user-defined remapping, etc.
Definition: TimeState.H:51
Foam::Time::~Time
virtual ~Time()
Destructor.
Definition: Time.C:742
Foam::Time::subCycle
virtual TimeState subCycle(const label nSubCycles)
Set time to sub-cycle for the given number of steps.
Definition: Time.C:1070
Foam::label
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:62
Foam::Time::writeObject
virtual bool writeObject(IOstream::streamFormat, IOstream::versionNumber, IOstream::compressionType, const bool valid) const
Write using given format, version and compression.
Definition: TimeIO.C:542
Foam::IOstreamOption::versionNumber
Representation of a major/minor version number.
Definition: IOstreamOption.H:79
general
General relative velocity model.
Foam::Time::setEndTime
virtual void setEndTime(const dimensionedScalar &endTime)
Reset end time.
Definition: Time.C:1036
Foam::Time::timePath
fileName timePath() const
Return current time path.
Definition: Time.H:320
clock.H
Foam::Time::wcCpuTime
"cpuTime"
Definition: Time.H:91
Foam::IOstreamOption
The IOstreamOption is a simple container for options an IOstream can normally have....
Definition: IOstreamOption.H:57
Switch.H
Foam::Time::subCycling_
label subCycling_
Definition: Time.H:167
Foam::Time::saNoWriteNow
Adjust endTime to stop immediately w/o writing.
Definition: Time.H:100
Foam::OSstream
Generic output stream.
Definition: OSstream.H:54
Foam::Time::operator+=
virtual Time & operator+=(const dimensionedScalar &deltaT)
Set deltaT to that specified and increment time via operator++()
Definition: Time.C:1112
Foam::IOstreamOption::version
versionNumber version() const noexcept
Get the stream version.
Definition: IOstreamOption.H:321
Foam::Time::stopAt_
stopAtControls stopAt_
Definition: Time.H:155
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::fixed
IOstream & fixed(IOstream &io)
Definition: IOstream.H:441
Foam::cpuTimeCxx
Starts timing CPU usage and return elapsed time from start.
Definition: cpuTimeCxx.H:53
Foam::Time::prevTimeState
const TimeState & prevTimeState() const
Return previous TimeState if time is being sub-cycled.
Definition: Time.H:468
Foam::IOstreamOption::streamFormat
streamFormat
Data format (ascii | binary)
Definition: IOstreamOption.H:64
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:121
Foam::Time::loop
virtual bool loop()
Return true if run should continue and if so increment time.
Definition: Time.C:939
Foam::Time::controlDict
const dictionary & controlDict() const
Return read access to the controlDict dictionary.
Definition: Time.H:309
Foam::Time::libs
const dlLibraryTable & libs() const
External access to the loaded libraries.
Definition: Time.H:446
Foam::Time::operator++
virtual Time & operator++()
Prefix increment,.
Definition: Time.C:1125
Foam::Time::TypeName
TypeName("time")
Foam::dimensioned< scalar >
Foam::Time::wcAdjustableRunTime
"adjustable" / "adjustableRunTime"
Definition: Time.H:89
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::Time::sigStopAtWriteNow_
sigStopAtWriteNow sigStopAtWriteNow_
Signal handler for write and clean exit upon signal.
Definition: Time.H:179
Foam::Time::New
static autoPtr< Time > New()
Construct dummy time, without functionObjects or libraries.
Definition: Time.C:710
Foam::scientific
IOstream & scientific(IOstream &io)
Definition: IOstream.H:447
Foam::clock
Read access to the system clock with formatting.
Definition: clock.H:52
Foam::TimePaths
Address the time paths without using the Time class.
Definition: TimePaths.H:56
Foam::Time::findInstance
word findInstance(const fileName &dir, const word &name=word::null, const IOobject::readOption rOpt=IOobject::MUST_READ, const word &stopInstance=word::null) const
Definition: Time.C:781
Foam::Time::writeTimeDict
virtual bool writeTimeDict() const
Write time dictionary to the <time>/uniform directory.
Definition: TimeIO.C:505
Foam::fileName::null
static const fileName null
An empty fileName.
Definition: fileName.H:97
Foam::Time::Time
Time(const word &ctrlDictName, const argList &args, const word &systemName="system", const word &constantName="constant")
Construct given name of dictionary to read and argument list.
Definition: Time.C:485
Foam::Time::wcNone
"none"
Definition: Time.H:86
Foam::Time::writeVersion
IOstream::versionNumber writeVersion() const
Default write version number.
Definition: Time.H:332
Foam::Time::setDeltaT
virtual void setDeltaT(const dimensionedScalar &deltaT, const bool adjust=true)
Reset time step, normally also calling adjustDeltaT()
Definition: Time.C:1049
Foam::Time::readDict
virtual void readDict()
Read the control dictionary and set the write controls etc.
Definition: TimeIO.C:89
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::Time::findInstancePath
word findInstancePath(const fileName &directory, const instant &t) const
Definition: Time.C:811
Foam::Time::readModifiedObjects
void readModifiedObjects()
Read the objects that have been modified.
Definition: TimeIO.C:459
Foam::profilingTrigger
Triggers for starting/stopping code profiling.
Definition: profilingTrigger.H:54
Foam::Time::printExecutionFormat_
static int printExecutionFormat_
Style for "ExecutionTime = " output.
Definition: Time.H:127
Foam::Time::libs
dlLibraryTable & libs()
External access to the loaded libraries.
Definition: Time.H:452
Foam::Time::saWriteNow
adjust endTime to stop immediately w/ writing
Definition: Time.H:101
Foam::Time::path
fileName path() const
Return path.
Definition: Time.H:303
Foam::sigWriteNow
Signal handler to write once and continue. The interrupt is defined by OptimisationSwitches::writeNow...
Definition: sigWriteNow.H:53
Foam::Time::wcRunTime
"runTime"
Definition: Time.H:88
Foam::Time::maxPrecision_
static const int maxPrecision_
Maximum time directory name precision.
Definition: Time.H:189
Foam::Time::setTime
virtual void setTime(const Time &t)
Reset the time and time-index to those of the given time.
Definition: Time.C:985
Foam::Time::writeInterval_
scalar writeInterval_
Definition: Time.H:159
dlLibraryTable.H
Foam::Time::fixed
fixed-point notation
Definition: Time.H:110
Foam::Time::writeNow
bool writeNow()
Definition: TimeIO.C:592
Foam::Time::format_
static fmtflags format_
Time directory name format.
Definition: Time.H:183
Foam::Time::scientific
scientific notation
Definition: Time.H:111
Foam::word::null
static const word null
An empty word.
Definition: word.H:77
Foam::Time::startTime_
scalar startTime_
Definition: Time.H:151
Foam::IOstreamOption::compressionType
compressionType
Compression treatment (UNCOMPRESSED | COMPRESSED)
Definition: IOstreamOption.H:71
Foam::Time::wcClockTime
"clockTime"
Definition: Time.H:90
Foam::Time::isAdjustTimeStep
virtual bool isAdjustTimeStep() const
Return true if adjustTimeStep is true.
Definition: Time.C:979
Foam::Time::stopAtControls
stopAtControls
Definition: Time.H:97
Foam::Time::endTime
virtual dimensionedScalar endTime() const
Return end time.
Definition: Time.C:857
Foam::instant
An instant of time. Contains the time value and name.
Definition: instant.H:52
Foam::Time::setMonitoring
void setMonitoring(const bool forceProfiling=false)
Set file monitoring, profiling, etc.
Definition: Time.C:347
Foam::IOobject::readOption
readOption
Enumeration defining the read options.
Definition: IOobject.H:118
Foam::Time::endSubCycle
virtual void endSubCycle()
Reset time after sub-cycling back to previous TimeState.
Definition: Time.C:1098
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::Time::graphFormat
const word & graphFormat() const
Default graph format.
Definition: Time.H:344
Foam::Time::endTime_
scalar endTime_
Definition: Time.H:153
Foam::Time::setControls
void setControls()
Set the controls from the current controlDict.
Definition: Time.C:145
Foam::FIFOStack
A FIFO stack based on a singly-linked list.
Definition: FIFOStack.H:51
Foam::IOstreamOption::compression
compressionType compression() const noexcept
Get the stream compression.
Definition: IOstreamOption.H:297
args
Foam::argList args(argc, argv)
Foam::Time::functionObjects
functionObjectList & functionObjects()
Return non-const access to the list of function objects.
Definition: Time.H:576
Foam::Time::writeControl_
writeControls writeControl_
Definition: Time.H:157
Foam::Time::run
virtual bool run() const
Return true if run should continue,.
Definition: Time.C:869
Foam::Time::startTime
virtual dimensionedScalar startTime() const
Return start time.
Definition: Time.C:851
Foam::Time::startTimeIndex
virtual label startTimeIndex() const
Return start time index.
Definition: Time.C:845
TimeState.H
Foam::Time::dbDir
virtual const fileName & dbDir() const
Local directory path of this objectRegistry relative to the time.
Definition: Time.H:314
Foam::Time::subCycleIndex
virtual void subCycleIndex(const label index)
Adjust the reported sub-cycle index.
Definition: Time.C:1085
unwatchedIOdictionary.H
Foam::IOobject::MUST_READ
Definition: IOobject.H:120
Foam::Time::runTimeModifiable
const Switch & runTimeModifiable() const
Supports re-reading.
Definition: Time.H:350
Enum.H