mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: add timeControl clear() method to reset to 'always' (pass-through)
This commit is contained in:
@ -81,7 +81,7 @@ Foam::timeControl::timeControl
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * //
|
||||||
|
|
||||||
bool Foam::timeControl::entriesPresent
|
bool Foam::timeControl::entriesPresent
|
||||||
(
|
(
|
||||||
@ -95,15 +95,33 @@ bool Foam::timeControl::entriesPresent
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
void Foam::timeControl::clear()
|
||||||
|
{
|
||||||
|
timeControl_ = ocAlways;
|
||||||
|
intervalSteps_ = 0;
|
||||||
|
interval_ = -1;
|
||||||
|
executionIndex_ = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void Foam::timeControl::read(const dictionary& dict)
|
void Foam::timeControl::read(const dictionary& dict)
|
||||||
{
|
{
|
||||||
|
// Default is timeStep
|
||||||
|
timeControl_ = ocTimeStep;
|
||||||
|
|
||||||
word controlName(prefix_ + "Control");
|
word controlName(prefix_ + "Control");
|
||||||
word intervalName(prefix_ + "Interval");
|
word intervalName(prefix_ + "Interval");
|
||||||
|
|
||||||
// For backward compatibility support the deprecated 'outputControl' option
|
if (prefix_ == "write")
|
||||||
// now superseded by 'writeControl' for compatibility with Time
|
|
||||||
if (prefix_ == "write" && dict.found("outputControl"))
|
|
||||||
{
|
{
|
||||||
|
// TBD: Could have timeControl_ = ocWriteTime;
|
||||||
|
|
||||||
|
if (dict.found("outputControl"))
|
||||||
|
{
|
||||||
|
// Accept deprecated 'outputControl' instead of 'writeControl'
|
||||||
|
|
||||||
IOWarningInFunction(dict)
|
IOWarningInFunction(dict)
|
||||||
<< "Using deprecated 'outputControl'" << nl
|
<< "Using deprecated 'outputControl'" << nl
|
||||||
<< " Please use 'writeControl' with 'writeInterval'"
|
<< " Please use 'writeControl' with 'writeInterval'"
|
||||||
@ -114,8 +132,10 @@ void Foam::timeControl::read(const dictionary& dict)
|
|||||||
controlName = "outputControl";
|
controlName = "outputControl";
|
||||||
intervalName = "outputInterval";
|
intervalName = "outputInterval";
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
timeControl_ = controlNames_.getOrDefault(controlName, dict, ocTimeStep);
|
|
||||||
|
timeControl_ = controlNames_.getOrDefault(controlName, dict, timeControl_);
|
||||||
|
|
||||||
switch (timeControl_)
|
switch (timeControl_)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -156,6 +156,9 @@ public:
|
|||||||
//- Return the named control enumeration as its 'type'
|
//- Return the named control enumeration as its 'type'
|
||||||
inline const word& type() const;
|
inline const word& type() const;
|
||||||
|
|
||||||
|
//- Reset control to 'always' - ie, no intervention
|
||||||
|
void clear();
|
||||||
|
|
||||||
//- Return the control enumeration
|
//- Return the control enumeration
|
||||||
inline timeControls control() const;
|
inline timeControls control() const;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user