OpenFOAM-4.x/tutorials/compressible/rhoCentralFoam/biconic25-55Run35/sampleCone
Henry Weller 1bad0a52f1 tutorials: corrected scripts ']; then' -> ' ]; then'
Patch contributed by Bruno Santos
Resolves bug-report http://bugs.openfoam.org/view.php?id=2175
2016-08-02 19:13:25 +01:00

56 lines
1 KiB
Bash
Executable file

#!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory
#
# FUNCTIONS
#
usage()
{
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
cat<<USAGE
Usage: ${0##*/} [OPTION]
options:
-l -latestTime option for sample
-h help
Runs a set of samples across the cone face and concatenates output files
USAGE
exit 1
}
#------------------------------------------------------------------------------
unset timeOpt
# parse options
while [ "$#" -gt 0 ]
do
case "$1" in
-h | -help)
usage
;;
-l | -latestTime)
timeOpt="-latestTime"
shift
;;
*)
usage "unknown option/argument: '$*'"
;;
esac
done
sample $timeOpt
SDIR=sets
LSDIR=`ls $SDIR | head -1`
EXAMPLE_FILE=`ls -1 $SDIR/${LSDIR}/* | head -1`
FS=`basename $EXAMPLE_FILE | cut -d_ -f2-`
for d in $SDIR/*
do
cat ${d}/cone25_${FS} ${d}/cone55_${FS} ${d}/base_${FS} > ${d}/biconic_${FS}
done
#------------------------------------------------------------------------------