diff --git a/applications/test/dictionary/testDictAPI b/applications/test/dictionary/testDictAPI new file mode 100644 index 0000000000000000000000000000000000000000..e6091cb9d0b4aff850b3d63b0261f35ab9af5384 --- /dev/null +++ b/applications/test/dictionary/testDictAPI @@ -0,0 +1,19 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v1812 | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object testDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +_FOAM_API $FOAM_API; + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/applications/utilities/postProcessing/graphics/PVReaders/vtkPVFoam/vtkPVFoam.C b/applications/utilities/postProcessing/graphics/PVReaders/vtkPVFoam/vtkPVFoam.C index 1cf6e69aaf718c77be7f598239d47d94d0c4a38b..794949c3f9105ada66b53eef3b9648debc04b84e 100644 --- a/applications/utilities/postProcessing/graphics/PVReaders/vtkPVFoam/vtkPVFoam.C +++ b/applications/utilities/postProcessing/graphics/PVReaders/vtkPVFoam/vtkPVFoam.C @@ -30,6 +30,7 @@ License #include "areaFaMesh.H" #include "faMesh.H" #include "fvMesh.H" +#include "foamVersion.H" #include "Time.H" #include "patchZones.H" #include "IOobjectList.H" @@ -314,6 +315,9 @@ Foam::vtkPVFoam::vtkPVFoam fullCasePath = cwd(); } + // OPENFOAM API + setEnv("FOAM_API", std::to_string(foamVersion::api), true); + // The name of the executable, unless already present in the environment setEnv("FOAM_EXECUTABLE", "paraview", false); diff --git a/applications/utilities/postProcessing/graphics/PVReaders/vtkPVblockMesh/vtkPVblockMesh.C b/applications/utilities/postProcessing/graphics/PVReaders/vtkPVblockMesh/vtkPVblockMesh.C index 6a9037c38540e54f51f46a3ed603652210c35b1e..efec807d266af56655fd4865ace86adefa4e5817 100644 --- a/applications/utilities/postProcessing/graphics/PVReaders/vtkPVblockMesh/vtkPVblockMesh.C +++ b/applications/utilities/postProcessing/graphics/PVReaders/vtkPVblockMesh/vtkPVblockMesh.C @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation - \\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd. + \\/ M anipulation | Copyright (C) 2017-2019 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -29,6 +29,7 @@ License // OpenFOAM includes #include "blockMesh.H" #include "blockMeshTools.H" +#include "foamVersion.H" #include "Time.H" #include "patchZones.H" #include "StringStream.H" @@ -206,6 +207,9 @@ Foam::vtkPVblockMesh::vtkPVblockMesh fullCasePath = cwd(); } + // OPENFOAM API + setEnv("FOAM_API", std::to_string(foamVersion::api), true); + // The name of the executable, unless already present in the environment setEnv("FOAM_EXECUTABLE", "paraview", false); diff --git a/etc/config.csh/unset b/etc/config.csh/unset index 3041f8931a973ced95b85f6e66432900d2c04263..8a453c36891b46025b889e7032025202742206e6 100644 --- a/etc/config.csh/unset +++ b/etc/config.csh/unset @@ -3,7 +3,7 @@ # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | # \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation -# \\/ M anipulation | Copyright (C) 2016-2017 OpenCFD Ltd. +# \\/ M anipulation | Copyright (C) 2016-2019 OpenCFD Ltd. #------------------------------------------------------------------------------ # License # This file is part of OpenFOAM, licensed under GNU General Public License @@ -73,6 +73,7 @@ unsetenv WM_THIRD_PARTY_DIR #------------------------------------------------------------------------------ # Unset FOAM_* environment variables +unsetenv FOAM_API unsetenv FOAM_APPBIN unsetenv FOAM_APP unsetenv FOAM_CODE_TEMPLATES diff --git a/etc/config.sh/unset b/etc/config.sh/unset index 4d3c5fd0e410a089790bedaeee7d73d3f891a2d4..2153e87f94cd6ce9701985513b65dd69892c44f9 100644 --- a/etc/config.sh/unset +++ b/etc/config.sh/unset @@ -3,7 +3,7 @@ # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | # \\ / A nd | Copyright (C) 2011-2016 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, licensed under GNU General Public License @@ -63,6 +63,7 @@ unset WM_THIRD_PARTY_DIR #------------------------------------------------------------------------------ # Unset FOAM_* environment variables +unset FOAM_API unset FOAM_APPBIN unset FOAM_APP unset FOAM_CODE_TEMPLATES diff --git a/src/OpenFOAM/global/argList/argList.C b/src/OpenFOAM/global/argList/argList.C index f7c622e746b4d68748bd08f7228def6815957556..51fc94869d065dd9e6ab7b51d9b5d042cfac5f2e 100644 --- a/src/OpenFOAM/global/argList/argList.C +++ b/src/OpenFOAM/global/argList/argList.C @@ -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); diff --git a/src/OpenFOAM/global/argList/argList.H b/src/OpenFOAM/global/argList/argList.H index e569e02e5256b78141c58c1cdf881a869f089831..a33bfda34317693ac5de5b824fdd0c285683c342 100644 --- a/src/OpenFOAM/global/argList/argList.H +++ b/src/OpenFOAM/global/argList/argList.H @@ -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.