BACKPORT: setDeltaT with optional adjustment

This commit is contained in:
Henrik Rusche 2015-01-08 10:20:56 +01:00 committed by Dominik Christ
parent c313b2d5a9
commit 48e9ee0e9f
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;
deltaTchanged_ = true;
adjustDeltaT();
if (bAdjustDeltaT)
{
adjustDeltaT();
}
}

View file

@ -445,7 +445,18 @@ public:
virtual void setEndTime(const scalar);
//- 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
virtual void setWriteControl(const writeControls&);
@ -453,9 +464,6 @@ public:
//- Reset write interval
virtual void setWriteInterval(const scalar);
//- Reset time step
virtual void setDeltaT(const scalar);
//- Set time to sub-cycle for the given number of steps
virtual TimeState subCycle(const label nSubCycles);