diff --git a/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3Foam.C b/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3Foam.C index fea710ac1a..7780ad3cfd 100644 --- a/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3Foam.C +++ b/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3Foam.C @@ -247,15 +247,20 @@ Foam::vtkPV3Foam::vtkPV3Foam setEnv("FOAM_CASE", fullCasePath, true); } - // get the caseName, and look for '=regionName' in it - // we could also be more stringent and insist that the - // prefix match the directory name, etc .. - fileName caseName(fileName(FileName).lessExt()); + // look for 'case{region}.OpenFOAM' + // could be stringent and insist the prefix match the directory name... + // Note: cannot use fileName::name() due to the embedded '{}' + string caseName(fileName(FileName).lessExt()); + string::size_type beg = caseName.find_last_of("/{"); + string::size_type end = caseName.find('}', beg); - string::size_type delimiter = caseName.find("="); - if (delimiter != string::npos) + if + ( + beg != string::npos && caseName[beg] == '{' + && end != string::npos && end == caseName.size()-1 + ) { - meshRegion_ = caseName.substr(delimiter+1); + meshRegion_ = caseName.substr(beg+1, end-beg-1); // some safety if (!meshRegion_.size()) diff --git a/bin/paraFoam b/bin/paraFoam index c6c4d544f9..101bba1674 100755 --- a/bin/paraFoam +++ b/bin/paraFoam @@ -81,12 +81,12 @@ caseName=${PWD##*/} caseFile="$caseName.OpenFOAM" if [ -n "$regionName" ] then - caseFile="$caseName=$regionName.OpenFOAM" + caseFile="$caseName{$regionName}.OpenFOAM" fi if [ -n "$touchOnly" ]; then - touch $caseFile + touch "$caseFile" echo "created '$caseFile'" exit 0 fi @@ -120,10 +120,11 @@ case "$ParaView_VERSION" in # only create/remove caseFile if it doesn't exist [ -e $caseFile ] || { trap "rm -f $caseFile 2>/dev/null; exit 0" EXIT TERM INT - touch $caseFile + touch "$caseFile" + echo "created temporary '$caseFile'" } - paraview --data=$caseFile + paraview --data="$caseFile" ;; esac