OpenFOAM-dev / data /applications /utilities /postProcessing /dataConversion /foamToEnsightParts /getTimeIndex.H
Download data/applications/utilities/postProcessing/dataConversion/foamToEnsightParts/getTimeIndex.H from introvoyz042/OpenFOAM-dev: direct link, hf CLI and curl.
- Browser
- Download file 1.07 kB
-
https://huggingface.co/datasets/introvoyz042/OpenFOAM-dev/resolve/main/data/applications/utilities/postProcessing/dataConversion/foamToEnsightParts/getTimeIndex.H
- Command line
-
hf download hf://datasets/introvoyz042/OpenFOAM-dev/data/applications/utilities/postProcessing/dataConversion/foamToEnsightParts/getTimeIndex.H
-
curl -L -o getTimeIndex.H https://huggingface.co/datasets/introvoyz042/OpenFOAM-dev/resolve/main/data/applications/utilities/postProcessing/dataConversion/foamToEnsightParts/getTimeIndex.H
1.07 kB
| // Read time index from */uniform/time, but treat 0 and constant specially | |
| // or simply increment from the '-index' option if it was supplied | |
| label timeIndex = 0; | |
| if (optIndex) | |
| { | |
| timeIndex = indexingNumber++; | |
| } | |
| else if | |
| ( | |
| runTime.name() != runTime.constant() | |
| && runTime.name() != "0" | |
| ) | |
| { | |
| typeIOobject<IOdictionary> io | |
| ( | |
| "time", | |
| runTime.name(), | |
| "uniform", | |
| runTime, | |
| IOobject::READ_IF_PRESENT, | |
| IOobject::NO_WRITE, | |
| false | |
| ); | |
| if (io.headerOk()) | |
| { | |
| io.readOpt() = IOobject::MUST_READ_IF_MODIFIED; | |
| IOdictionary timeObject(io); | |
| timeObject.lookup("index") >> timeIndex; | |
| } | |
| else | |
| { | |
| Info<< "skip ... missing entry " | |
| << io.objectPath() << endl; | |
| continue; | |
| } | |
| } | |
| timeIndices.insert(timeIndex, timeDirs[timeI].value()); | |
| Info<< "\nTime [" << timeIndex << "] = " << runTime.name() << nl; | |