Add command-line option '-nativeReader' to paraFoam

This commit is contained in:
Martin Beaudoin 2013-07-05 08:50:12 -07:00
parent a0638c3c25
commit c1b2dfb509

View file

@ -1,4 +1,4 @@
#!/bin/sh #!/bin/bash
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# ========= | # ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
@ -38,7 +38,8 @@ usage: ${0##*/} [OPTION]
options: options:
-case dir specify alternative case directory -case dir specify alternative case directory
-region name specify mesh region name -region name specify mesh region name
-touch only create the .OpenFOAM file -touch only create the .OpenFOAM or .foam file
-nativeReader use the paraview native reader for OpenFOAM
* start paraview $ParaView_VERSION with the OpenFOAM libraries * start paraview $ParaView_VERSION with the OpenFOAM libraries
@ -46,7 +47,7 @@ USAGE
exit 1 exit 1
} }
unset regionName touchOnly unset regionName touchOnly useNativeReader
# parse options # parse options
while [ "$#" -gt 0 ] while [ "$#" -gt 0 ]
@ -69,6 +70,10 @@ do
touchOnly=true touchOnly=true
shift shift
;; ;;
-nativeReader)
useNativeReader=true
shift
;;
*) *)
usage "unknown option/argument: '$*'" usage "unknown option/argument: '$*'"
;; ;;
@ -77,12 +82,24 @@ done
# get a sensible caseName # get a sensible caseName
caseName=${PWD##*/} caseName=${PWD##*/}
caseFile="$caseName.OpenFOAM"
if [ -n "$useNativeReader" ]
then
caseFile="$caseName.foam"
else
caseFile="$caseName.OpenFOAM"
fi
fvControls="system" fvControls="system"
if [ -n "$regionName" ] if [ -n "$regionName" ]
then then
if [ -n "$useNativeReader" ]
then
caseFile="$caseName{$regionName}.foam"
else
caseFile="$caseName{$regionName}.OpenFOAM" caseFile="$caseName{$regionName}.OpenFOAM"
fi
fvControls="$fvControls/$regionName" fvControls="$fvControls/$regionName"
fi fi