diff --git a/src/OpenFOAM/db/functionObjects/functionObject/functionObject.H b/src/OpenFOAM/db/functionObjects/functionObject/functionObject.H index 2dace56ea5..460fa82d0d 100644 --- a/src/OpenFOAM/db/functionObjects/functionObject/functionObject.H +++ b/src/OpenFOAM/db/functionObjects/functionObject/functionObject.H @@ -62,30 +62,31 @@ Description Where: \table - Property | Description | Required | Default - type | Type of function object | yes | - libs | Libraries containing implementation | yes | - region | Name of region for multi-region cases | no | - enabled | On/off switch | no | yes - log | Log information to standard output | no | yes - timeStart| Start time | no | - timeEnd | End time | no | - executeControl | See time controls below | no | timeStep - executeInterval | Steps between each execute phase | no | - writeControl | See time controls below | no | timeStep - writeInterval | Steps between each write phase | no | + Property | Description | Required | Default + type | Type of function object | yes | + libs | Libraries containing implementation | yes | + region | Name of region for multi-region cases | no | + enabled | On/off switch | no | yes + log | Log information to standard output | no | yes + timeStart| Start time | no | + timeEnd | End time | no | + executeControl | See time controls below | no | timeStep + executeInterval | Steps/time between execute phases | no | 1 + writeControl | See time controls below | no | timeStep + writeInterval | Steps/time between write phases | no | 1 \endtable Time controls: \table Option | Description - timeStep | Execute/write every 'Interval' time-steps - writeTime | Execute/write every 'Interval' output times - adjustableRunTime | Execute/write every 'Interval' run time period - runTime | Execute/write every 'Interval' run time period - clockTime | Execute/write every 'Interval' clock time period - cpuTime | Execute/write every 'Interval' CPU time period - none | Execute/write disabled + none | Trigger is disabled + timeStep | Trigger every 'Interval' time-steps + writeTime | Trigger every 'Interval' output times + runTime | Trigger every 'Interval' run time period + adjustableRunTime | Currently identical to "runTime" + clockTime | Trigger every 'Interval' clock time period + cpuTime | Trigger every 'Interval' CPU time period + onEnd | Trigger on end of run \endtable The sub-dictionary name \c \ is chosen by the user, and diff --git a/src/OpenFOAM/db/functionObjects/timeControl/timeControl.C b/src/OpenFOAM/db/functionObjects/timeControl/timeControl.C index 0244c75beb..d49251683b 100644 --- a/src/OpenFOAM/db/functionObjects/timeControl/timeControl.C +++ b/src/OpenFOAM/db/functionObjects/timeControl/timeControl.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2016 OpenCFD Ltd. + Copyright (C) 2016-2019 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -35,18 +35,19 @@ const Foam::Enum < Foam::timeControl::timeControls > -Foam::timeControl::timeControlNames_ +Foam::timeControl::controlNames_ ({ + { timeControl::ocNone, "none" }, + { timeControl::ocAlways, "always" }, { timeControl::ocTimeStep, "timeStep" }, { timeControl::ocWriteTime, "writeTime" }, - { timeControl::ocOutputTime, "outputTime" }, + { timeControl::ocWriteTime, "outputTime" }, + { timeControl::ocRunTime, "runTime" }, { timeControl::ocAdjustableRunTime, "adjustable" }, { timeControl::ocAdjustableRunTime, "adjustableRunTime" }, - { timeControl::ocRunTime, "runTime" }, { timeControl::ocClockTime, "clockTime" }, { timeControl::ocCpuTime, "cpuTime" }, { timeControl::ocOnEnd, "onEnd" }, - { timeControl::ocNone, "none" }, }); @@ -54,17 +55,27 @@ Foam::timeControl::timeControlNames_ Foam::timeControl::timeControl ( - const Time& t, + const Time& runTime, + const word& prefix +) +: + time_(runTime), + prefix_(prefix), + timeControl_(ocAlways), + intervalSteps_(0), + interval_(-1), + executionIndex_(0) +{} + + +Foam::timeControl::timeControl +( + const Time& runTime, const dictionary& dict, const word& prefix ) : - time_(t), - prefix_(prefix), - timeControl_(ocTimeStep), - intervalSteps_(0), - interval_(-1), - executionIndex_(0) + timeControl(runTime, prefix) { read(dict); } @@ -97,27 +108,21 @@ void Foam::timeControl::read(const dictionary& dict) << "Using deprecated 'outputControl'" << nl << " Please use 'writeControl' with 'writeInterval'" << endl; + error::warnAboutAge("outputControl", 1606); // Change to the old names for this option controlName = "outputControl"; intervalName = "outputInterval"; } - timeControl_ = - timeControlNames_.lookupOrDefault(controlName, dict, ocTimeStep); + timeControl_ = controlNames_.getOrDefault(controlName, dict, ocTimeStep); switch (timeControl_) { case ocTimeStep: - { - intervalSteps_ = dict.lookupOrDefault