mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
BUG: Corrected re-reading of time control function objects. Fixes #1192
This commit is contained in:
@ -815,7 +815,35 @@ bool Foam::functionObjectList::read()
|
||||
"functionObject::" + objPtr->name() + "::read"
|
||||
);
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user