mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
STYLE: used guarded read in runTimeControl
This commit is contained in:
@ -105,18 +105,12 @@ bool Foam::functionObjects::setTimeStepFunctionObject::read
|
||||
|
||||
timeStepPtr_ = Function1<scalar>::New("deltaT", dict);
|
||||
|
||||
// Check that adjustTimeStep is active
|
||||
const dictionary& controlDict = time_.controlDict();
|
||||
|
||||
Switch adjust;
|
||||
if
|
||||
(
|
||||
!controlDict.readIfPresent<Switch>("adjustTimeStep", adjust)
|
||||
|| !adjust
|
||||
)
|
||||
// Ensure that adjustTimeStep is active
|
||||
if (!time_.controlDict().lookupOrDefault<bool>("adjustTimeStep", false))
|
||||
{
|
||||
FatalIOErrorInFunction(dict)
|
||||
<< "Need to set 'adjustTimeStep' true to allow timestep control"
|
||||
<< nl
|
||||
<< exit(FatalIOError);
|
||||
}
|
||||
|
||||
|
||||
@ -71,7 +71,6 @@ SourceFiles
|
||||
|
||||
#include "functionObject.H"
|
||||
#include "Function1.H"
|
||||
#include "Switch.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -136,15 +135,12 @@ public:
|
||||
virtual bool adjustTimeStep();
|
||||
|
||||
//- Read and set the function object if its data have changed
|
||||
virtual bool read(const dictionary&);
|
||||
virtual bool read(const dictionary& dict);
|
||||
|
||||
//- Called at each ++ or += of the time-loop.
|
||||
// postProcess overrides the usual executeControl behaviour and
|
||||
// forces execution (used in post-processing mode)
|
||||
//- Execute does nothing
|
||||
virtual bool execute();
|
||||
//- Called at each ++ or += of the time-loop.
|
||||
// postProcess overrides the usual writeControl behaviour and
|
||||
// forces writing always (used in post-processing mode)
|
||||
|
||||
//- Write does nothing
|
||||
virtual bool write();
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user