Commit ca3afb13 authored by Andrew Heather's avatar Andrew Heather

BUG: Corrected re-reading of time control function objects. Fixes #1192

parent da17cf9c
......@@ -815,7 +815,35 @@ bool Foam::functionObjectList::read()
"functionObject::" + objPtr->name() + "::read"
);
enabled = objPtr->read(dict);
if (functionObjects::timeControl::entriesPresent(dict))
{
if (isA<functionObjects::timeControl>(objPtr()))
{
// Already a time control - normal read
enabled = objPtr->read(dict);
}
else
{
// Was not a time control - need to re-create
objPtr.reset
(
new functionObjects::timeControl
(
key,
time_,
dict
)
);
enabled = true;
}
}
else
{
// Plain function object - normal read
enabled = objPtr->read(dict);
}
ok = enabled && ok;
}
......
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