Commit b01662af authored by Andrew Heather's avatar Andrew Heather
Browse files
parents 750a8c78 e570205b
......@@ -23,10 +23,10 @@ License
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Application
turbFoam
stressComponents
Description
Calculates and writes the scalar fields of the six components of the stress
Calculates and writes the scalar fields of the six components of the stress
tensor sigma for each time.
\*---------------------------------------------------------------------------*/
......
......@@ -29,9 +29,12 @@
# Description
# pass-through filter for doxygen
#
# Filter has special treatment for applications/{solvers,utilities}/*.C
# - only keep the first comment block of the C source file
# - the corresponding H files are ignored in Doxyfile EXCLUDE_PATTERNS
# Special treatment for applications/{solvers,utilities}/*.C
# - only keep the first comment block of the C source file
# use @cond / @endcond to suppress documenting all classes/variables
#
# Special treatment for applications/{solvers,utilities}/*.H
# - use @cond / @endcond to suppress documenting all classes/variables
#------------------------------------------------------------------------------
if [ "$#" -gt 0 ]
......@@ -41,16 +44,19 @@ then
dirName=${filePath%/[^/]*}
fileName=${filePath##*/}
awkScript=$WM_PROJECT_DIR/bin/doxyAwk
awkScript=$WM_PROJECT_DIR/bin/tools/doxyFilt.awk
case "$1" in
*/applications/solvers/*.C | */applications/utilities/*.C )
awkScript=$WM_PROJECT_DIR/bin/doxyAwkTop
awkScript=$WM_PROJECT_DIR/bin/tools/doxyFilt-top.awk
;;
*/applications/solvers/*.H | */applications/utilities/*.H )
awkScript=$WM_PROJECT_DIR/bin/tools/doxyFilt-ignore.awk
;;
esac
awk -f $awkScript $1 | \
sed -f $WM_PROJECT_DIR/bin/doxyScr \
sed -f $WM_PROJECT_DIR/bin/tools/doxyFilt.sed \
-e s@%filePath%@$filePath@g \
-e s@%fileName%@$fileName@g \
-e s@%dirName%@$dirName@g
......
......@@ -4,7 +4,7 @@
# \\ / O peration |
# \\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
# \\/ M anipulation |
# ------------------------------------------------------------------------------
# -----------------------------------------------------------------------------
# License
# This file is part of OpenFOAM.
#
......@@ -23,41 +23,23 @@
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
# Script
# doxyAwkTop
# doxyFilt-ignore.awk
#
# Description
# Output only the first /* ... */ comment section found in the file
# - This is useful for application files in which only the first
# block documents the application itself and all other files simply
# pollute our documentation
# - Prefix file contents with doxygen @file tag and %filePath% tag
# that will be changed in a subsequent sed script
# - Surround the contents of an entire file with @cond / @endcond
# to skip documenting all classes/variables
#
# -----------------------------------------------------------------------------
BEGIN {
state = 0
}
# a '/*' at the beginning of a line starts a block
/^ *\/\*/ {
state++
print "//! @file %filePath%"
print "//! @cond OpenFOAMIgnoreAppDoxygen"
}
# a '*/' ends the block
/\*\// {
if (state == 1)
{
print
}
state = 2
next
{ print }
END {
print "//! @endcond OpenFOAMIgnoreAppDoxygen"
}
# end block
{
if (state == 1)
{
print
}
next
}
# -----------------------------------------------------------------------------
#!/bin/sh
#------------------------------------------------------------------------------
# -----------------------------------------------------------------------------
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
......@@ -24,50 +23,60 @@
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
# Script
# runAll
# doxyFilt-top.awk
#
# Description
# Run either Allrun or blockMesh/application in current directory
# and all its subdirectories.
# Only output the first /* ... */ comment section found in the file
# Use @cond / @endcond to suppress documenting all classes/variables
# - This is useful for application files in which only the first
# block documents the application itself.
#
#------------------------------------------------------------------------------
# -----------------------------------------------------------------------------
BEGIN {
state = 0
}
unset WM_COLOURS
# a '/*' at the beginning of a line starts a comment block
/^ *\/\*/ {
state++
}
tutorialsDir=$PWD
while [ ! -f $tutorialsDir/RunFunctions ]
do
tutorialsDir="$tutorialsDir/.."
done
. $tutorialsDir/RunFunctions
# check first line
# either started with a comment or skip documentation for the whole file
FNR == 1 {
if (!state)
{
print "//! @cond OpenFOAMIgnoreAppDoxygen"
state = 2
}
}
thisScript=$0
if [ "/${thisScript#/}" != "$thisScript" ]
then
thisScript="$PWD/$thisScript"
fi
# a '*/' ends the comment block
# skip documentation for rest of the file
/\*\// {
if (state == 1)
{
print
print "//! @cond OpenFOAMIgnoreAppDoxygen"
}
state = 2
next
}
if [ -f "./Allrun" ]
then
# Specialised script.
./Allrun
elif [ -d "./system" ]
then
# Normal case.
parentDir=`dirname $PWD`
application=`basename $parentDir`
runApplication blockMesh
runApplication $application
else
# Recurse to subdirectories
for case in *
do
if [ -d $case ]
then
#(cd $case && $thisScript)
$WM_SCHEDULER "cd $PWD/$case && $thisScript"
fi
done
fi
# print everything within the first comment block
{
if (state)
{
print
}
next
}
#------------------------------------------------------------------------------
END {
if (state == 2)
{
print "//! @endcond OpenFOAMIgnoreAppDoxygen"
}
}
# -----------------------------------------------------------------------------
......@@ -4,7 +4,7 @@
# \\ / O peration |
# \\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
# \\/ M anipulation |
# ------------------------------------------------------------------------------
# -----------------------------------------------------------------------------
# License
# This file is part of OpenFOAM.
#
......@@ -23,23 +23,23 @@
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
# Script
# doxyAwk
# doxyFilt.awk
#
# Description
# Converts cocoon style sentinel strings into doxygen style strings
#
# - assume the comment strings are formatted as follows
# //- general description
# // more information
# // and even more information
# This should be re-formatted as the following
# //! general description
# /*!
# more information
# and even more information
# */
# The intermediate "/*! ... */" block is left-justified to handle
# possible verbatim text
# Assumes comment strings are formatted as follows
# //- general description
# // more information
# // and even more information
# This should be re-formatted as the following
# //! general description
# /*!
# more information
# and even more information
# */
# The intermediate "/*! ... */" block is left-justified to handle
# possible verbatim text
# -----------------------------------------------------------------------------
BEGIN {
......@@ -55,14 +55,14 @@ BEGIN {
/^ *\/\// {
# start block
# start comment block
if (state == 1)
{
printf "/*!\n"
state = 2
}
# inside block
# inside comment block
if (state == 2)
{
if (!sub(/^ *\/\/ /, ""))
......@@ -77,7 +77,7 @@ BEGIN {
{
# end block
# end comment block
if (state == 2)
{
printf "*/\n"
......
# -----------------------------------------------------------------------------
# Script
# doxyFilt.sed
#
# Description
# Transform human-readable tags such as 'Description' into the Doxygen
# equivalent
# -----------------------------------------------------------------------------
/^License/,/\*\//{
/^License/,/MA 0211.-130. USA/{
s?^License.*?\*\/\
......@@ -141,3 +150,5 @@ s? *\([a-zA-Z0-9]*\.[a-zA-Z]*\)? <li><a href="%dirName%/\1">\1</a></li>?
s/.*\*\//\*\//
}
# -----------------------------------------------------------------------------
......@@ -522,9 +522,7 @@ EXCLUDE_SYMLINKS = NO
# for example use the pattern */test/*
EXCLUDE_PATTERNS = */lnInclude/* \
*/t/* \
*/applications/utilities/*.H \
*/applications/solvers/*.H
*/t/*
# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
......
......@@ -16,44 +16,6 @@ FoamFile
// NB: the #functions do not work here
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
hosts
(
);
caseRoots
(
"."
"$FOAM_RUN/tutorials/bubbleFoam"
"$FOAM_RUN/tutorials/buoyantFoam"
"$FOAM_RUN/tutorials/buoyantSimpleFoam"
"$FOAM_RUN/tutorials/channelOodles"
"$FOAM_RUN/tutorials/coodles"
"$FOAM_RUN/tutorials/dnsFoam"
"$FOAM_RUN/tutorials/electrostaticFoam"
"$FOAM_RUN/tutorials/engineFoam"
"$FOAM_RUN/tutorials/icoFoam"
"$FOAM_RUN/tutorials/interFoam"
"$FOAM_RUN/tutorials/laplacianFoam"
"$FOAM_RUN/tutorials/lesInterFoam"
"$FOAM_RUN/tutorials/mhdFoam"
"$FOAM_RUN/tutorials/oodles"
"$FOAM_RUN/tutorials/potentialFoam"
"$FOAM_RUN/tutorials/rasInterFoam"
"$FOAM_RUN/tutorials/rhoSonicFoam"
"$FOAM_RUN/tutorials/rhoTurbFoam"
"$FOAM_RUN/tutorials/scalarTransportFoam"
"$FOAM_RUN/tutorials/settlingFoam"
"$FOAM_RUN/tutorials/simpleFoam"
"$FOAM_RUN/tutorials/solidDisplacementFoam"
"$FOAM_RUN/tutorials/sonicFoam"
"$FOAM_RUN/tutorials/sonicLiquidFoam"
"$FOAM_RUN/tutorials/sonicTurbFoam"
"$FOAM_RUN/tutorials/turbFoam"
"$FOAM_RUN/tutorials/twoPhaseEulerFoam"
"$FOAM_RUN/tutorials/XiFoam"
"$FOAM_RUN/tutorials/Xoodles"
);
Documentation
{
docBrowser "kde-open %f";
......
......@@ -719,7 +719,7 @@ operator+(const Tensor<Cmpt>& t1, const SymmTensor<Cmpt>& st2)
return Tensor<Cmpt>
(
t1.xx() + st2.xx(), t1.xy() + st2.xy(), t1.xz() + st2.xz(),
t1.yx() + st2.xy(), t1.yy() + st2.yy(), t1.yz() + st2.yy(),
t1.yx() + st2.xy(), t1.yy() + st2.yy(), t1.yz() + st2.yz(),
t1.zx() + st2.xz(), t1.zy() + st2.yz(), t1.zz() + st2.zz()
);
}
......@@ -745,7 +745,7 @@ operator-(const Tensor<Cmpt>& t1, const SymmTensor<Cmpt>& st2)
return Tensor<Cmpt>
(
t1.xx() - st2.xx(), t1.xy() - st2.xy(), t1.xz() - st2.xz(),
t1.yx() - st2.xy(), t1.yy() - st2.yy(), t1.yz() - st2.yy(),
t1.yx() - st2.xy(), t1.yy() - st2.yy(), t1.yz() - st2.yz(),
t1.zx() - st2.xz(), t1.zy() - st2.yz(), t1.zz() - st2.zz()
);
}
......
#!/bin/sh
#------------------------------------------------------------------------------
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM.
#
# OpenFOAM is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 2 of the License, or (at your
# option) any later version.
#
# OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# for more details.
#
# You should have received a copy of the GNU General Public License
# along with OpenFOAM; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
# Script
# Allclean
#
# Description
#
#------------------------------------------------------------------------------
. ./CleanFunctions
echo "Cleaning backup files"
find . -type f \( -name "*~" -o -name "*.bak" \) -exec rm {} \;
find . \( -name 'core' -o -name 'core.[1-9]*' \) -exec rm {} \;
find . \( -name '*.pvs' -o -name '*.foam' \) -exec rm {} \;
rm logs > /dev/null 2>&1
rm testLoopReport > /dev/null 2>&1
echo ""
for application in *
do
if [ -d $application ]
then
(cd $application && ../cleanAll)
fi
done
#------------------------------------------------------------------------------
#!/bin/sh
#------------------------------------------------------------------------------
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM.
#
# OpenFOAM is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 2 of the License, or (at your
# option) any later version.
#
# OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# for more details.
#
# You should have received a copy of the GNU General Public License
# along with OpenFOAM; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
# Script
# Allrun
#
# Description
#
#------------------------------------------------------------------------------
. RunFunctions
# logReport <logfile>
# Extracts useful info from log file.
logReport () {
case=`dirname $1 | sed s/"\(.*\)\.\/"/""/g`
app=`echo $1 | sed s/"\(.*\)\."/""/g`
appAndCase="Application $app - case $case"
fatalError=`grep "FOAM FATAL" $1`
UxSS=`grep -E "Ux[:| ]*solution singularity" $1`
UySS=`grep -E "Uy[:| ]*solution singularity" $1`
UzSS=`grep -E "Uz[:| ]*solution singularity" $1`
completed=`grep -E "^[\t ]*[eE]nd" $1`
if [ "$fatalError" ] ; then
echo "$appAndCase: ** FOAM FATAL ERROR **"
return
elif [ "$UxSS" -a "$UySS" -a "$UzSS" ] ; then
echo "$appAndCase: ** Solution singularity **"
return
elif [ "$completed" ] ; then
completionTime=`tail -10 $log | grep Execution | cut -d= -f2 | sed 's/^[ \t]*//'`
if [ "$completionTime" ] ; then
completionTime="in $completionTime"
fi
echo "$appAndCase: completed $completionTime"
return
else
echo "$appAndCase: unconfirmed completion"
fi
}
# Recursively run all tutorials
for application in *
do
if [ -d $application ]
then
#(cd $application && ../runAll)
$WM_SCHEDULER "cd $PWD/$application && ../runAll"
fi
done
# Analyse all log files
rm testLoopReport > /dev/null 2>&1 &
touch testLoopReport
for application in *
do
if [ -d $application ]
then
cd $application
for log in `find . -name "log.*" | xargs ls -rt`
do
logReport $log >> ../testLoopReport
done
echo "" >> ../testLoopReport
cd ..
fi
done
find . -name "log.*" -exec cat {} \; >> logs
#------------------------------------------------------------------------------
#!/bin/sh
#
# FUNCTIONS
#
printUsage () {
cat <<EOF
Usage: $0
Quickly tests the tutorials and writes out the scheme/solver information
Options are:
-d sets up a default scheme on all schemes
-h help
EOF
}
newRunApplication () {
cat<<EOF
runApplication ()
{
if [ -f \$2/log.\$1 ] ; then
echo "$1 already run on $2: remove log file to run"
else
mv \$2/system/controlDict \$2/system/controlDict.org
sed \\
-e s/"\(startFrom[ \t]*\)\([0-9a-zA-Z.-]*\);"/"\1 latestTime;"/g \\
-e s/"\(stopAt[ \t]*\)\([a-zA-Z]*\);"/"\1 nextWrite;"/g \\
-e s/"\(writeControl[ \t]*\)\([a-zA-Z]*\);"/"\1 timeStep;"/g \\
-e s/"\(writeInterval[ \t]*\)\([0-9a-zA-Z.-]*\);"/"\1 1;"/g \\
\$2/system/controlDict.org > \$2/system/controlDict
echo "Running \$1 on \$2"
\$1 . \$2 > \$2/log.\$1 2>&1
fi
}
EOF
}
setDefaultFvSchemes () {
cat<<EOF
gradSchemes { default Gauss linear; }
divSchemes
{
default Gauss linear;
div(phi,fu_ft_h) Gauss multivariateSelection
{
fu upwind;
ft upwind;
h upwind;
};
div(phi,ft_b_h_hu) Gauss multivariateSelection
{
fu upwind;
ft upwind;
b upwind;
h upwind;
hu upwind;
};
}
laplacianSchemes { default Gauss linear corrected; }
interpolationSchemes { default linear; }
snGradSchemes { default corrected; }
fluxRequired { default yes; }
EOF
}
#
# VARIABLE
#
MAIN_CONTROL_DICT=
: ${FOAM_DOT_DIR:=.$WM_PROJECT-$WM_PROJECT_VERSION}
for i in \
$HOME/$FOAM_DOT_DIR \
$HOME/.$WM_PROJECT/$WM_PROJECT_VERSION \
$HOME/.$WM_PROJECT \
$WM_PROJECT_DIR/etc \
$WM_PROJECT_DIR/$FOAM_DOT_DIR \
;
do
if [ -f "$i/controlDict" ]; then
MAIN_CONTROL_DICT="$i/controlDict"
break
fi
done
TUTORIALS_DIR=.
TEST_RUN_DIR=../tutorialsTest
FV_SCHEMES=\
" \
gradScheme \
divScheme \
laplacianScheme \
interpolationScheme \
snGradScheme \
fluxRequired \
"
SCHEMES_FILE="FvSchemes"
SCHEMES_TEMP="FvSchemes.temp"
SOLVERS_FILE="FvSolution"
SOLVERS_TEMP="FvSolution.temp"
DEFAULT_SCHEMES=0
#