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 5da86f74521634301b5a315c7f5dce399070031a..7bb62bb04115f25b38ca20191a34437bb2329b41 100644 --- a/applications/utilities/postProcessing/graphics/PVReaders/vtkPVFoam/vtkPVFoam.C +++ b/applications/utilities/postProcessing/graphics/PVReaders/vtkPVFoam/vtkPVFoam.C @@ -310,6 +310,9 @@ Foam::vtkPVFoam::vtkPVFoam fullCasePath = cwd(); } + // OPENFOAM API + setEnv("FOAM_API", std::to_string(OPENFOAM_PLUS), 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..ef972eb9f0c90bdd46607a6264b82cfda72820c7 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. @@ -206,6 +206,9 @@ Foam::vtkPVblockMesh::vtkPVblockMesh fullCasePath = cwd(); } + // OPENFOAM API + setEnv("FOAM_API", std::to_string(OPENFOAM_PLUS), 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 9d62c3ac3873166b6503578dc61139754d20de53..c34673ed79d215a140391753a66744abba282f47 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 @@ -72,6 +72,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 d5d4a8530e33649679fe4278d26e50ecc1b5b0b4..99c4c1330a371db8563e2eccff4b5aa430e9a312 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-2017 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 7054cf8c9899fd405712a1afda12ed1a1fb660c5..e72405bbe8d5571129da1ec83269c244b7aa1428 100644 --- a/src/OpenFOAM/global/argList/argList.C +++ b/src/OpenFOAM/global/argList/argList.C @@ -585,6 +585,9 @@ void Foam::argList::getRootCase() // The name of the executable, unless already present in the environment setEnv("FOAM_EXECUTABLE", executable_, false); + // OPENFOAM API + setEnv("FOAM_API", std::to_string(OPENFOAM_PLUS), true); + // Set the case and case-name as an environment variable if (rootPath_.isAbsolute()) { diff --git a/src/OpenFOAM/global/argList/argList.H b/src/OpenFOAM/global/argList/argList.H index ef4951fc72b0a01ac8c61653374738e3ae5686f8..80541d45f13e0f9cdbfb3d067f1ab1c2b918afa2 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-2017 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 the OPENFOAM compiler define - \par FOAM_CASE The path of the global case. It is the same for serial and parallel jobs.