diff --git a/partitioned-heat-conduction/fenics/run.sh b/partitioned-heat-conduction/fenics/run.sh index e31f07a10..e51fb750b 100755 --- a/partitioned-heat-conduction/fenics/run.sh +++ b/partitioned-heat-conduction/fenics/run.sh @@ -1,6 +1,14 @@ #!/bin/sh set -e -u +usage() { echo "Usage: cmd [-d] [-n]" 1>&2; exit 1; } + +# Check if no input argument was provided +if [ -z "$*" ] ; then + usage +fi + +# Select appropriate case while getopts ":dn" opt; do case ${opt} in d) @@ -9,8 +17,8 @@ while getopts ":dn" opt; do n) python3 heat.py -n --error-tol 10e-3 ;; - \?) - echo "Usage: cmd [-d] [-n]" + *) + usage ;; esac done diff --git a/partitioned-heat-conduction/nutils/run.sh b/partitioned-heat-conduction/nutils/run.sh index 43e97b70f..b3048a04f 100755 --- a/partitioned-heat-conduction/nutils/run.sh +++ b/partitioned-heat-conduction/nutils/run.sh @@ -1,6 +1,13 @@ #!/bin/sh set -e -u +usage() { echo "Usage: cmd [-d] [-n]" 1>&2; exit 1; } + +# Check if no input argument was provided +if [ -z "$*" ] ; then + usage +fi + while getopts ":dn" opt; do case ${opt} in d) @@ -11,8 +18,8 @@ while getopts ":dn" opt; do rm -rf Neumann-*.vtk python3 heat.py --side=Neumann ;; - \?) - echo "Usage: cmd [-d] [-n]" + *) + usage ;; esac done