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-2024 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 #include "Field.H" // Ugly handling of localBoundaryConsistency switches
39 
40 #include <iomanip>
41 
42 // * * * * * * * * * * * * * * * Local Functions * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 
47 // Output seconds as day-hh:mm:ss
48 static std::ostream& printTimeHMS(std::ostream& os, double seconds)
49 {
50  const unsigned long ss = seconds;
51 
52  // days
53  const auto dd = (ss / 86400);
54 
55  if (dd) os << dd << '-';
56 
57  // hours
58  const int hh = ((ss / 3600) % 24);
59 
60  if (dd || hh)
61  {
62  os << std::setw(2) << std::setfill('0')
63  << hh << ':';
64  }
65 
66  // minutes
67  os << std::setw(2) << std::setfill('0')
68  << ((ss / 60) % 60) << ':';
69 
70  // seconds
71  os << std::setw(2) << std::setfill('0')
72  << (ss % 60);
73 
74 
75  // 1/100th seconds. As none or 2 decimal places
76  const int hundredths = int(100 * (seconds - ss)) % 100;
77 
78  if (hundredths)
79  {
80  os << '.' << std::setw(2) << std::setfill('0') << hundredths;
81  }
82 
83  return os;
84 }
85 
86 } // End namespace Foam
87 
88 
89 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
90 
92 {
93  word application;
94  if (controlDict_.readIfPresent("application", application))
95  {
96  // Do not override if already set so external application can override
97  setEnv("FOAM_APPLICATION", application, false);
98  }
99 
100  // Check for local switches and settings
101 
102  const dictionary* localDict = nullptr;
103 
104  // DebugSwitches
105  if
106  (
107  (localDict = controlDict_.findDict("DebugSwitches")) != nullptr
108  && localDict->size()
109  )
110  {
111  DetailInfo
112  << "Overriding DebugSwitches according to "
113  << controlDict_.name() << nl;
114 
115  debug::debugObjects().setValues(*localDict, true);
116  }
117 
118 
119  // InfoSwitches
120  if
121  (
122  (localDict = controlDict_.findDict("InfoSwitches")) != nullptr
123  && localDict->size()
124  )
125  {
126  DetailInfo
127  << "Overriding InfoSwitches according to "
128  << controlDict_.name() << nl;
129 
130  debug::infoObjects().setValues(*localDict, true);
131  }
132 
133  // OptimisationSwitches
134  if
135  (
136  (localDict = controlDict_.findDict("OptimisationSwitches")) != nullptr
137  && localDict->size()
138  )
139  {
140  DetailInfo
141  << "Overriding OptimisationSwitches according to "
142  << controlDict_.name() << nl;
143 
144  debug::optimisationObjects().setValues(*localDict, true);
145 
146  // Ugly handling of localBoundaryConsistency switches
148  }
149 
150 
151  // Handle fileHandler explicitly since it affects local dictionary
152  // monitoring.
153  word fileHandlerName;
154  if
155  (
156  localDict
157  && localDict->readIfPresent("fileHandler", fileHandlerName)
158  && fileHandler().type() != fileHandlerName
159  )
160  {
161  DetailInfo << "Overriding fileHandler to " << fileHandlerName << nl;
162 
163  // Remove old watches since destroying the file
164  fileNameList oldWatched(controlDict_.watchIndices().size());
165  forAllReverse(controlDict_.watchIndices(), i)
166  {
167  const label watchi = controlDict_.watchIndices()[i];
168  oldWatched[i] = fileHandler().getFile(watchi);
169  fileHandler().removeWatch(watchi);
170  }
171  controlDict_.watchIndices().clear();
172 
173  // Reporting verbosity corresponding to detail level
174  const bool verbose = (::Foam::infoDetailLevel > 0);
175 
176  // The new handler
177  refPtr<fileOperation> newHandler
178  (
179  fileOperation::New(fileHandlerName, verbose)
180  );
181 
182  // Install the new handler
183  (void) fileOperation::fileHandler(newHandler);
184 
186  {
187  newHandler->distributed(true);
188  }
189 
190  // Reinstall old watches
191  fileHandler().addWatches(controlDict_, oldWatched);
192  }
193 
194 
195  // DimensionedConstants.
196  // - special case since it may change both the 'unitSet' and the
197  // individual values
198  if
199  (
200 
201  (localDict = controlDict_.findDict("DimensionedConstants")) != nullptr
202  && localDict->size()
203  )
204  {
205  DetailInfo
206  << "Overriding DimensionedConstants according to "
207  << controlDict_.name() << nl;
208 
209  simpleObjectRegistry& objs = debug::dimensionedConstantObjects();
210 
211  // Change in-memory
212  dimensionedConstants().merge(*localDict);
213 
214  ISpanStream dummyIs;
215 
216  // Reporting verbosity corresponding to detail level
217  const bool verbose = (::Foam::infoDetailLevel > 0);
218 
219  forAllConstIters(objs, iter)
220  {
221  const List<simpleRegIOobject*>& objects = *iter;
222 
223  for (simpleRegIOobject* obj : objects)
224  {
225  obj->readData(dummyIs);
226 
227  if (verbose)
228  {
229  Info<< " ";
230  obj->writeData(Info);
231  Info<< nl;
232  }
233  }
234  }
235  }
236 
237 
238  // DimensionSets
239  if
240  (
241  (localDict = controlDict_.findDict("DimensionSets")) != nullptr
242  && localDict->size()
243  )
244  {
245  DetailInfo
246  << "Overriding DimensionSets according to "
247  << controlDict_.name() << nl;
248 
249  simpleObjectRegistry& objs = debug::dimensionSetObjects();
250 
252  dict.merge(*localDict);
253 
254  simpleObjectRegistryEntry* objPtr = objs.find("DimensionSets");
255 
256  if (objPtr)
257  {
258  DetailInfo << *localDict << nl;
259 
260  const List<simpleRegIOobject*>& objects = *objPtr;
261 
262  OCharStream os;
263 
264  for (simpleRegIOobject* obj : objects)
265  {
266  os.rewind();
267  os << dict;
268 
269  ISpanStream is(os.view());
270  obj->readData(is);
271  }
272  }
273  }
274 
275 
276  if (!deltaTchanged_)
277  {
278  controlDict_.readEntry("deltaT", deltaT_);
279  }
280 
282  (
283  "writeControl",
284  controlDict_,
286  );
287 
288  scalar oldWriteInterval = writeInterval_;
289 
290  if (controlDict_.readIfPresent("writeInterval", writeInterval_))
291  {
292  if (writeControl_ == wcTimeStep && label(writeInterval_) < 1)
293  {
294  FatalIOErrorInFunction(controlDict_)
295  << "writeInterval < 1 for writeControl timeStep"
296  << exit(FatalIOError);
297  }
298  }
299  else
300  {
301  controlDict_.readEntry("writeFrequency", writeInterval_);
302  }
303 
304 
305  if (oldWriteInterval != writeInterval_)
306  {
307  switch (writeControl_)
308  {
309  case wcRunTime:
310  case wcAdjustableRunTime:
311  // Recalculate writeTimeIndex_ to be in units of current
312  // writeInterval.
313  writeTimeIndex_ = label
314  (
316  * oldWriteInterval
318  );
319  break;
320 
321  default:
322  break;
323  }
324  }
325 
326  if (controlDict_.readIfPresent("purgeWrite", purgeWrite_))
327  {
328  if (purgeWrite_ < 0)
329  {
331  << "invalid value for purgeWrite " << purgeWrite_
332  << ", should be >= 0, setting to 0"
333  << endl;
334 
335  purgeWrite_ = 0;
336  }
337  }
338 
339  format_ =
340  IOstreamOption::floatFormatEnum("timeFormat", controlDict_, format_);
341 
342  controlDict_.readIfPresent("timePrecision", precision_);
343 
344  // stopAt at 'endTime' or a specified value
345  // if nothing is specified, the endTime is zero
346  if (stopAtControlNames.readIfPresent("stopAt", controlDict_, stopAt_))
347  {
348  if (stopAt_ == saEndTime)
349  {
350  controlDict_.readEntry("endTime", endTime_);
351  }
352  else
353  {
354  endTime_ = GREAT;
355  }
356  }
357  else if (!controlDict_.readIfPresent("endTime", endTime_))
358  {
359  endTime_ = 0;
360  }
361 
362  // Adjust the TimeState name
364 
365  // Specifying the write version doesn't make sense (2023-10)
366  if (controlDict_.found("writeVersion"))
367  {
368  writeStreamOption_.version(controlDict_.get<token>("writeVersion"));
369  }
370 
371  // FUTURE? optional control to support command-line option to
372  // set the write format and ignore this dictionary entry.
373 
374  if (controlDict_.found("writeFormat"))
375  {
376  writeStreamOption_.format(controlDict_.get<word>("writeFormat"));
377  }
378 
379  if (controlDict_.found("writePrecision"))
380  {
382  (
383  controlDict_.get<unsigned int>("writePrecision")
384  );
385 
388 
391 
394  }
395 
396  if (controlDict_.found("writeCompression"))
397  {
398  writeStreamOption_.compression
399  (
400  controlDict_.get<word>("writeCompression")
401  );
402 
403  if (writeStreamOption_.compression() == IOstreamOption::COMPRESSED)
404  {
405  if (writeStreamOption_.format() != IOstreamOption::ASCII)
406  {
407  IOWarningInFunction(controlDict_)
408  << "Disabled output compression for non-ascii format"
409  << " (inefficient/ineffective)"
410  << endl;
411 
412  writeStreamOption_.compression(IOstreamOption::UNCOMPRESSED);
413  }
414  else if (!ofstreamPointer::supports_gz())
415  {
416  IOWarningInFunction(controlDict_)
417  << "Disabled output compression"
418  << " (missing libz support)"
419  << endl;
420 
421  writeStreamOption_.compression(IOstreamOption::UNCOMPRESSED);
422  }
423  }
424  }
425 
426  controlDict_.readIfPresent("graphFormat", graphFormat_);
427  controlDict_.readIfPresent("runTimeModifiable", runTimeModifiable_);
428 
429 
430  if (!runTimeModifiable_ && controlDict_.watchIndices().size())
431  {
432  forAllReverse(controlDict_.watchIndices(), i)
433  {
434  fileHandler().removeWatch(controlDict_.watchIndices()[i]);
435  }
436  controlDict_.watchIndices().clear();
437  }
438 }
439 
440 
441 bool Foam::Time::read()
442 {
443  if (controlDict_.regIOobject::read())
444  {
445  // Read contents
446  readDict();
447  functionObjects_.read();
448 
449  if (runTimeModifiable_)
450  {
451  // For IOdictionary the call to regIOobject::read() would have
452  // already updated all the watchIndices via the addWatch but
453  // controlDict_ is an unwatchedIOdictionary so will only have
454  // stored the dependencies as files.
455  fileHandler().addWatches(controlDict_, controlDict_.files());
456  }
457  controlDict_.files().clear();
458 
459  return true;
460  }
461 
462  return false;
463 }
464 
465 
467 {
468  if (runTimeModifiable_)
469  {
470  // Get state of all monitored objects (=registered objects with a
471  // valid filePath).
472  // Note: requires same ordering in objectRegistries on different
473  // processors!
474  fileHandler().updateStates
475  (
476  (
479  ),
481  );
482  // Time handling is special since controlDict_ is the one dictionary
483  // that is not registered to any database.
484 
485  if (controlDict_.readIfModified())
486  {
487  readDict();
488  functionObjects_.read();
489 
490  if (runTimeModifiable_)
491  {
492  // For IOdictionary the call to regIOobject::read() would have
493  // already updated all the watchIndices via the addWatch but
494  // controlDict_ is an unwatchedIOdictionary so will only have
495  // stored the dependencies as files.
496 
497  fileHandler().addWatches(controlDict_, controlDict_.files());
498  }
499  controlDict_.files().clear();
500  }
501 
502  bool registryModified = objectRegistry::modified();
503 
504  if (registryModified)
505  {
507  }
508  }
509 }
510 
511 
512 bool Foam::Time::writeTimeDict() const
513 {
514  addProfiling(writing, "objectRegistry::writeObject");
515 
516  const word tmName(timeName());
517 
518  IOdictionary timeDict
519  (
520  IOobject
521  (
522  "time",
523  tmName,
524  "uniform",
525  *this,
529  )
530  );
531 
532  timeDict.add("value", timeName(timeToUserTime(value()), maxPrecision_));
533  timeDict.add("name", string(tmName));
534  timeDict.add("index", timeIndex_);
535  timeDict.add("deltaT", timeToUserTime(deltaT_));
536  timeDict.add("deltaT0", timeToUserTime(deltaT0_));
537 
538  return timeDict.regIOobject::writeObject
539  (
541  true
542  );
543 }
544 
545 
547 (
548  IOstreamOption streamOpt,
549  const bool writeOnProc
550 ) const
551 {
552  if (writeTime())
553  {
554  bool writeOK = writeTimeDict();
555 
556  if (writeOK)
557  {
558  writeOK = objectRegistry::writeObject(streamOpt, writeOnProc);
559  }
560 
561  if (writeOK)
562  {
563  // Does the writeTime trigger purging?
564  if (writeTime_ && purgeWrite_)
565  {
566  if
567  (
568  previousWriteTimes_.empty()
569  || previousWriteTimes_.top() != timeName()
570  )
571  {
572  previousWriteTimes_.push(timeName());
573  }
574 
575  while (previousWriteTimes_.size() > purgeWrite_)
576  {
577  fileHandler().rmDir
578  (
579  fileHandler().filePath
580  (
581  objectRegistry::path(previousWriteTimes_.pop()),
582  false // No .gz check (is directory)
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 
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 // ************************************************************************* //
Omanip< char > setfill(char fillch)
Definition: IOmanip.H:175
prefixOSstream Perr
OSstream wrapped stderr (std::cerr) with parallel prefix.
Generic output stream using a standard (STL) stream.
Definition: OSstream.H:50
const scalar & value() const noexcept
Return const reference to value.
dictionary dict
void size(const label n)
Older name for setAddressableSize.
Definition: UList.H:114
scalar deltaT_
Definition: TimeState.H:67
bool writeAndEnd()
Write the objects now (not at end of iteration) and end the run.
Definition: TimeIO.C:596
stopAtControls stopAt_
Definition: Time.H:160
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:125
void readModifiedObjects()
Read the objects that have been modified.
Dictionary reading and supplying the dimensioned constants used within OpenFOAM, particularly for the...
error FatalError
Error stream (stdout output on all processes), with additional &#39;FOAM FATAL ERROR&#39; header text and sta...
scalar writeInterval_
Definition: Time.H:164
bool readIfPresent(const word &key, const dictionary &dict, EnumType &val, const bool warnOnly=false) const
Find an entry if present, and assign to T val.
Definition: EnumI.H:111
int infoDetailLevel
Global for selective suppression of Info output.
void setValues(const dictionary &dict, bool verbose=false, bool dryrun=false)
Set values (invoke callbacks) from dictionary entries.
constexpr char nl
The newline &#39;\n&#39; character (0x0a)
Definition: Ostream.H:50
static bool supports_gz() noexcept
True if compiled with libz support.
"ascii" (normal default)
static std::ostream & printTimeHMS(std::ostream &os, double seconds)
Definition: TimeIO.C:41
virtual bool modified() const
Return true if any of the object&#39;s files have been modified.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:529
static bool & parRun() noexcept
Test if this a parallel run.
Definition: UPstream.H:1586
#define addProfiling(Name,...)
Define profiling trigger with specified name and description string. The description is generated by ...
static unsigned int defaultPrecision() noexcept
Return the default precision.
Definition: IOstream.H:418
refPtr< fileOperation > fileHandler(std::nullptr_t)
Delete current file handler - forwards to fileOperation::handler()
static const Enum< stopAtControls > stopAtControlNames
Names for stopAtControls.
Definition: Time.H:114
A simple container for options an IOstream can normally have.
Ignore writing from objectRegistry::writeObject()
simpleObjectRegistry & debugObjects()
Access to registered DebugSwitch objects.
Definition: debug.C:288
T get(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a T. FatalIOError if not found, or if the number of tokens is incorrect.
writeControls writeControl_
Definition: Time.H:162
const word & timeName() const noexcept
Return the current time name.
Definition: TimeStateI.H:30
"runTime"
Definition: Time.H:86
label writeTimeIndex_
Definition: TimeState.H:65
simpleObjectRegistry & optimisationObjects()
Access to registered OptimisationSwitch objects.
Definition: debug.C:310
fileName path() const
The complete path for the object (with instance, local,...).
Definition: IOobject.C:480
bool found(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find an entry (const access) with the given keyword.
Definition: dictionaryI.H:104
dictionary & dimensionedConstants()
virtual bool writeObject(IOstreamOption streamOpt, const bool writeOnProc) const
Write using stream options.
Definition: TimeIO.C:540
virtual bool writeTimeDict() const
Write time dictionary to the <time>/uniform directory.
Definition: TimeIO.C:505
virtual bool writeObject(IOstreamOption streamOpt, const bool writeOnProc) const
Write the objects using stream options.
virtual const std::ostream & stdStream() const override
Const access to underlying std::ostream.
Definition: OFstream.C:125
bool readEntry(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX, IOobjectOption::readOption readOpt=IOobjectOption::MUST_READ) const
Find entry and assign to T val. FatalIOError if it is found and the number of tokens is incorrect...
label purgeWrite_
Definition: Time.H:166
word timeName
Definition: getTimeIndex.H:3
bool merge(const dictionary &dict)
Merge entries from the given dictionary.
Definition: dictionary.C:799
"adjustable" / "adjustableRunTime"
Definition: Time.H:87
void write(vtk::formatter &fmt, const Type &val, const label n=1)
Component-wise write of a value (N times)
"timeStep"
Definition: Time.H:85
static void warnLocalBoundaryConsistencyCompat(const dictionary &)
Warn about keyword changes for local boundary consistency checks.
Definition: FieldBase.C:77
static int precision_
Time directory name precision.
Definition: Time.H:202
void clear()
Clear the list, i.e. set size to zero.
Definition: ListI.H:130
virtual int precision() const override
Get precision of output field.
Definition: OSstream.C:327
static const Enum< writeControls > writeControlNames
Names for writeControls.
Definition: Time.H:109
OSstream Sout
OSstream wrapped stdout (std::cout)
scalar endTime_
Definition: Time.H:158
const word & name() const
Name function is needed to disambiguate those inherited from regIOobject and dictionary.
#define DetailInfo
Definition: evalEntry.C:30
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:56
const labelList & watchIndices() const noexcept
Read access to file-monitoring handles.
Definition: regIOobjectI.H:206
bool distributed() const noexcept
True if case running with parallel distributed directories (ie. not NFS mounted)
Definition: TimePathsI.H:46
static IOstreamOption::floatFormat format_
Format for time directory names (general | fixed | scientific)
Definition: Time.H:197
bool readIfPresent(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX) const
Find an entry if present, and assign to T val. FatalIOError if it is found and the number of tokens i...
OBJstream os(runTime.globalPath()/outputName)
virtual void readDict()
Read the control dictionary and set the write controls etc.
Definition: TimeIO.C:84
simpleObjectRegistry & infoObjects()
Access to registered InfoSwitch objects.
Definition: debug.C:299
static fileCheckTypes fileModificationChecking
Type of file modification checking.
Definition: IOobject.H:351
compressionType compression() const noexcept
Get the stream compression.
Ostream & printExecutionTime(OSstream &os) const
Print the elapsed ExecutionTime (cpu-time), ClockTime.
Definition: TimeIO.C:611
static autoPtr< fileOperation > New(const word &handlerType, bool verbose=false)
Select fileHandler-type. Uses defaultFileHandler if the handlerType is empty.
void readModifiedObjects()
Read the objects that have been modified.
Definition: TimeIO.C:459
simpleObjectRegistry & dimensionSetObjects()
Access to registered DimensionSets objects.
Definition: debug.C:321
bool deltaTchanged_
Definition: TimeState.H:71
const word & name() const noexcept
Return const reference to name.
void writeOnce()
Write the objects once (one shot) and continue the run.
Definition: TimeIO.C:605
dictionary & dimensionSystems()
Top level dictionary.
Definition: dimensionSets.C:86
virtual bool read()
Read control dictionary, update controls and time.
Definition: TimeIO.C:434
#define WarningInFunction
Report a warning using Foam::Warning.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
Definition: error.H:629
OSstream & stream()
Return OSstream for output operations.
Definition: error.C:314
static floatFormat floatFormatEnum(const word &fmtName, const floatFormat deflt=floatFormat::general)
Lookup floatFormat enum corresponding to the string (general | fixed | scientific).
Stop when Time reaches prescribed endTime.
Definition: Time.H:99
UPtrList< Type > objects()
Return unsorted list of objects with a class satisfying isA<Type> or isType<Type> (with Strict) ...
simpleObjectRegistry & dimensionedConstantObjects()
Access to registered DimensionedConstants objects.
Definition: debug.C:332
Nothing to be read.
versionNumber version() const noexcept
Get the stream version.
bool distributed() const noexcept
Distributed roots (parallel run)
OSstream Serr
OSstream wrapped stderr (std::cerr)
messageStream Info
Information stream (stdout output on master, null elsewhere)
#define IOWarningInFunction(ios)
Report an IO warning using Foam::Warning.
Omanip< int > setw(const int i)
Definition: IOmanip.H:199
#define forAllReverse(list, i)
Reverse loop across all elements in list.
Definition: stdFoam.H:302
static const fileOperation & fileHandler()
Return the current file handler. Will create the default file handler if necessary.
List< fileName > fileNameList
List of fileName.
Definition: fileNameList.H:32
streamFormat format() const noexcept
Get the current stream format.
bool setEnv(const word &name, const std::string &value, const bool overwrite)
Set an environment variable, return true on success.
Definition: POSIX.C:358
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
Do not request registration (bool: false)
bool writeNow()
Write the objects immediately (not at end of iteration) and continue the run.
Definition: TimeIO.C:589
Namespace for OpenFOAM.
forAllConstIters(mixture.phases(), phase)
Definition: pEqn.H:28
const dictionary * findDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a sub-dictionary pointer if present (and it is a dictionary) otherwise return nullptr...
Definition: dictionaryI.H:124
IOerror FatalIOError
Error stream (stdout output on all processes), with additional &#39;FOAM FATAL IO ERROR&#39; header text and ...