mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: addDictOption: consistent dict option handling
This commit is contained in:
10
src/OpenFOAM/include/addDictOption.H
Normal file
10
src/OpenFOAM/include/addDictOption.H
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
//
|
||||||
|
// addDictOption.H
|
||||||
|
// ~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
Foam::argList::addOption
|
||||||
|
(
|
||||||
|
"dict",
|
||||||
|
"file",
|
||||||
|
"read control dictionary from specified location"
|
||||||
|
);
|
||||||
33
src/OpenFOAM/include/setConstantMeshDictionaryIO.H
Normal file
33
src/OpenFOAM/include/setConstantMeshDictionaryIO.H
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
//
|
||||||
|
// setConstantMeshDictionaryIO.H
|
||||||
|
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
fileName dictPath = "";
|
||||||
|
if (args.optionFound("dict"))
|
||||||
|
{
|
||||||
|
dictPath = args["dict"];
|
||||||
|
if (isDir(dictPath))
|
||||||
|
{
|
||||||
|
dictPath = dictPath / dictName;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
IOobject dictIO
|
||||||
|
(
|
||||||
|
dictName,
|
||||||
|
runTime.constant(),
|
||||||
|
mesh,
|
||||||
|
IOobject::MUST_READ_IF_MODIFIED,
|
||||||
|
IOobject::NO_WRITE
|
||||||
|
);
|
||||||
|
|
||||||
|
if (dictPath.size())
|
||||||
|
{
|
||||||
|
dictIO = IOobject
|
||||||
|
(
|
||||||
|
dictPath,
|
||||||
|
mesh,
|
||||||
|
IOobject::MUST_READ_IF_MODIFIED,
|
||||||
|
IOobject::NO_WRITE
|
||||||
|
);
|
||||||
|
}
|
||||||
33
src/OpenFOAM/include/setSystemMeshDictionaryIO.H
Normal file
33
src/OpenFOAM/include/setSystemMeshDictionaryIO.H
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
//
|
||||||
|
// setSystemMeshDictionaryIO.H
|
||||||
|
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
fileName dictPath = "";
|
||||||
|
if (args.optionFound("dict"))
|
||||||
|
{
|
||||||
|
dictPath = args["dict"];
|
||||||
|
if (isDir(dictPath))
|
||||||
|
{
|
||||||
|
dictPath = dictPath / dictName;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
IOobject dictIO
|
||||||
|
(
|
||||||
|
dictName,
|
||||||
|
runTime.system(),
|
||||||
|
mesh,
|
||||||
|
IOobject::MUST_READ_IF_MODIFIED,
|
||||||
|
IOobject::NO_WRITE
|
||||||
|
);
|
||||||
|
|
||||||
|
if (dictPath.size())
|
||||||
|
{
|
||||||
|
dictIO = IOobject
|
||||||
|
(
|
||||||
|
dictPath,
|
||||||
|
mesh,
|
||||||
|
IOobject::MUST_READ_IF_MODIFIED,
|
||||||
|
IOobject::NO_WRITE
|
||||||
|
);
|
||||||
|
}
|
||||||
33
src/OpenFOAM/include/setSystemRunTimeDictionaryIO.H
Normal file
33
src/OpenFOAM/include/setSystemRunTimeDictionaryIO.H
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
//
|
||||||
|
// setSystemRunTimeDictionaryIO.H
|
||||||
|
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
fileName dictPath = "";
|
||||||
|
if (args.optionFound("dict"))
|
||||||
|
{
|
||||||
|
dictPath = args["dict"];
|
||||||
|
if (isDir(dictPath))
|
||||||
|
{
|
||||||
|
dictPath = dictPath / dictName;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
IOobject dictIO
|
||||||
|
(
|
||||||
|
dictName,
|
||||||
|
runTime.system(),
|
||||||
|
runTime,
|
||||||
|
IOobject::MUST_READ_IF_MODIFIED,
|
||||||
|
IOobject::NO_WRITE
|
||||||
|
);
|
||||||
|
|
||||||
|
if (dictPath.size())
|
||||||
|
{
|
||||||
|
dictIO = IOobject
|
||||||
|
(
|
||||||
|
dictPath,
|
||||||
|
runTime,
|
||||||
|
IOobject::MUST_READ_IF_MODIFIED,
|
||||||
|
IOobject::NO_WRITE
|
||||||
|
);
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user