- use succincter method names that more closely resemble dictionary and HashTable method names. This improves method name consistency between classes and also requires less typing effort: args.found(optName) vs. args.optionFound(optName) args.readIfPresent(..) vs. args.optionReadIfPresent(..) ... args.opt<scalar>(optName) vs. args.optionRead<scalar>(optName) args.read<scalar>(index) vs. args.argRead<scalar>(index) - the older method names forms have been retained for code compatibility, but are now deprecated
32 lines
833 B
C
32 lines
833 B
C
instantList sourceTimes = runTimeSource.times();
|
|
label sourceTimeIndex = runTimeSource.timeIndex();
|
|
if (args.found("sourceTime"))
|
|
{
|
|
if (args["sourceTime"] == "latestTime")
|
|
{
|
|
sourceTimeIndex = sourceTimes.size() - 1;
|
|
}
|
|
else
|
|
{
|
|
sourceTimeIndex = Time::findClosestTimeIndex
|
|
(
|
|
sourceTimes,
|
|
args.opt<scalar>("sourceTime")
|
|
);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
sourceTimeIndex = Time::findClosestTimeIndex
|
|
(
|
|
sourceTimes,
|
|
runTimeTarget.time().value()
|
|
);
|
|
}
|
|
|
|
runTimeSource.setTime(sourceTimes[sourceTimeIndex], sourceTimeIndex);
|
|
|
|
Info<< "\nSource time: " << runTimeSource.value()
|
|
<< "\nTarget time: " << runTimeTarget.value()
|
|
<< endl;
|