mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
extended the conversion library and utilities
library: * routines for managing cellTable and boundaryRegion * writing ensight files and parts * mesh reader/writer for STARCD utils: * star4ToFoam * foamToStarMesh * foamToEnsightParts
This commit is contained in:
@ -0,0 +1,50 @@
|
||||
// Read time index from */uniform/time,
|
||||
// but treat 0 and constant specially
|
||||
|
||||
label timeIndex = 0;
|
||||
|
||||
if
|
||||
(
|
||||
runTime.timeName() != "constant"
|
||||
&& runTime.timeName() != "0"
|
||||
)
|
||||
{
|
||||
IOobject io
|
||||
(
|
||||
"time",
|
||||
runTime.timeName(),
|
||||
"uniform",
|
||||
runTime,
|
||||
IOobject::READ_IF_PRESENT,
|
||||
IOobject::NO_WRITE,
|
||||
false
|
||||
);
|
||||
|
||||
if (io.headerOk())
|
||||
{
|
||||
IOdictionary timeObject
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"time",
|
||||
runTime.timeName(),
|
||||
"uniform",
|
||||
runTime,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE,
|
||||
false
|
||||
)
|
||||
);
|
||||
|
||||
timeObject.lookup("index") >> timeIndex;
|
||||
}
|
||||
else
|
||||
{
|
||||
Info<< "skip ... missing entry " << io.objectPath() << endl;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
timeIndices.insert(timeIndex, timeDirs[timeI].value());
|
||||
Info<< "\nTime [" << timeIndex << "] = " << runTime.timeName() << nl;
|
||||
|
||||
Reference in New Issue
Block a user