diff --git a/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.C b/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.C index 94ba5eb6bc16a7e6a3515d0068ccec14c1ffd3cb..45f02c12ab6510c7b96b82f34801a9ecc8931677 100644 --- a/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.C +++ b/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.C @@ -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; }