2 #------------------------------------------------------------------------------
4 # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
6 # \\ / A nd | Copyright held by original author
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 the
14 # Free Software Foundation; either version 2 of the License, or (at your
15 # 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, write to the Free Software Foundation,
24 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
31 #------------------------------------------------------------------------------
38 Quickly tests the tutorials and writes out the scheme/solver information
41 -d sets up a default scheme on all schemes
46 setDefaultFvSchemes
() {
48 gradSchemes { default Gauss linear; }
52 div(phi,fu_ft_h) Gauss multivariateSelection
58 div(phi,ft_b_h_hu) Gauss multivariateSelection
67 laplacianSchemes { default Gauss linear corrected; }
68 interpolationSchemes { default linear; }
69 snGradSchemes { default corrected; }
70 fluxRequired { default yes; }
79 $HOME/.
$WM_PROJECT-$WM_PROJECT_VERSION \
80 $HOME/.
$WM_PROJECT/$WM_PROJECT_VERSION \
85 if [ -f "$i/controlDict" ]; then
86 MAIN_CONTROL_DICT
="$i/controlDict"
91 TEST_RUN_DIR
=..
/tutorialsTest
101 SCHEMES_FILE
="FvSchemes"
102 SCHEMES_TEMP
="FvSchemes.temp"
103 SOLVERS_FILE
="FvSolution"
104 SOLVERS_TEMP
="FvSolution.temp"
111 if [ $?
-ne 0 ] ; then
112 echo "Aborting due to invalid option"
117 while [ $1 != -- ]; do
119 -d) DEFAULT_SCHEMES
=1;;
120 -h) printUsage
; exit 1;;
130 if [ -d "$TEST_RUN_DIR" ] ; then
134 echo "Modifying ${MAIN_CONTROL_DICT}"
135 if [ -e ${MAIN_CONTROL_DICT}.org
]
137 echo "File " ${MAIN_CONTROL_DICT}.org
" already exists"
138 echo "Did Alltest fail in some way and then run again?"
142 # Clean up on termination and on Ctrl-C
143 trap 'mv ${MAIN_CONTROL_DICT}.org ${MAIN_CONTROL_DICT} 2>/dev/null; exit 0' \
145 cp ${MAIN_CONTROL_DICT} ${MAIN_CONTROL_DICT}.org
148 -e s
/"\(fvSchemes[ \t]*\)\([0-9]\);"/"\1 1;"/g \
149 -e s
/"\(fvSolution[ \t]*\)\([0-9]\);"/"\1 1;"/g \
150 ${MAIN_CONTROL_DICT}.org
> ${MAIN_CONTROL_DICT}
152 echo "Copying the tutorials"
153 cp -a ${TUTORIALS_DIR} ${TEST_RUN_DIR}
155 echo "Modifying the controlDicts to run only one time step"
158 for CD
in `find . -name "controlDict*"`
162 -e s
/"\(startFrom[ \t]*\)\([a-zA-Z]*\);"/"\1 latestTime;"/g \
163 -e s
/"\(stopAt[ \t]*\)\([a-zA-Z]*\);"/"\1 nextWrite;"/g \
164 -e s
/"\(writeControl[ \t]*\)\([a-zA-Z]*\);"/"\1 timeStep;"/g \
165 -e s
/"\(writeInterval[ \t]*\)\([0-9a-zA-Z.-]*\);"/"\1 1;"/g \
169 if [ $DEFAULT_SCHEMES = 1 ] ; then
170 echo "Modifying the fvSchemes to contain only default schemes"
171 for FV_SC
in `find . -name fvSchemes`
175 mv ${FV_SC} ${FV_SC}.org
176 sed -e /"${S}"/,/$p/d ${FV_SC}.org > ${FV_SC}
178 setDefaultFvSchemes >> ${FV_SC}
184 sed -e :a -e '/\\$/N; s/\\\n//; ta' Allrun > temp
186 `grep "applications
=" temp | sed 's/applications=\"\([A-Za-z \t]*\)\"/\1/g'`
188 rm $SCHEMES_FILE > /dev/null 2>&1
189 for APP in $APPLICATIONS
191 echo $APP >> $SCHEMES_FILE
192 echo "$APP: " | tr -d "\n" >> $SOLVERS_FILE
193 for ST in $FV_SCHEMES
195 rm $SCHEMES_TEMP > /dev/null 2>&1
196 rm $SOLVERS_TEMP > /dev/null 2>&1
197 echo " ${ST}" >> $SCHEMES_FILE
198 for LOG in `find ${APP} -name "log.
${APP}"`
200 for S in `grep ${ST} ${LOG} | cut -d" " -f4`
202 echo " ${S}" >> $SCHEMES_TEMP
204 echo `grep solver ${LOG} | cut -d" " -f4` >> $SOLVERS_TEMP
206 if [ -f $SCHEMES_TEMP ] ; then
207 cat $SCHEMES_TEMP | sort -u >> $SCHEMES_FILE
210 cat $SOLVERS_TEMP | tr " " "\n" | sort -u | tr "\n" " " >> $SOLVERS_FILE
211 echo "" >> $SOLVERS_FILE
215 # ----------------------------------------------------------------- end-of-file