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