mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: surfaceMeshConvert: dict option handling
This commit is contained in:
@ -96,12 +96,8 @@ int main(int argc, char *argv[])
|
|||||||
"factor",
|
"factor",
|
||||||
"geometry scaling factor on output"
|
"geometry scaling factor on output"
|
||||||
);
|
);
|
||||||
argList::addOption
|
#include "addDictOption.H"
|
||||||
(
|
|
||||||
"dict",
|
|
||||||
"file",
|
|
||||||
"specify alternative dictionary for the coordinateSystems descriptions"
|
|
||||||
);
|
|
||||||
argList::addOption
|
argList::addOption
|
||||||
(
|
(
|
||||||
"from",
|
"from",
|
||||||
@ -154,19 +150,28 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
autoPtr<IOobject> csDictIoPtr;
|
autoPtr<IOobject> csDictIoPtr;
|
||||||
|
|
||||||
|
const word dictName("coordinateSystems::typeName");
|
||||||
|
|
||||||
|
// Note: cannot use setSystemRunTimeDictionaryIO.H since dictionary
|
||||||
|
// is in constant
|
||||||
|
|
||||||
|
fileName dictPath = "";
|
||||||
if (args.optionFound("dict"))
|
if (args.optionFound("dict"))
|
||||||
{
|
{
|
||||||
const fileName dictPath = args["dict"];
|
dictPath = args["dict"];
|
||||||
|
if (isDir(dictPath))
|
||||||
|
{
|
||||||
|
dictPath = dictPath / dictName;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (dictPath.size())
|
||||||
|
{
|
||||||
csDictIoPtr.set
|
csDictIoPtr.set
|
||||||
(
|
(
|
||||||
new IOobject
|
new IOobject
|
||||||
(
|
(
|
||||||
(
|
dictPath,
|
||||||
isDir(dictPath)
|
|
||||||
? dictPath/coordinateSystems::typeName
|
|
||||||
: dictPath
|
|
||||||
),
|
|
||||||
runTime,
|
runTime,
|
||||||
IOobject::MUST_READ,
|
IOobject::MUST_READ,
|
||||||
IOobject::NO_WRITE,
|
IOobject::NO_WRITE,
|
||||||
@ -180,7 +185,7 @@ int main(int argc, char *argv[])
|
|||||||
(
|
(
|
||||||
new IOobject
|
new IOobject
|
||||||
(
|
(
|
||||||
coordinateSystems::typeName,
|
dictName,
|
||||||
runTime.constant(),
|
runTime.constant(),
|
||||||
runTime,
|
runTime,
|
||||||
IOobject::MUST_READ,
|
IOobject::MUST_READ,
|
||||||
|
|||||||
Reference in New Issue
Block a user