Download data/applications/utilities/preProcessing/mapFields/setTimeIndex.H from introvoyz042/OpenFOAM-dev: direct link, hf CLI and curl.
- Browser
- Download file 1.05 kB
-
https://huggingface.co/datasets/introvoyz042/OpenFOAM-dev/resolve/main/data/applications/utilities/preProcessing/mapFields/setTimeIndex.H
- Command line
-
hf download hf://datasets/introvoyz042/OpenFOAM-dev/data/applications/utilities/preProcessing/mapFields/setTimeIndex.H
-
curl -L -o setTimeIndex.H https://huggingface.co/datasets/introvoyz042/OpenFOAM-dev/resolve/main/data/applications/utilities/preProcessing/mapFields/setTimeIndex.H
1.05 kB
| { | |
| instantList sourceTimes = runTimeSource.times(); | |
| if (sourceTimes.empty()) | |
| { | |
| FatalErrorInFunction << "No result times in source " | |
| << runTimeSource.caseName() | |
| << exit(FatalError); | |
| } | |
| label sourceTimeIndex = runTimeSource.timeIndex(); | |
| if (args.optionFound("sourceTime")) | |
| { | |
| if (args["sourceTime"] == "latestTime") | |
| { | |
| sourceTimeIndex = sourceTimes.size() - 1; | |
| } | |
| else | |
| { | |
| sourceTimeIndex = Time::findClosestTimeIndex | |
| ( | |
| sourceTimes, | |
| args.optionRead<scalar>("sourceTime") | |
| ); | |
| } | |
| } | |
| else | |
| { | |
| sourceTimeIndex = Time::findClosestTimeIndex | |
| ( | |
| sourceTimes, | |
| runTimeTarget.time().userTimeValue() | |
| ); | |
| } | |
| runTimeSource.setTime(sourceTimes[sourceTimeIndex], sourceTimeIndex); | |
| Info<< "\nSource time: " << runTimeSource.userTimeName() | |
| << "\nTarget time: " << runTimeTarget.userTimeName() | |
| << endl; | |
| } | |