61 if (Times[timeI].
name() !=
"constant" && selected(Times[timeI]))
70 if (
operator[](rangeI).isExact())
72 scalar target = operator[](rangeI).value();
74 int nearestIndex = -1;
75 scalar nearestDiff = Foam::GREAT;
79 if (Times[timeI].
name() ==
"constant")
continue;
81 scalar diff = fabs(Times[timeI].value() - target);
82 if (diff < nearestDiff)
89 if (nearestIndex >= 0)
91 lst[nearestIndex] =
true;
105 return subset(selected(Times), Times);
149 label constantIdx = -1;
154 if (timeDirs[timeI].
name() ==
"constant")
158 else if (timeDirs[timeI].value() == 0)
163 if (constantIdx >= 0 && zeroIdx >= 0)
171 label latestIdx = -1;
175 latestIdx = timeDirs.
size() - 1;
178 if (latestIdx == constantIdx)
197 selectTimes[latestIdx] =
true;
200 if (constantIdx >= 0)
203 selectTimes[constantIdx] = args.
optionFound(
"constant");
212 selectTimes[zeroIdx] =
false;
217 selectTimes[zeroIdx] = args.
optionFound(
"zeroTime");
221 return subset(selectTimes, timeDirs);
238 if (timeDirs.
empty())
241 <<
"No times selected"
245 runTime.
setTime(timeDirs[0], 0);