Skip to content
Snippets Groups Projects
Commit 15fea54f authored by Mattijs Janssens's avatar Mattijs Janssens
Browse files

constant not present

parent 65b79dc7
Branches
Tags
No related merge requests found
...@@ -56,6 +56,7 @@ instantList Time::findTimes(const fileName& directory) ...@@ -56,6 +56,7 @@ instantList Time::findTimes(const fileName& directory)
label nTimes = 0; label nTimes = 0;
// Check for "constant" // Check for "constant"
bool haveConstant = false;
forAll(dirEntries, i) forAll(dirEntries, i)
{ {
if (dirEntries[i] == "constant") if (dirEntries[i] == "constant")
...@@ -63,6 +64,7 @@ instantList Time::findTimes(const fileName& directory) ...@@ -63,6 +64,7 @@ instantList Time::findTimes(const fileName& directory)
Times[nTimes].value() = 0; Times[nTimes].value() = 0;
Times[nTimes].name() = dirEntries[i]; Times[nTimes].name() = dirEntries[i];
nTimes++; nTimes++;
haveConstant = true;
break; break;
} }
} }
...@@ -84,9 +86,16 @@ instantList Time::findTimes(const fileName& directory) ...@@ -84,9 +86,16 @@ instantList Time::findTimes(const fileName& directory)
// Reset the length of the times list // Reset the length of the times list
Times.setSize(nTimes); Times.setSize(nTimes);
if (nTimes > 1) if (haveConstant)
{ {
std::sort(&Times[1], Times.end(), instant::less()); if (nTimes > 2)
{
std::sort(&Times[1], Times.end(), instant::less());
}
}
else if (nTimes > 1)
{
std::sort(&Times[0], Times.end(), instant::less());
} }
return Times; return Times;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment