From a0ca9a745e42e0323b914eb10a177bd1aa0c9dd7 Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Fri, 5 Mar 2021 14:43:35 +0000 Subject: [PATCH] applications/utilities/surface: Updated handling of -dict option --- .../generation/snappyHexMesh/snappyHexMesh.C | 2 +- .../surface/surfaceFeatures/surfaceFeatures.C | 9 ++---- .../surface/surfaceHookUp/surfaceHookUp.C | 9 ++---- .../include/setSystemRunTimeDictionaryIO.H | 29 ------------------- 4 files changed, 5 insertions(+), 44 deletions(-) delete mode 100644 src/OpenFOAM/include/setSystemRunTimeDictionaryIO.H diff --git a/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMesh.C b/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMesh.C index 644b48eb19..7e12cc8dd4 100644 --- a/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMesh.C +++ b/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMesh.C @@ -732,7 +732,7 @@ int main(int argc, char *argv[]) // Read meshing dictionary - const dictionary meshDict(systemDict("snappyHexMeshDict", args, mesh)); + const IOdictionary meshDict(systemDict("snappyHexMeshDict", args, mesh)); // all surface geometry diff --git a/applications/utilities/surface/surfaceFeatures/surfaceFeatures.C b/applications/utilities/surface/surfaceFeatures/surfaceFeatures.C index 2e685f3ac3..610b12b90e 100644 --- a/applications/utilities/surface/surfaceFeatures/surfaceFeatures.C +++ b/applications/utilities/surface/surfaceFeatures/surfaceFeatures.C @@ -35,7 +35,7 @@ Description #include "surfaceFeatures.H" #include "triSurfaceFields.H" #include "vtkSurfaceWriter.H" -#include "IOdictionary.H" +#include "systemDict.H" using namespace Foam; @@ -731,12 +731,7 @@ int main(int argc, char *argv[]) #include "setRootCase.H" #include "createTime.H" - const word dictName("surfaceFeaturesDict"); - #include "setSystemRunTimeDictionaryIO.H" - - Info<< "Reading " << dictName << nl << endl; - - const IOdictionary dict(dictIO); + const dictionary dict(systemDict("surfaceFeaturesDict", args, runTime)); if (dict.found("surfaces")) { diff --git a/applications/utilities/surface/surfaceHookUp/surfaceHookUp.C b/applications/utilities/surface/surfaceHookUp/surfaceHookUp.C index 73d2c7cd96..4f394905fe 100644 --- a/applications/utilities/surface/surfaceHookUp/surfaceHookUp.C +++ b/applications/utilities/surface/surfaceHookUp/surfaceHookUp.C @@ -41,7 +41,7 @@ Usage #include "PackedBoolList.H" #include "unitConversion.H" #include "searchableSurfaces.H" -#include "IOdictionary.H" +#include "systemDict.H" using namespace Foam; @@ -281,12 +281,7 @@ int main(int argc, char *argv[]) #include "setRootCase.H" #include "createTime.H" - const word dictName("surfaceHookUpDict"); - #include "setSystemRunTimeDictionaryIO.H" - - Info<< "Reading " << dictName << nl << endl; - - const IOdictionary dict(dictIO); + const dictionary dict(systemDict("surfaceHookUpDict", args, runTime)); const scalar dist(args.argRead(1)); const scalar matchTolerance(max(1e-6*dist, small)); diff --git a/src/OpenFOAM/include/setSystemRunTimeDictionaryIO.H b/src/OpenFOAM/include/setSystemRunTimeDictionaryIO.H deleted file mode 100644 index ceebb43815..0000000000 --- a/src/OpenFOAM/include/setSystemRunTimeDictionaryIO.H +++ /dev/null @@ -1,29 +0,0 @@ -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 - ); -}