MCPcopy Create free account
hub / github.com/OpenFOAM/OpenFOAM-dev / writeTimeDict

Function writeTimeDict

src/OpenFOAM/db/Time/TimeIO.C:494–565  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

492
493
494bool Foam::Time::writeTimeDict() const
495{
496 const word tmName(timeName());
497
498 IOdictionary timeDict
499 (
500 IOobject
501 (
502 "time",
503 tmName,
504 "uniform",
505 *this,
506 IOobject::NO_READ,
507 IOobject::NO_WRITE,
508 false
509 )
510 );
511
512 timeDict.add("value", timeName(timeToUserTime(value()), maxPrecision_));
513 timeDict.add("name", string(tmName));
514 timeDict.add("index", timeIndex_);
515 timeDict.add("deltaT", timeToUserTime(deltaT_));
516 timeDict.add("deltaT0", timeToUserTime(deltaT0_));
517
518 return timeDict.regIOobject::writeObject
519 (
520 IOstream::ASCII,
521 IOstream::currentVersion,
522 IOstream::UNCOMPRESSED,
523 true
524 );
525}
526
527
528bool Foam::Time::writeObject
529(
530 IOstream::streamFormat fmt,
531 IOstream::versionNumber ver,
532 IOstream::compressionType cmp,
533 const bool valid
534) const
535{
536 if (writeTime())
537 {
538 bool writeOK = writeTimeDict();
539
540 if (writeOK)
541 {
542 writeOK = objectRegistry::writeObject(fmt, ver, cmp, valid);
543 }
544
545 if (writeOK)
546 {
547 // Does the writeTime trigger purging?
548 if (writeTime_ && purgeWrite_)
549 {
550 previousWriteTimes_.push(timeName());
551

Callers

nothing calls this directly

Calls 5

writeTimeFunction · 0.85
writeObjectFunction · 0.50
pushMethod · 0.45
sizeMethod · 0.45
popMethod · 0.45

Tested by

no test coverage detected