Commit 3829ca56 authored by mattijs's avatar mattijs
Browse files

ENH: Time: check restart time value.

parent fcebb1e6
......@@ -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;
}
}
}
......
......@@ -307,6 +307,7 @@ bool Foam::Time::writeObject
)
);
timeDict.add("value", value());
timeDict.add("index", timeIndex_);
timeDict.add("deltaT", deltaT_);
timeDict.add("deltaT0", deltaT0_);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment