systemDict: Consistent handling of the -dict option

The -dict option is now handled correctly and consistently across all
applications with -dict options. The logic associated with doing so has
been centralised.

If a relative path is given to the -dict option, then it is assumed to
be relative to the case directory. If an absolute path is given, then it
is used without reference to the case directory. In both cases, if the
path is found to be a directory, then the standard dictionary name is
appended to the path.

Resolves bug report http://bugs.openfoam.org/view.php?id=3692
This commit is contained in:
Will Bainbridge
2021-07-02 11:44:02 +01:00
parent 2fe27ab56e
commit c63c1a90c2
17 changed files with 113 additions and 233 deletions

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -41,6 +41,7 @@ Description
#include "labelListIOList.H"
#include "syncTools.H"
#include "globalIndex.H"
#include "systemDict.H"
using namespace Foam;
@ -56,10 +57,11 @@ int main(int argc, char *argv[])
const word dictName("viewFactorsDict");
#include "setConstantMeshDictionaryIO.H"
// Read control dictionary
const IOdictionary agglomDict(dictIO);
const IOdictionary agglomDict
(
systemDict(dictName, args, runTime, word::null, runTime.constant())
);
bool writeAgglom = readBool(agglomDict.lookup("writeFacesAgglomeration"));