ENH: Time: check restart time value.
This commit is contained in:
parent
fcebb1e6e7
commit
3829ca5660
@ -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_);
|
||||
|
Loading…
Reference in New Issue
Block a user