2 #------------------------------------------------------------------------------
4 # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
6 # \\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd.
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 #------------------------------------------------------------------------------
35 . @FF_DATA_DIR@
/shellFunctions
/jobControlFunctions
40 Quickly tests the tutorials and writes out the scheme/solver information
43 -d sets up a default scheme on all schemes
48 setDefaultFvSchemes
() {
50 gradSchemes { default Gauss linear; }
54 div(phi,fu_ft_h) Gauss multivariateSelection
60 div(phi,ft_b_h_hu) Gauss multivariateSelection
69 laplacianSchemes { default Gauss linear corrected; }
70 interpolationSchemes { default linear; }
71 snGradSchemes { default corrected; }
72 fluxRequired { default yes; }
79 MAIN_CONTROL_DICT
=`findControlDict`
81 TEST_RUN_DIR
="$PWD/../tutorialsTest"
82 MODIFIED_CONTROL_DICT
="${TEST_RUN_DIR}/etc/controlDict"
92 SCHEMES_FILE
="FvSchemes"
93 SCHEMES_TEMP
="FvSchemes.temp"
94 SOLVERS_FILE
="FvSolution"
95 SOLVERS_TEMP
="FvSolution.temp"
102 if [ $?
-ne 0 ] ; then
103 echo "Aborting due to invalid option"
108 while [ $1 != -- ]; do
110 -d) DEFAULT_SCHEMES
=1;;
111 -h) printUsage
; exit 1;;
121 if [ -d "$TEST_RUN_DIR" ] ; then
125 echo "Copying the tutorials"
126 cp @FF_CP_A_FLAGS@
${TUTORIALS_DIR} ${TEST_RUN_DIR}
128 echo "Copying `dirname ${MAIN_CONTROL_DICT}` to ${TEST_RUN_DIR}/etc"
129 echo "and modifying ${MODIFIED_CONTROL_DICT}"
131 cp @FF_CP_A_FLAGS@
"`dirname ${MAIN_CONTROL_DICT}`" "${TEST_RUN_DIR}/etc"
134 -e s
/"\(fvSchemes[ \t]*\)\([0-9]\);"/"\1 1;"/g \
135 -e s
/"\(fvSolution[ \t]*\)\([0-9]\);"/"\1 1;"/g \
136 ${MAIN_CONTROL_DICT} > ${MODIFIED_CONTROL_DICT}
138 echo "Modifying the controlDicts to run only one time step"
141 for CD
in `find . -name "controlDict*"`
145 -e s
/"\(startFrom[ \t]*\)\([a-zA-Z]*\);"/"\1 latestTime;"/g \
146 -e s
/"\(stopAt[ \t]*\)\([a-zA-Z]*\);"/"\1 nextWrite;"/g \
147 -e s
/"\(writeControl[ \t]*\)\([a-zA-Z]*\);"/"\1 timeStep;"/g \
148 -e s
/"\(writeInterval[ \t]*\)\([0-9a-zA-Z.-]*\);"/"\1 1;"/g \
152 if [ $DEFAULT_SCHEMES = 1 ] ; then
153 echo "Modifying the fvSchemes to contain only default schemes"
154 for FV_SC
in `find . -name fvSchemes`
158 mv ${FV_SC} ${FV_SC}.org
159 sed -e /"${S}"/,/$p/d ${FV_SC}.org > ${FV_SC}
161 setDefaultFvSchemes >> ${FV_SC}
165 for f in `find ${TEST_RUN_DIR} -type f -name Allrun`; do
166 echo "Modifying
${f}"
167 cp -f @FF_CP_A_FLAGS@ ${f} ${f}.tmp
168 sed -e 's|^\(export FREEFOAM_TEST_MODE=\)no|\1yes|' ${f}.tmp \
169 -e "s|\
${TEST_CONFIG_DIR}|${TEST_RUN_DIR}/etc|g" > ${f}
175 sed -e :a
-e '/\\$/N; s/\\\n//; ta' Allrun
> temp
177 `grep "applications=" temp | sed 's/applications=\"\([A-Za-z \t]*\)\"/\1/g'`
179 rm $SCHEMES_FILE > /dev
/null
2>&1
180 for APP
in $APPLICATIONS
182 echo $APP >> $SCHEMES_FILE
183 echo "$APP: " |
tr -d "\n" >> $SOLVERS_FILE
184 for ST
in $FV_SCHEMES
186 rm $SCHEMES_TEMP > /dev
/null
2>&1
187 rm $SOLVERS_TEMP > /dev
/null
2>&1
188 echo " ${ST}" >> $SCHEMES_FILE
189 for LOG
in `find ${APP} -name "log.${APP}"`
191 for S
in `grep ${ST} ${LOG} | cut -d" " -f4`
193 echo " ${S}" >> $SCHEMES_TEMP
195 echo `grep solver ${LOG} | cut -d" " -f4` >> $SOLVERS_TEMP
197 if [ -f $SCHEMES_TEMP ] ; then
198 cat $SCHEMES_TEMP |
sort -u >> $SCHEMES_FILE
201 cat $SOLVERS_TEMP |
tr " " "\n" |
sort -u |
tr "\n" " " >> $SOLVERS_FILE
202 echo "" >> $SOLVERS_FILE
206 # ----------------------------------------------------------------- end-of-file