ENH: Time: check restart time value.

This commit is contained in:
mattijs 2011-10-21 14:16:53 +01:00
parent fcebb1e6e7
commit 3829ca5660
2 changed files with 16 additions and 0 deletions

View File

@ -212,6 +212,21 @@ void Foam::Time::setControls()
{
timeIndex_ = startTimeIndex_;
}
scalar timeValue;
if (timeDict.readIfPresent("value", timeValue))
{
if (mag(timeValue - value()) > SMALL)
{
IOWarningIn("Time::setControls()", timeDict)
<< "Time read from time dictionary " << timeValue
<< " differs from actual time " << value() << '.' << nl
<< " This may cause unexpected database behaviour."
<< " If you are not interested" << nl
<< " in preserving time state delete the time dictionary."
<< endl;
}
}
}

View File

@ -307,6 +307,7 @@ bool Foam::Time::writeObject
)
);
timeDict.add("value", value());
timeDict.add("index", timeIndex_);
timeDict.add("deltaT", deltaT_);
timeDict.add("deltaT0", deltaT0_);