Skip to content
Snippets Groups Projects
Commit edfd27f9 authored by Andrew Heather's avatar Andrew Heather
Browse files

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

parent 427acc84
Branches
Tags
No related merge requests found
......@@ -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;
}
......
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