diff --git a/src/OpenFOAM/include/addDictOption.H b/src/OpenFOAM/include/addDictOption.H new file mode 100644 index 0000000000000000000000000000000000000000..f538e572948c95a5e9e47f85f08bfcd4ab66b366 --- /dev/null +++ b/src/OpenFOAM/include/addDictOption.H @@ -0,0 +1,10 @@ +// +// addDictOption.H +// ~~~~~~~~~~~~~~~~~ + + Foam::argList::addOption + ( + "dict", + "file", + "read control dictionary from specified location" + ); diff --git a/src/OpenFOAM/include/setConstantMeshDictionaryIO.H b/src/OpenFOAM/include/setConstantMeshDictionaryIO.H new file mode 100644 index 0000000000000000000000000000000000000000..4f97cf16940800ddfcf6168f5584496e342edb64 --- /dev/null +++ b/src/OpenFOAM/include/setConstantMeshDictionaryIO.H @@ -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 + ); + } diff --git a/src/OpenFOAM/include/setSystemMeshDictionaryIO.H b/src/OpenFOAM/include/setSystemMeshDictionaryIO.H new file mode 100644 index 0000000000000000000000000000000000000000..6e89f94c33fb2b1ec344d3c47a8bfcfc84369d87 --- /dev/null +++ b/src/OpenFOAM/include/setSystemMeshDictionaryIO.H @@ -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 + ); + } diff --git a/src/OpenFOAM/include/setSystemRunTimeDictionaryIO.H b/src/OpenFOAM/include/setSystemRunTimeDictionaryIO.H new file mode 100644 index 0000000000000000000000000000000000000000..e594e83d960110735ddf042462655c2d46318756 --- /dev/null +++ b/src/OpenFOAM/include/setSystemRunTimeDictionaryIO.H @@ -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 + ); + }