mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: IOobject::selectIO helper method
- centralizes IOobject handling and treatment of alternative locations. If an alternative file location is specified, it will be used instead. - provide decompositionMethod::canonicalName instead of using "decomposeParDict" in various places.
This commit is contained in:
@ -1,28 +1,12 @@
|
||||
fileName dictPath;
|
||||
if (args.readIfPresent("dict", dictPath))
|
||||
{
|
||||
if (isDir(dictPath))
|
||||
{
|
||||
dictPath = dictPath / dictName;
|
||||
}
|
||||
}
|
||||
|
||||
IOobject dictIO
|
||||
IOobject dictIO = IOobject::selectIO
|
||||
(
|
||||
dictName,
|
||||
runTime.system(),
|
||||
mesh,
|
||||
IOobject::MUST_READ_IF_MODIFIED,
|
||||
IOobject::NO_WRITE
|
||||
);
|
||||
|
||||
if (dictPath.size())
|
||||
{
|
||||
dictIO = IOobject
|
||||
IOobject
|
||||
(
|
||||
dictPath.expand(),
|
||||
dictName,
|
||||
runTime.system(),
|
||||
mesh,
|
||||
IOobject::MUST_READ_IF_MODIFIED,
|
||||
IOobject::NO_WRITE
|
||||
);
|
||||
}
|
||||
),
|
||||
args.lookupOrDefault<fileName>("dict", "")
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user