From d77218b427c34d959e32d8b7f4ce29d3426a1954 Mon Sep 17 00:00:00 2001 From: Henry Date: Sun, 1 Feb 2015 12:34:19 +0000 Subject: [PATCH] POSIX/debug: Add ./system on the list of etc directories in particular to pick-up the DebugSwitches from system/controlDict at global construction time. Disadvantage is that system/controlDict is only picked-up if the OpenFOAM application is executed IN the case directory. The directory provided by the -case option is not yet known as the arguments have not yet been parsed. --- src/OSspecific/POSIX/POSIX.C | 14 +++++++++++++- src/OpenFOAM/global/debug/debug.C | 5 +---- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/OSspecific/POSIX/POSIX.C b/src/OSspecific/POSIX/POSIX.C index 920778116..717957faf 100644 --- a/src/OSspecific/POSIX/POSIX.C +++ b/src/OSspecific/POSIX/POSIX.C @@ -277,11 +277,23 @@ Foam::fileNameList Foam::findEtcFiles { fileNameList results; + // Search for user files in ./system + // Assumes the application is executed in the case directory + fileName searchDir = "system"; + if (isDir(searchDir)) + { + fileName fullName = searchDir/name; + if (isFile(fullName)) + { + results.append(fullName); + } + } + // Search for user files in // * ~/.OpenFOAM/VERSION // * ~/.OpenFOAM // - fileName searchDir = home()/".OpenFOAM"; + searchDir = home()/".OpenFOAM"; if (isDir(searchDir)) { fileName fullName = searchDir/FOAMversion/name; diff --git a/src/OpenFOAM/global/debug/debug.C b/src/OpenFOAM/global/debug/debug.C index 479c56db0..19b579a46 100644 --- a/src/OpenFOAM/global/debug/debug.C +++ b/src/OpenFOAM/global/debug/debug.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -364,7 +364,4 @@ Foam::simpleObjectRegistry& Foam::debug::dimensionedConstantObjects() } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - - // ************************************************************************* //