mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: Time: check restart time value.
This commit is contained in:
@ -212,6 +212,21 @@ void Foam::Time::setControls()
|
|||||||
{
|
{
|
||||||
timeIndex_ = startTimeIndex_;
|
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("index", timeIndex_);
|
||||||
timeDict.add("deltaT", deltaT_);
|
timeDict.add("deltaT", deltaT_);
|
||||||
timeDict.add("deltaT0", deltaT0_);
|
timeDict.add("deltaT0", deltaT0_);
|
||||||
|
|||||||
Reference in New Issue
Block a user