ENH: export FOAM_API in dictionary (issue #1158)

- uses the value of foamVersion::api, which should be reliable.
This commit is contained in:
Mark Olesen
2019-01-07 19:04:50 +01:00
parent 62a7582d6d
commit cf8d500f8c
7 changed files with 39 additions and 5 deletions

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015-2018 OpenCFD Ltd.
\\/ M anipulation | Copyright (C) 2015-2019 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -672,6 +672,9 @@ void Foam::argList::setCasePaths()
globalCase_ = caseDir.name();
case_ = globalCase_; // The (processor) local case name
// OPENFOAM API
setEnv("FOAM_API", std::to_string(foamVersion::api), true);
// Global case (directory) and case-name as environment variables
setEnv("FOAM_CASE", caseDir, true);
setEnv("FOAM_CASENAME", globalCase_, true);

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2016-2018 OpenCFD Ltd.
\\/ M anipulation | Copyright (C) 2016-2019 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -57,6 +57,8 @@ Description
may be present for some solvers or utilities.
Environment variables set by argList or by Time:
- \par FOAM_API
The value of foamVersion::api
- \par FOAM_CASE
The path of the global case.
It is the same for serial and parallel jobs.