Initial commit for version 2.0.x patch release
[OpenFOAM-2.0.x.git] / applications / test / ensightFoamReader / ensightFoamReaderTest
blobb0935ad1f0bd718e7c3822182c0359709206b8fb
1 #!/bin/sh
2 #------------------------------------------------------------------------------
3 # ========= |
4 # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 # \\ / O peration |
6 # \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
7 # \\/ M anipulation |
8 #-------------------------------------------------------------------------------
9 # License
10 # This file is part of OpenFOAM.
12 # OpenFOAM is free software: you can redistribute it and/or modify it
13 # under the terms of the GNU General Public License as published by
14 # the Free Software Foundation, either version 3 of the License, or
15 # (at your option) any later version.
17 # OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
18 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
19 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
20 # for more details.
22 # You should have received a copy of the GNU General Public License
23 # along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 # Script
26 # ensightFoamReaderTest
28 # Description
29 # start ensightFoamReader-udr_checker
31 #------------------------------------------------------------------------------
32 usage() {
33 while [ "$#" -ge 1 ]; do echo "$1"; shift; done
34 cat<<USAGE
36 usage: ${0##*/} [OPTION]
37 options:
38 -case dir specify alternative case directory
40 * start ensightFoamReader-udr_checker
42 USAGE
43 exit 1
46 # parse options
47 while [ "$#" -gt 0 ]
49 case "$1" in
50 -h | -help)
51 usage
53 -case)
54 [ "$#" -ge 2 ] || usage "'$1' option requires an argument"
55 cd "$2" 2>/dev/null || usage "directory does not exist: '$2'"
56 shift 2
59 usage "unknown option/argument: '$*'"
61 esac
62 done
65 # check existence of essential files
66 for check in system/controlDict system/fvSchemes system/fvSolution
68 [ -s "$check" ] || usage "file does not exist: '$check'"
69 done
72 # export values that might be needed
73 export FOAM_CASE=$PWD
74 export FOAM_CASENAME=${PWD##*/}
76 pathName=${PWD%/*}
78 playFile=/tmp/ensightFoamReader.$$
79 trap "rm -f $playFile 2>/dev/null; exit 0" EXIT TERM INT
81 cat << PLAY_FILE > $playFile
82 $pathName
83 $FOAM_CASENAME
85 PLAY_FILE
87 echo "ensightFoamReader-udr_checker -p $playFile"
89 ensightFoamReader-udr_checker -p $playFile
91 #------------------------------------------------------------------------------