()
| 492 | |
| 493 | |
| 494 | bool 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 | |
| 528 | bool 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 |
nothing calls this directly
no test coverage detected