TimeIO.C
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-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 #include "Time.H"
30 #include "argList.H"
31 #include "Pstream.H"
32 #include "simpleObjectRegistry.H"
33 #include "dimensionedConstants.H"
34 #include "profiling.H"
35 #include "IOdictionary.H"
36 #include "fileOperation.H"
37 #include "fstreamPointer.H"
38 
39 #include <iomanip>
40 
41 // * * * * * * * * * * * * * * * Local Functions * * * * * * * * * * * * * * //
42 
43 namespace Foam
44 {
45 
46 // Output seconds as day-hh:mm:ss
47 static std::ostream& printTimeHMS(std::ostream& os, double seconds)
48 {
49  const unsigned long ss = seconds;
50 
51  // days
52  const auto dd = (ss / 86400);
53 
54  if (dd) os << dd << '-';
55 
56  // hours
57  const int hh = ((ss / 3600) % 24);
58 
59  if (dd || hh)
60  {
61  os << std::setw(2) << std::setfill('0')
62  << hh << ':';
63  }
64 
65  // minutes
66  os << std::setw(2) << std::setfill('0')
67  << ((ss / 60) % 60) << ':';
68 
69  // seconds
70  os << std::setw(2) << std::setfill('0')
71  << (ss % 60);
72 
73 
74  // 1/100th seconds. As none or 2 decimal places
75  const int hundredths = int(100 * (seconds - ss)) % 100;
76 
77  if (hundredths)
78  {
79  os << '.' << std::setw(2) << std::setfill('0') << hundredths;
80  }
81 
82  return os;
83 }
84 
85 } // End namespace Foam
86 
87 
88 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
89 
91 {
92  word application;
93  if (controlDict_.readIfPresent("application", application))
94  {
95  // Do not override if already set so external application can override
96  setEnv("FOAM_APPLICATION", application, false);
97  }
98 
99  // Check for local switches and settings
100 
101  const dictionary* localDict = nullptr;
102 
103  // DebugSwitches
104  if
105  (
106  (localDict = controlDict_.findDict("DebugSwitches")) != nullptr
107  && localDict->size()
108  )
109  {
110  DetailInfo
111  << "Overriding DebugSwitches according to "
112  << controlDict_.name() << nl;
113 
114  debug::debugObjects().setValues(*localDict, true);
115  }
116 
117 
118  // InfoSwitches
119  if
120  (
121  (localDict = controlDict_.findDict("InfoSwitches")) != nullptr
122  && localDict->size()
123  )
124  {
125  DetailInfo
126  << "Overriding InfoSwitches according to "
127  << controlDict_.name() << nl;
128 
129  debug::infoObjects().setValues(*localDict, true);
130  }
131 
132  // OptimisationSwitches
133  if
134  (
135  (localDict = controlDict_.findDict("OptimisationSwitches")) != nullptr
136  && localDict->size()
137  )
138  {
139  DetailInfo
140  << "Overriding OptimisationSwitches according to "
141  << controlDict_.name() << nl;
142 
143  debug::optimisationObjects().setValues(*localDict, true);
144  }
145 
146 
147  // Handle fileHandler explicitly since it affects local dictionary
148  // monitoring.
149  word fileHandlerName;
150  if
151  (
152  localDict
153  && localDict->readIfPresent("fileHandler", fileHandlerName)
154  && fileHandler().type() != fileHandlerName
155  )
156  {
157  DetailInfo << "Overriding fileHandler to " << fileHandlerName << nl;
158 
159  // Remove old watches since destroying the file
160  fileNameList oldWatched(controlDict_.watchIndices().size());
161  forAllReverse(controlDict_.watchIndices(), i)
162  {
163  const label watchi = controlDict_.watchIndices()[i];
164  oldWatched[i] = fileHandler().getFile(watchi);
165  fileHandler().removeWatch(watchi);
166  }
167  controlDict_.watchIndices().clear();
168 
169  // The new handler, with verbosity
170  autoPtr<fileOperation> newHandler =
171  fileOperation::New(fileHandlerName, true);
172 
173  if (TimePaths::distributed() && newHandler)
174  {
175  newHandler->distributed(true);
176  }
177 
178  // Installing the new handler
179  Foam::fileHandler(std::move(newHandler));
180 
181  // Reinstall old watches
182  fileHandler().addWatches(controlDict_, oldWatched);
183  }
184 
185 
186  // DimensionedConstants.
187  // - special case since it may change both the 'unitSet' and the
188  // individual values
189  if
190  (
191 
192  (localDict = controlDict_.findDict("DimensionedConstants")) != nullptr
193  && localDict->size()
194  )
195  {
196  DetailInfo
197  << "Overriding DimensionedConstants according to "
198  << controlDict_.name() << nl;
199 
201 
202  // Change in-memory
203  dimensionedConstants().merge(*localDict);
204 
205  IStringStream dummyIs("");
206 
207  forAllConstIters(objs, iter)
208  {
209  const List<simpleRegIOobject*>& objects = *iter;
210 
211  for (simpleRegIOobject* obj : objects)
212  {
213  obj->readData(dummyIs);
214 
215  if (Foam::infoDetailLevel > 0)
216  {
217  Info<< " ";
218  obj->writeData(Info);
219  Info<< nl;
220  }
221  }
222  }
223  }
224 
225 
226  // DimensionSets
227  if
228  (
229  (localDict = controlDict_.findDict("DimensionSets")) != nullptr
230  && localDict->size()
231  )
232  {
233  DetailInfo
234  << "Overriding DimensionSets according to "
235  << controlDict_.name() << nl;
236 
238 
240  dict.merge(*localDict);
241 
242  simpleObjectRegistryEntry* objPtr = objs.find("DimensionSets");
243 
244  if (objPtr)
245  {
246  DetailInfo << *localDict << nl;
247 
248  const List<simpleRegIOobject*>& objects = *objPtr;
249 
250  for (simpleRegIOobject* obj : objects)
251  {
253  os << dict;
254  IStringStream is(os.str());
255  obj->readData(is);
256  }
257  }
258  }
259 
260 
261  if (!deltaTchanged_)
262  {
263  controlDict_.readEntry("deltaT", deltaT_);
264  }
265 
267  (
268  "writeControl",
269  controlDict_,
271  );
272 
273  scalar oldWriteInterval = writeInterval_;
274 
275  if (controlDict_.readIfPresent("writeInterval", writeInterval_))
276  {
277  if (writeControl_ == wcTimeStep && label(writeInterval_) < 1)
278  {
279  FatalIOErrorInFunction(controlDict_)
280  << "writeInterval < 1 for writeControl timeStep"
281  << exit(FatalIOError);
282  }
283  }
284  else
285  {
286  controlDict_.readEntry("writeFrequency", writeInterval_);
287  }
288 
289 
290  if (oldWriteInterval != writeInterval_)
291  {
292  switch (writeControl_)
293  {
294  case wcRunTime:
295  case wcAdjustableRunTime:
296  // Recalculate writeTimeIndex_ to be in units of current
297  // writeInterval.
298  writeTimeIndex_ = label
299  (
301  * oldWriteInterval
303  );
304  break;
305 
306  default:
307  break;
308  }
309  }
310 
311  if (controlDict_.readIfPresent("purgeWrite", purgeWrite_))
312  {
313  if (purgeWrite_ < 0)
314  {
316  << "invalid value for purgeWrite " << purgeWrite_
317  << ", should be >= 0, setting to 0"
318  << endl;
319 
320  purgeWrite_ = 0;
321  }
322  }
323 
324  if (controlDict_.found("timeFormat"))
325  {
326  const word formatName(controlDict_.get<word>("timeFormat"));
327 
328  if (formatName == "general")
329  {
330  format_ = general;
331  }
332  else if (formatName == "fixed")
333  {
334  format_ = fixed;
335  }
336  else if (formatName == "scientific")
337  {
339  }
340  else
341  {
343  << "unsupported time format " << formatName
344  << endl;
345  }
346  }
347 
348  controlDict_.readIfPresent("timePrecision", precision_);
349 
350  // stopAt at 'endTime' or a specified value
351  // if nothing is specified, the endTime is zero
352  if (stopAtControlNames.readIfPresent("stopAt", controlDict_, stopAt_))
353  {
354  if (stopAt_ == saEndTime)
355  {
356  controlDict_.readEntry("endTime", endTime_);
357  }
358  else
359  {
360  endTime_ = GREAT;
361  }
362  }
363  else if (!controlDict_.readIfPresent("endTime", endTime_))
364  {
365  endTime_ = 0;
366  }
367 
369 
370  if (controlDict_.found("writeVersion"))
371  {
372  writeStreamOption_.version(controlDict_.get<token>("writeVersion"));
373  }
374 
375  if (controlDict_.found("writeFormat"))
376  {
377  writeStreamOption_.format(controlDict_.get<word>("writeFormat"));
378  }
379 
380  if (controlDict_.found("writePrecision"))
381  {
383  (
384  controlDict_.get<unsigned int>("writePrecision")
385  );
386 
389 
392 
395  }
396 
397  if (controlDict_.found("writeCompression"))
398  {
399  writeStreamOption_.compression
400  (
401  controlDict_.get<word>("writeCompression")
402  );
403 
404  if (writeStreamOption_.compression() == IOstreamOption::COMPRESSED)
405  {
406  if (writeStreamOption_.format() == IOstreamOption::BINARY)
407  {
408  IOWarningInFunction(controlDict_)
409  << "Disabled binary format compression"
410  << " (inefficient/ineffective)"
411  << endl;
412 
413  writeStreamOption_.compression(IOstreamOption::UNCOMPRESSED);
414  }
415  else if (!ofstreamPointer::supports_gz())
416  {
417  IOWarningInFunction(controlDict_)
418  << "Disabled output compression"
419  << " (missing libz support)"
420  << endl;
421 
422  writeStreamOption_.compression(IOstreamOption::UNCOMPRESSED);
423  }
424  }
425  }
426 
427  controlDict_.readIfPresent("graphFormat", graphFormat_);
428  controlDict_.readIfPresent("runTimeModifiable", runTimeModifiable_);
429 
430 
431  if (!runTimeModifiable_ && controlDict_.watchIndices().size())
432  {
433  forAllReverse(controlDict_.watchIndices(), i)
434  {
435  fileHandler().removeWatch(controlDict_.watchIndices()[i]);
436  }
437  controlDict_.watchIndices().clear();
438  }
439 }
440 
441 
443 {
444  if (controlDict_.regIOobject::read())
445  {
446  // Read contents
447  readDict();
448  functionObjects_.read();
449 
450  if (runTimeModifiable_)
451  {
452  // For IOdictionary the call to regIOobject::read() would have
453  // already updated all the watchIndices via the addWatch but
454  // controlDict_ is an unwatchedIOdictionary so will only have
455  // stored the dependencies as files.
456  fileHandler().addWatches(controlDict_, controlDict_.files());
457  }
458  controlDict_.files().clear();
459 
460  return true;
461  }
462 
463  return false;
464 }
465 
466 
468 {
469  if (runTimeModifiable_)
470  {
471  // Get state of all monitored objects (=registered objects with a
472  // valid filePath).
473  // Note: requires same ordering in objectRegistries on different
474  // processors!
476  (
477  (
480  ),
482  );
483  // Time handling is special since controlDict_ is the one dictionary
484  // that is not registered to any database.
485 
486  if (controlDict_.readIfModified())
487  {
488  readDict();
489  functionObjects_.read();
490 
491  if (runTimeModifiable_)
492  {
493  // For IOdictionary the call to regIOobject::read() would have
494  // already updated all the watchIndices via the addWatch but
495  // controlDict_ is an unwatchedIOdictionary so will only have
496  // stored the dependencies as files.
497 
498  fileHandler().addWatches(controlDict_, controlDict_.files());
499  }
500  controlDict_.files().clear();
501  }
502 
503  bool registryModified = objectRegistry::modified();
504 
505  if (registryModified)
506  {
508  }
509  }
510 }
511 
512 
514 {
515  addProfiling(writing, "objectRegistry::writeObject");
516 
517  const word tmName(timeName());
518 
519  IOdictionary timeDict
520  (
521  IOobject
522  (
523  "time",
524  tmName,
525  "uniform",
526  *this,
529  false
530  )
531  );
532 
533  timeDict.add("value", timeName(timeToUserTime(value()), maxPrecision_));
534  timeDict.add("name", string(tmName));
535  timeDict.add("index", timeIndex_);
536  timeDict.add("deltaT", timeToUserTime(deltaT_));
537  timeDict.add("deltaT0", timeToUserTime(deltaT0_));
538 
539  return timeDict.regIOobject::writeObject
540  (
542  true
543  );
544 }
545 
546 
548 (
549  IOstreamOption streamOpt,
550  const bool valid
551 ) const
552 {
553  if (writeTime())
554  {
555  bool writeOK = writeTimeDict();
556 
557  if (writeOK)
558  {
559  writeOK = objectRegistry::writeObject(streamOpt, valid);
560  }
561 
562  if (writeOK)
563  {
564  // Does the writeTime trigger purging?
565  if (writeTime_ && purgeWrite_)
566  {
567  if
568  (
569  previousWriteTimes_.empty()
570  || previousWriteTimes_.top() != timeName()
571  )
572  {
573  previousWriteTimes_.push(timeName());
574  }
575 
576  while (previousWriteTimes_.size() > purgeWrite_)
577  {
579  (
580  fileHandler().filePath
581  (
582  objectRegistry::path(previousWriteTimes_.pop())
583  )
584  );
585  }
586  }
587  }
588 
589  return writeOK;
590  }
591 
592  return false;
593 }
594 
595 
597 {
598  writeTime_ = true;
599  return write();
600 }
601 
602 
604 {
605  stopAt_ = saWriteNow;
606  endTime_ = value();
607 
608  return writeNow();
609 }
610 
611 
613 {
614  writeOnce_ = true;
615 }
616 
617 
619 {
620  switch (printExecutionFormat_)
621  {
622  case 1:
623  {
624  os << "ExecutionTime = ";
625  printTimeHMS(os.stdStream(), elapsedCpuTime());
626 
627  os << " ClockTime = ";
628  printTimeHMS(os.stdStream(), elapsedClockTime());
629  }
630  break;
631 
632  default:
633  {
634  os << "ExecutionTime = " << elapsedCpuTime() << " s"
635  << " ClockTime = " << elapsedClockTime() << " s";
636  }
637  break;
638  }
639 
640  os << nl << endl;
641 
642  return os;
643 }
644 
645 
646 // ************************************************************************* //
Foam::fileOperation::type
virtual fileName::Type type(const fileName &, const bool followLink=true) const =0
Return the file type: DIRECTORY, FILE or LINK.
Foam::IOstreamOption::UNCOMPRESSED
compression = false
Definition: IOstreamOption.H:79
Foam::dictionary::findDict
dictionary * findDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX)
Find and return a sub-dictionary pointer if present.
Definition: dictionaryI.H:127
Foam::IOobject::NO_WRITE
Definition: IOobject.H:195
Foam::Time::general
default float notation
Definition: Time.H:109
profiling.H
Foam::IOdictionary
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
Definition: IOdictionary.H:54
Foam::IOobject
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition: IOobject.H:169
Foam::ofstreamPointer::supports_gz
static bool supports_gz()
True if compiled with libz support.
Definition: fstreamPointers.C:83
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::simpleObjectRegistry::setValues
void setValues(const dictionary &dict, bool report=false)
Set values (invoke callbacks) from dictionary entries.
Definition: simpleObjectRegistry.C:38
Foam::fileOperation::addWatches
virtual void addWatches(regIOobject &, const fileNameList &) const
Helper: add watches for list of regIOobjects.
Definition: fileOperation.C:881
Foam::Time::purgeWrite_
label purgeWrite_
Definition: Time.H:161
Foam::regIOobject::watchIndices
const labelList & watchIndices() const
Return file-monitoring handles.
Definition: regIOobjectI.H:196
Foam::dictionary::found
bool found(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Search for an entry (const access) with the given keyword.
Definition: dictionaryI.H:87
Foam::Time::writeControlNames
static const Enum< writeControls > writeControlNames
Names for writeControls.
Definition: Time.H:116
Foam::IOobject::inotifyMaster
Definition: IOobject.H:204
Foam::IOobject::timeStampMaster
Definition: IOobject.H:202
Foam::IOobject::fileModificationChecking
static fileCheckTypes fileModificationChecking
Type of file modification checking.
Definition: IOobject.H:303
Foam::IOstreamOption::format
streamFormat format() const noexcept
Get the current stream format.
Definition: IOstreamOption.H:286
simpleObjectRegistry.H
Foam::dimensioned::name
const word & name() const
Return const reference to name.
Definition: dimensionedType.C:406
Foam::fileHandler
const fileOperation & fileHandler()
Get current file handler.
Definition: fileOperation.C:1485
Foam::FatalIOError
IOerror FatalIOError
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:369
Foam::token
A token holds an item read from Istream.
Definition: token.H:68
Foam::setEnv
bool setEnv(const word &name, const std::string &value, const bool overwrite)
Set an environment variable, return true on success.
Definition: MSwindows.C:395
Foam::dimensioned::value
const Type & value() const
Return const reference to value.
Definition: dimensionedType.C:434
Foam::Serr
OSstream Serr
OSstream wrapped stderr (std::cerr)
Foam::dictionary::get
T get(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Definition: dictionaryTemplates.C:107
Foam::Pout
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
Foam::baseIOdictionary::name
const word & name() const
Definition: baseIOdictionary.C:85
Foam::Time::writeOnce
void writeOnce()
Write the objects once (one shot) and continue the run.
Definition: TimeIO.C:612
Foam::fileOperation::updateStates
virtual void updateStates(const bool masterOnly, const bool syncPar) const
Update state of all files.
Definition: fileOperation.C:924
Foam::Time::read
virtual bool read()
Read control dictionary, update controls and time.
Definition: TimeIO.C:442
Foam::fileOperation::getFile
virtual fileName getFile(const label) const
Get name of file being watched (using handle)
Definition: fileOperation.C:917
Foam::Time::writeAndEnd
bool writeAndEnd()
Write the objects now (not at end of iteration) and end the run.
Definition: TimeIO.C:603
Foam::Time::wcTimeStep
"timeStep"
Definition: Time.H:87
Foam::TimePaths::distributed
bool distributed() const noexcept
Definition: TimePathsI.H:30
Foam::Time::saEndTime
Stop when Time reaches prescribed endTime.
Definition: Time.H:99
Foam::fileOperation::New
static autoPtr< fileOperation > New(const word &handlerType, bool verbose=false)
Select fileHandler-type.
Definition: fileOperation.C:706
Foam::Time::printExecutionTime
Ostream & printExecutionTime(OSstream &os) const
Print the elapsed ExecutionTime (cpu-time), ClockTime.
Definition: TimeIO.C:618
Foam::dictionary::merge
bool merge(const dictionary &dict)
Merge entries from the given dictionary.
Definition: dictionary.C:812
Foam::Time::stopAtControlNames
static const Enum< stopAtControls > stopAtControlNames
Names for stopAtControls.
Definition: Time.H:119
Foam::simpleObjectRegistryEntry
Definition: simpleObjectRegistry.H:56
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:790
Foam::debug::optimisationObjects
simpleObjectRegistry & optimisationObjects()
Access to registered OptimisationSwitch objects.
Definition: debug.C:313
Foam::Info
messageStream Info
Information stream (stdout output on master, null elsewhere)
Foam::debug::debugObjects
simpleObjectRegistry & debugObjects()
Access to registered DebugSwitch objects.
Definition: debug.C:291
Foam::dimensionSystems
dictionary & dimensionSystems()
Top level dictionary.
Definition: dimensionSets.C:93
argList.H
Foam::TimeState::writeTimeIndex_
label writeTimeIndex_
Definition: TimeState.H:58
Foam::IOstreamOption
The IOstreamOption is a simple container for options an IOstream can normally have.
Definition: IOstreamOption.H:63
Foam::Time::writeObject
virtual bool writeObject(IOstreamOption streamOpt, const bool valid) const
Write using stream options.
Definition: TimeIO.C:548
Foam::dimensionedConstants
dictionary & dimensionedConstants()
Definition: dimensionedConstants.C:41
Foam::dictionary::readEntry
bool readEntry(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX, bool mandatory=true) const
Definition: dictionaryTemplates.C:302
Foam::OSstream
Generic output stream using a standard (STL) stream.
Definition: OSstream.H:54
Foam::fileOperation::rmDir
virtual bool rmDir(const fileName &dir, const bool silent=false) const =0
Remove a directory and its contents.
Foam::debug::dimensionSetObjects
simpleObjectRegistry & dimensionSetObjects()
Access to registered DimensionSets objects.
Definition: debug.C:324
DetailInfo
#define DetailInfo
Definition: evalEntry.C:37
Foam::IOstreamOption::version
versionNumber version() const noexcept
Get the stream version.
Definition: IOstreamOption.H:338
Foam::Time::stopAt_
stopAtControls stopAt_
Definition: Time.H:155
timeName
word timeName
Definition: getTimeIndex.H:3
dict
dictionary dict
Definition: searchingEngine.H:14
fstreamPointer.H
addProfiling
#define addProfiling(name, descr)
Define profiling trigger with specified name and description string.
Definition: profilingTrigger.H:113
Foam::objectRegistry::writeObject
virtual bool writeObject(IOstreamOption streamOpt, const bool valid) const
Write the objects using stream options.
Definition: objectRegistry.C:479
Foam::FatalError
error FatalError
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam::debug::infoObjects
simpleObjectRegistry & infoObjects()
Access to registered InfoSwitch objects.
Definition: debug.C:302
os
OBJstream os(runTime.globalPath()/outputName)
fileOperation.H
Pstream.H
Foam::debug::dimensionedConstantObjects
simpleObjectRegistry & dimensionedConstantObjects()
Access to registered DimensionedConstants objects.
Definition: debug.C:335
Foam::Time::wcAdjustableRunTime
"adjustable" / "adjustableRunTime"
Definition: Time.H:89
Foam::IStringStream
Input from string buffer, using a ISstream. Always UNCOMPRESSED.
Definition: StringStream.H:108
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::setw
Omanip< int > setw(const int i)
Definition: IOmanip.H:199
Foam::DictionaryBase::find
T * find(const word &keyword)
Find and return an entry, nullptr on failure.
Definition: DictionaryBase.C:114
Foam::Time::writeTimeDict
virtual bool writeTimeDict() const
Write time dictionary to the <time>/uniform directory.
Definition: TimeIO.C:513
Foam::infoDetailLevel
int infoDetailLevel
Global for selective suppression of Info output.
Foam::exit
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:130
Foam::fileOperation::removeWatch
virtual bool removeWatch(const label) const
Remove watch on a file (using handle)
Definition: fileOperation.C:857
Foam::objectRegistry::modified
virtual bool modified() const
Return true if any of the object's files have been modified.
Definition: objectRegistry.C:441
Foam::objectRegistry::readModifiedObjects
void readModifiedObjects()
Read the objects that have been modified.
Definition: objectRegistry.C:455
Foam::Perr
prefixOSstream Perr
OSstream wrapped stderr (std::cerr) with parallel prefix.
Foam::OSstream::precision
virtual int precision() const
Get precision of output field.
Definition: OSstream.C:326
Foam::Time::readDict
virtual void readDict()
Read the control dictionary and set the write controls etc.
Definition: TimeIO.C:90
Foam::IOstream::defaultPrecision
static unsigned int defaultPrecision() noexcept
Return the default precision.
Definition: IOstream.H:342
IOdictionary.H
Time.H
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::IOstreamOption::BINARY
"binary"
Definition: IOstreamOption.H:73
Foam::Time::readModifiedObjects
void readModifiedObjects()
Read the objects that have been modified.
Definition: TimeIO.C:467
Foam::IOstreamOption::ASCII
"ascii" (normal default)
Definition: IOstreamOption.H:72
Foam::IOstreamOption::COMPRESSED
compression = true
Definition: IOstreamOption.H:80
Foam::nl
constexpr char nl
Definition: Ostream.H:404
Foam::error::stream
OSstream & stream()
Return OSstream for output operations.
Definition: error.C:304
forAllConstIters
forAllConstIters(mixture.phases(), phase)
Definition: pEqn.H:28
Foam::OFstream::stdStream
virtual std::ostream & stdStream()
Access to underlying std::ostream.
Definition: OFstream.C:102
Foam::UPstream::parRun
static bool & parRun() noexcept
Test if this a parallel run.
Definition: UPstream.H:433
Foam::List< fileName >
Foam::Time::wcRunTime
"runTime"
Definition: Time.H:88
Foam::OStringStream
Output to string buffer, using a OSstream. Always UNCOMPRESSED.
Definition: StringStream.H:227
Foam::setfill
Omanip< char > setfill(char fillch)
Definition: IOmanip.H:175
Foam::Time::writeInterval_
scalar writeInterval_
Definition: Time.H:159
Foam::Time::fixed
fixed-point notation
Definition: Time.H:110
Foam::Time::writeNow
bool writeNow()
Definition: TimeIO.C:596
Foam::Time::format_
static fmtflags format_
Time directory name format.
Definition: Time.H:183
Foam::List::clear
void clear()
Clear the list, i.e. set size to zero.
Definition: ListI.H:116
Foam::Time::scientific
scientific notation
Definition: Time.H:111
Foam::Enum::readIfPresent
bool readIfPresent(const word &key, const dictionary &dict, EnumType &val) const
Find an entry if present, and assign to T val.
Definition: EnumI.H:132
Foam::vtk::write
void write(vtk::formatter &fmt, const Type &val, const label n=1)
Component-wise write of a value (N times)
Definition: foamVtkOutputTemplates.C:36
forAllReverse
#define forAllReverse(list, i)
Reverse loop across all elements in list.
Definition: stdFoam.H:309
Foam::dictionary::add
entry * add(entry *entryPtr, bool mergeEntry=false)
Add a new entry.
Definition: dictionary.C:640
FatalIOErrorInFunction
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
Definition: error.H:473
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::Time::endTime_
scalar endTime_
Definition: Time.H:153
IOWarningInFunction
#define IOWarningInFunction(ios)
Report an IO warning using Foam::Warning.
Definition: messageStream.H:340
Foam::Sout
OSstream Sout
OSstream wrapped stdout (std::cout)
Foam::IOstreamOption::compression
compressionType compression() const noexcept
Get the stream compression.
Definition: IOstreamOption.H:312
Foam::IOobject::NO_READ
Definition: IOobject.H:188
Foam::IOobject::path
fileName path() const
The complete path.
Definition: IOobject.C:511
Foam::Time::writeControl_
writeControls writeControl_
Definition: Time.H:157
Foam::TimeState::deltaT_
scalar deltaT_
Definition: TimeState.H:60
WarningInFunction
#define WarningInFunction
Report a warning using Foam::Warning.
Definition: messageStream.H:328
Foam::TimeState::deltaTchanged_
bool deltaTchanged_
Definition: TimeState.H:64
Foam::simpleRegIOobject
Abstract base class for registered object with I/O. Used in debug symbol registration.
Definition: simpleRegIOobject.H:52
Foam::dictionary::readIfPresent
bool readIfPresent(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX) const
Definition: dictionaryTemplates.C:405
Foam::printTimeHMS
static std::ostream & printTimeHMS(std::ostream &os, double seconds)
Definition: TimeIO.C:47
dimensionedConstants.H
Dictionary reading and supplying the dimensioned constants used within OpenFOAM, particularly for the...
Foam::simpleObjectRegistry
Object registry for simpleRegIOobject. Maintains ordering.
Definition: simpleObjectRegistry.H:81