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:
@ -1,19 +1,6 @@
|
||||
word dictName("noiseDict");
|
||||
if (args.optionFound("dict"))
|
||||
{
|
||||
dictName = args["dict"];
|
||||
}
|
||||
const word dictName("noiseDict");
|
||||
|
||||
IOdictionary dict
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
dictName,
|
||||
runTime.system(),
|
||||
runTime,
|
||||
IOobject::MUST_READ
|
||||
)
|
||||
);
|
||||
IOdictionary dict(systemDict(dictName, args, runTime));
|
||||
|
||||
// reference pressure
|
||||
scalar pRef = dict.lookupOrDefault("pRef", 0.0);
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -83,6 +83,7 @@ See also
|
||||
#include "Time.H"
|
||||
#include "Table.H"
|
||||
#include "IOdictionary.H"
|
||||
#include "systemDict.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
Reference in New Issue
Block a user