ENH: Time: pass in case name from argList

This commit is contained in:
mattijs
2013-09-16 16:14:58 +01:00
parent 051676fdb4
commit a863f4d79d
2 changed files with 25 additions and 10 deletions

View File

@ -384,18 +384,11 @@ Foam::Time::Time
const word& constantName
)
:
//TimePaths
//(
// args.parRunControl().parRun(),
// args.rootPath(),
// args.globalCaseName(),
// args.caseName(),
// systemName,
// constantName
//),
TimePaths
(
args.parRunControl().parRun(),
args.rootPath(),
args.globalCaseName(),
args.caseName(),
systemName,
constantName

View File

@ -80,7 +80,29 @@ Foam::TimePaths::TimePaths
case_(caseName),
system_(systemName),
constant_(constantName)
{}
{
if (!processorCase)
{
// For convenience: find out from case name whether it is a
// processor directory and set processorCase flag so file searching
// goes up one level.
std::string::size_type pos = caseName.find("processor");
if (pos != string::npos)
{
processorCase_ = true;
if (pos == 0)
{
globalCaseName_ = ".";
}
else
{
globalCaseName_ = caseName(pos-1);
}
}
}
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //