Skip to content

Commit

Permalink
Added an option to extract latestTime. (#567)
Browse files Browse the repository at this point in the history
  • Loading branch information
friedenhe authored Jan 19, 2024
1 parent aa18fb4 commit a42fe6c
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/utilities/preProcessing/getFIData/getFIData.C
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,14 @@ int main(int argc, char* argv[])
if (args.optionFound("time"))
{
time = readScalar(args.optionLookup("time")());
if (time == 9999)
{
Info << "Extract latestTime" << endl;
}
else
{
Info << "Extract time = " << time << endl;
}
}
else
{
Expand All @@ -93,10 +101,18 @@ int main(int argc, char* argv[])
scalar t = -1.0;
if (time == -1.0)
{
// read all times
t = n * deltaT;
}
else if (time == 9999)
{
// read from the latestTime (it is not necessarily the endTime)
instantList timeDirs = runTime.findTimes(runTime.path(), runTime.constant());
t = timeDirs.last().value();
}
else
{
// read from the specified time
t = time;
}
runTime.setTime(t, n);
Expand Down

0 comments on commit a42fe6c

Please sign in to comment.