mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
STYLE: use shell 'command' instead of 'which' in tutorials
This commit is contained in:
@ -85,20 +85,18 @@ EOF
|
||||
|
||||
echo "createGraphs:"
|
||||
|
||||
# test if gnuplot exists on the system
|
||||
if ! which gnuplot > /dev/null 2>&1
|
||||
then
|
||||
echo "FOAM FATAL ERROR: gnuplot not found - skipping graph creation" >&2
|
||||
# Test if gnuplot exists on the system
|
||||
command -v gnuplot >/dev/null 2>&1 || {
|
||||
echo "FOAM FATAL ERROR: gnuplot not found - skipping graph creation" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
SETSDIR="../postProcessing/sample"
|
||||
|
||||
if [ ! -d $SETSDIR ]
|
||||
then
|
||||
echo "FOAM FATAL ERROR: result sets not available in directory $SETSDIR" >&2
|
||||
[ -d "$SETSDIR" ] || {
|
||||
echo "FOAM FATAL ERROR: result sets not available in directory $SETSDIR" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
# paths to data
|
||||
LATESTTIME=$(ls $SETSDIR)
|
||||
|
||||
@ -30,28 +30,25 @@
|
||||
# Joule heating case
|
||||
#
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
|
||||
# Stop on first error
|
||||
set -e
|
||||
|
||||
# test if gnuplot exists on the system
|
||||
if ! which gnuplot > /dev/null 2>&1
|
||||
then
|
||||
echo "FOAM FATAL ERROR: gnuplot not found - skipping graph creation" >&2
|
||||
# Test if gnuplot exists on the system
|
||||
command -v gnuplot >/dev/null 2>&1 || {
|
||||
echo "FOAM FATAL ERROR: gnuplot not found - skipping graph creation" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
echo "Creating graph"
|
||||
OFDATA='postProcessing/sample1/solid/20000/centreLine_T_jouleHeatingSource:V_jouleHeatingSource:sigma.xy'
|
||||
|
||||
if [ ! -f "$OFDATA" ]
|
||||
then
|
||||
echo "FOAM FATAL ERROR: OpenFOAM results not available in $OFDATA" >&2
|
||||
[ -f "$OFDATA" ] || {
|
||||
echo "FOAM FATAL ERROR: OpenFOAM results not available in $OFDATA" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
gnuplot<<EOF
|
||||
set terminal postscript eps color enhanced
|
||||
|
||||
Reference in New Issue
Block a user