Time: When increasing precision check if the time name is unchanged
Patch contributed by Mattijs Janssens
This commit is contained in:
parent
473cc6687e
commit
2ee2323d42
1 changed files with 11 additions and 1 deletions
|
|
@ -2,7 +2,7 @@
|
||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
|
|
@ -184,6 +184,8 @@ void Foam::Time::setControls()
|
||||||
int oldPrecision = precision_;
|
int oldPrecision = precision_;
|
||||||
int requiredPrecision = -1;
|
int requiredPrecision = -1;
|
||||||
bool found = false;
|
bool found = false;
|
||||||
|
word oldTime(timeName());
|
||||||
|
|
||||||
for
|
for
|
||||||
(
|
(
|
||||||
precision_ = maxPrecision_;
|
precision_ = maxPrecision_;
|
||||||
|
|
@ -194,6 +196,14 @@ void Foam::Time::setControls()
|
||||||
// Update the time formatting
|
// Update the time formatting
|
||||||
setTime(startTime_, 0);
|
setTime(startTime_, 0);
|
||||||
|
|
||||||
|
// Check that the time name has changed otherwise exit loop
|
||||||
|
word newTime(timeName());
|
||||||
|
if (newTime == oldTime)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
oldTime = newTime;
|
||||||
|
|
||||||
// Check the existence of the time directory with the new format
|
// Check the existence of the time directory with the new format
|
||||||
found = exists(timePath(), false);
|
found = exists(timePath(), false);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue