FEATURE: Backport of option for setDeltaT to set adjustment. Port: Henrik Rusche. Merge: Dominik Christ.

This commit is contained in:
Dominik Christ 2015-04-27 11:00:50 +01:00
commit aa6c0758f5
2 changed files with 24 additions and 8 deletions

View file

@ -642,17 +642,25 @@ void Foam::Time::setEndTime(const scalar endTime)
} }
void Foam::Time::setDeltaT(const dimensionedScalar& deltaT) void Foam::Time::setDeltaT
(
const dimensionedScalar& deltaT,
const bool bAdjustDeltaT
)
{ {
setDeltaT(deltaT.value()); setDeltaT(deltaT.value(), bAdjustDeltaT);
} }
void Foam::Time::setDeltaT(const scalar deltaT) void Foam::Time::setDeltaT(const scalar deltaT, const bool bAdjustDeltaT)
{ {
deltaT_ = deltaT; deltaT_ = deltaT;
deltaTchanged_ = true; deltaTchanged_ = true;
adjustDeltaT();
if (bAdjustDeltaT)
{
adjustDeltaT();
}
} }

View file

@ -445,7 +445,18 @@ public:
virtual void setEndTime(const scalar); virtual void setEndTime(const scalar);
//- Reset time step //- Reset time step
virtual void setDeltaT(const dimensionedScalar&); virtual void setDeltaT
(
const dimensionedScalar&,
const bool adjustDeltaT = true
);
//- Reset time step
virtual void setDeltaT
(
const scalar,
const bool adjustDeltaT = true
);
//- Reset write control //- Reset write control
virtual void setWriteControl(const writeControls&); virtual void setWriteControl(const writeControls&);
@ -453,9 +464,6 @@ public:
//- Reset write interval //- Reset write interval
virtual void setWriteInterval(const scalar); virtual void setWriteInterval(const scalar);
//- Reset time step
virtual void setDeltaT(const scalar);
//- Set time to sub-cycle for the given number of steps //- Set time to sub-cycle for the given number of steps
virtual TimeState subCycle(const label nSubCycles); virtual TimeState subCycle(const label nSubCycles);