2 #------------------------------------------------------------------------------
4 # \\ / F ield | foam-extend: Open Source CFD
6 # \\ / A nd | For copyright notice see file Copyright
8 #------------------------------------------------------------------------------
10 # This file is part of foam-extend.
12 # foam-extend 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 3 of the License, or (at your
15 # option) any later version.
17 # foam-extend is distributed in the hope that it will be useful, but
18 # WITHOUT ANY WARRANTY; without even the implied warranty of
19 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 # General Public License for more details.
22 # You should have received a copy of the GNU General Public License
23 # along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
30 #------------------------------------------------------------------------------
37 Quickly tests the tutorials and writes out the scheme/solver information
40 -d sets up a default scheme on all schemes
45 setDefaultFvSchemes
() {
47 gradSchemes { default Gauss linear; }
51 div(phi,fu_ft_h) Gauss multivariateSelection
57 div(phi,ft_b_h_hu) Gauss multivariateSelection
66 laplacianSchemes { default Gauss linear corrected; }
67 interpolationSchemes { default linear; }
68 snGradSchemes { default corrected; }
69 fluxRequired { default yes; }
78 $HOME/.
$WM_PROJECT-$WM_PROJECT_VERSION \
79 $HOME/.
$WM_PROJECT/$WM_PROJECT_VERSION \
84 if [ -f "$i/controlDict" ]; then
85 MAIN_CONTROL_DICT
="$i/controlDict"
90 TEST_RUN_DIR
=..
/tutorialsTest
100 SCHEMES_FILE
="FvSchemes"
101 SCHEMES_TEMP
="FvSchemes.temp"
102 SOLVERS_FILE
="FvSolution"
103 SOLVERS_TEMP
="FvSolution.temp"
110 if [ $?
-ne 0 ] ; then
111 echo "Aborting due to invalid option"
116 while [ $1 != -- ]; do
118 -d) DEFAULT_SCHEMES
=1;;
119 -h) printUsage
; exit 1;;
129 if [ -d "$TEST_RUN_DIR" ] ; then
133 echo "Modifying ${MAIN_CONTROL_DICT}"
134 if [ -e ${MAIN_CONTROL_DICT}.org
]
136 echo "File " ${MAIN_CONTROL_DICT}.org
" already exists"
137 echo "Did Alltest fail in some way and then run again?"
141 # Clean up on termination and on Ctrl-C
142 trap 'mv ${MAIN_CONTROL_DICT}.org ${MAIN_CONTROL_DICT} 2>/dev/null; exit 0' \
144 cp ${MAIN_CONTROL_DICT} ${MAIN_CONTROL_DICT}.org
147 -e s
/"\(fvSchemes[ \t]*\)\([0-9]\);"/"\1 1;"/g \
148 -e s
/"\(fvSolution[ \t]*\)\([0-9]\);"/"\1 1;"/g \
149 ${MAIN_CONTROL_DICT}.org
> ${MAIN_CONTROL_DICT}
151 echo "Copying the tutorials"
152 cp -a ${TUTORIALS_DIR} ${TEST_RUN_DIR}
154 echo "Modifying the controlDicts to run only one time step"
157 for CD
in `find . -name "controlDict*"`
161 -e s
/"\(startFrom[ \t]*\)\([a-zA-Z]*\);"/"\1 latestTime;"/g \
162 -e s
/"\(stopAt[ \t]*\)\([a-zA-Z]*\);"/"\1 nextWrite;"/g \
163 -e s
/"\(writeControl[ \t]*\)\([a-zA-Z]*\);"/"\1 timeStep;"/g \
164 -e s
/"\(writeInterval[ \t]*\)\([0-9a-zA-Z.-]*\);"/"\1 1;"/g \
168 if [ $DEFAULT_SCHEMES = 1 ] ; then
169 echo "Modifying the fvSchemes to contain only default schemes"
170 for FV_SC
in `find . -name fvSchemes`
174 mv ${FV_SC} ${FV_SC}.org
175 sed -e /"${S}"/,/$p/d ${FV_SC}.org > ${FV_SC}
177 setDefaultFvSchemes >> ${FV_SC}
183 sed -e :a -e '/\\$/N; s/\\\n//; ta' Allrun > temp
185 `grep "applications
=" temp | sed 's/applications=\"\([A-Za-z \t]*\)\"/\1/g'`
187 rm $SCHEMES_FILE > /dev/null 2>&1
188 for APP in $APPLICATIONS
190 echo $APP >> $SCHEMES_FILE
191 echo "$APP: " | tr -d "\n" >> $SOLVERS_FILE
192 for ST in $FV_SCHEMES
194 rm $SCHEMES_TEMP > /dev/null 2>&1
195 rm $SOLVERS_TEMP > /dev/null 2>&1
196 echo " ${ST}" >> $SCHEMES_FILE
197 for LOG in `find ${APP} -name "log.
${APP}"`
199 for S in `grep ${ST} ${LOG} | cut -d" " -f4`
201 echo " ${S}" >> $SCHEMES_TEMP
203 echo `grep solver ${LOG} | cut -d" " -f4` >> $SOLVERS_TEMP
205 if [ -f $SCHEMES_TEMP ] ; then
206 cat $SCHEMES_TEMP | sort -u >> $SCHEMES_FILE
209 cat $SOLVERS_TEMP | tr " " "\n" | sort -u | tr "\n" " " >> $SOLVERS_FILE
210 echo "" >> $SOLVERS_FILE
214 # ----------------------------------------------------------------- end-of-file