2 #------------------------------------------------------------------------------
4 # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
6 # \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
8 #------------------------------------------------------------------------------
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
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/>.
29 # quickly tests the tutorials and writes out the scheme/solver information
31 #------------------------------------------------------------------------------
32 cd ${0%/*} ||
exit 1 # run from this directory
36 while [ "$#" -ge 1 ]; do echo "$1"; shift; done
39 usage: ${0##*/} [OPTION]
42 -default sets up a default scheme on all schemes
45 * quickly tests the tutorials and writes out the scheme/solver information
51 #------------------------------------------------------------------------------
67 usage
"unknown option: '$*'"
79 gradSchemes { default Gauss linear; }
83 div(phi,fu_ft_h) Gauss multivariateSelection
89 div(phi,ft_b_h_hu) Gauss multivariateSelection
98 laplacianSchemes { default Gauss linear corrected; }
99 interpolationSchemes { default linear; }
100 snGradSchemes { default corrected; }
101 fluxRequired { default yes; }
108 unset MAIN_CONTROL_DICT
111 $HOME/.
$WM_PROJECT/$WM_PROJECT_VERSION \
113 $WM_PROJECT_DIR/etc \
116 if [ -f "$i/controlDict" ]
118 MAIN_CONTROL_DICT
="$i/controlDict"
123 [ -f "$MAIN_CONTROL_DICT" ] || usage
"main controlDict not found"
127 TEST_RUN_DIR
=..
/tutorialsTest
133 interpolationScheme \
137 SCHEMES_FILE
="FvSchemes"
138 SCHEMES_TEMP
="FvSchemes.temp"
139 SOLVERS_FILE
="FvSolution"
140 SOLVERS_TEMP
="FvSolution.temp"
147 if [ -d "$TEST_RUN_DIR" ]
152 echo "Modifying ${MAIN_CONTROL_DICT}"
153 if [ -e ${MAIN_CONTROL_DICT}.org
]
155 echo "File ${MAIN_CONTROL_DICT}.org already exists"
156 echo "Did Alltest fail in some way and then run again?"
160 # Clean up on termination and on Ctrl-C
161 trap 'mv ${MAIN_CONTROL_DICT}.org ${MAIN_CONTROL_DICT} 2>/dev/null; exit 0' \
163 cp ${MAIN_CONTROL_DICT} ${MAIN_CONTROL_DICT}.org
166 -e s
/"\(fvSchemes[ \t]*\)\([0-9]\);"/"\1 1;"/g \
167 -e s
/"\(solution[ \t]*\)\([0-9]\);"/"\1 1;"/g \
168 ${MAIN_CONTROL_DICT}.org
> ${MAIN_CONTROL_DICT}
170 echo "Copying the tutorials"
171 cp -a ${TUTORIALS_DIR} ${TEST_RUN_DIR}
173 echo "Modifying the controlDicts to run only one time step"
174 cd ${TEST_RUN_DIR} ||
exit 1
176 for CD
in `find . -name "controlDict*"`
180 -e s
/"\(startFrom[ \t]*\)\([a-zA-Z]*\);"/"\1 latestTime;"/g \
181 -e s
/"\(stopAt[ \t]*\)\([a-zA-Z]*\);"/"\1 nextWrite;"/g \
182 -e s
/"\(writeControl[ \t]*\)\([a-zA-Z]*\);"/"\1 timeStep;"/g \
183 -e s
/"\(writeInterval[ \t]*\)\([0-9a-zA-Z.-]*\);"/"\1 1;"/g \
187 if [ "$DEFAULT_SCHEMES" = true
]
189 echo "Modifying the fvSchemes to contain only default schemes"
190 for FV_SC
in `find . -name fvSchemes`
194 mv ${FV_SC} ${FV_SC}.org
195 sed -e /"${S}"/,/$p/d ${FV_SC}.org > ${FV_SC}
197 setDefaultFvSchemes >> ${FV_SC}
203 sed -e :a -e '/\\$/N; s/\\\n//; ta' Allrun > temp
205 `grep "applications
=" temp | sed 's/applications=\"\([A-Za-z \t]*\)\"/\1/g'`
207 rm $SCHEMES_FILE > /dev/null 2>&1
208 for APP in $APPLICATIONS
210 echo $APP >> $SCHEMES_FILE
211 echo "$APP: " | tr -d "\n" >> $SOLVERS_FILE
212 for ST in $FV_SCHEMES
214 rm $SCHEMES_TEMP $SOLVERS_TEMP > /dev/null 2>&1
215 echo " ${ST}" >> $SCHEMES_FILE
216 for LOG in `find ${APP} -name "log.
${APP}"`
218 for S in `grep ${ST} ${LOG} | cut -d" " -f4`
220 echo " ${S}" >> $SCHEMES_TEMP
222 echo `grep solver ${LOG} | cut -d" " -f4` >> $SOLVERS_TEMP
224 if [ -f $SCHEMES_TEMP ]
226 cat $SCHEMES_TEMP | sort -u >> $SCHEMES_FILE
229 cat $SOLVERS_TEMP | tr " " "\n" | sort -u | tr "\n" " " >> $SOLVERS_FILE
230 echo "" >> $SOLVERS_FILE
233 # ----------------------------------------------------------------- end-of-file