diff --git a/ReleaseNotes-1.6 b/ReleaseNotes-1.6 index 58955d3349..b18ce5659a 100644 --- a/ReleaseNotes-1.6 +++ b/ReleaseNotes-1.6 @@ -145,6 +145,8 @@ + The *new* =readList(Istream&)= can read a bracket-delimited list or handle a single value as a list of size 1. This can be a useful convenience when processing command-line options. + + Export *new* environment variable =FOAM_CASENAME= that contains the + name part of the =FOAM_CASE= environment variable *** Misc. improvements + Improved consistency and interoperability between =face= and =triFace= classes. diff --git a/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3Foam.C b/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3Foam.C index 04518db985..34628ac9d1 100644 --- a/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3Foam.C +++ b/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3Foam.C @@ -261,11 +261,15 @@ Foam::vtkPV3Foam::vtkPV3Foam // Set the case as an environment variable - some BCs might use this if (fullCasePath.name().find("processor", 0) == 0) { - setEnv("FOAM_CASE", fullCasePath.path(), true); + const fileName globalCase = fullCasePath.path(); + + setEnv("FOAM_CASE", globalCase, true); + setEnv("FOAM_CASENAME", globalCase.name(), true); } else { setEnv("FOAM_CASE", fullCasePath, true); + setEnv("FOAM_CASENAME", fullCasePath.name(), true); } // look for 'case{region}.OpenFOAM' @@ -299,6 +303,7 @@ Foam::vtkPV3Foam::vtkPV3Foam { Info<< "fullCasePath=" << fullCasePath << nl << "FOAM_CASE=" << getEnv("FOAM_CASE") << nl + << "FOAM_CASENAME=" << getEnv("FOAM_CASENAME") << nl << "region=" << meshRegion_ << endl; } diff --git a/src/OpenFOAM/global/argList/argList.C b/src/OpenFOAM/global/argList/argList.C index 707d68b88f..365bff3cfa 100644 --- a/src/OpenFOAM/global/argList/argList.C +++ b/src/OpenFOAM/global/argList/argList.C @@ -522,8 +522,9 @@ Foam::argList::argList } jobInfo.write(); - // Set the case as an environment variable + // Set the case and case-name as an environment variable setEnv("FOAM_CASE", rootPath_/globalCase_, true); + setEnv("FOAM_CASENAME", globalCase_, true); // Switch on signal trapping. We have to wait until after Pstream::init // since this sets up its own ones. diff --git a/src/OpenFOAM/global/argList/argList.H b/src/OpenFOAM/global/argList/argList.H index 9fdb0bb6d2..45c8de16ec 100644 --- a/src/OpenFOAM/global/argList/argList.H +++ b/src/OpenFOAM/global/argList/argList.H @@ -54,6 +54,8 @@ Description The environment variable @b FOAM_CASE is set to the path of the global case (same for serial and parallel jobs). + The environment variable @b FOAM_CASENAME is set to the name of the + global case. Note - Adjustment of the valid (mandatory) arguments