Merge branch 'master' into particleInteractions

This commit is contained in:
graham
2010-04-09 18:04:49 +01:00
174 changed files with 1269 additions and 1315 deletions

View File

@ -35,8 +35,94 @@
# to restore controlDict # to restore controlDict
# #
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
Script=${0##*/}
PROGNAME=`basename $0` usage() {
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
cat<<USAGE
Usage: $Script [OPTION] <pid>
Usage: $Script [OPTION] -c
options:
-clear use blockMesh reader (uses .blockMesh extension)
-case <dir> specify alternative case directory, default is the cwd
-now stop at next time step
-help print the usage
Tries to end running OpenFOAM application at next write (or optionally
at the next time step). It needs runTimeModifiable switched on in the
controlDict. It changes stopAt in the controlDict and waits for the
job to finish. Restores original controlDict if
- job has finished
- controlDict gets modified (by user)
- $Script gets killed.
The -clear option clears any outstanding $Script for the case.
USAGE
exit 1
}
unset clearOpt stopOpt
# parse options
while [ "$#" -gt 0 ]
do
case "$1" in
-h | -help)
usage
;;
-case)
[ "$#" -ge 2 ] || usage "'$1' option requires an argument"
cd "$2" 2>/dev/null || usage "directory does not exist: '$2'"
shift 2
;;
-c | -clear)
clearOpt=true
shift
;;
-n | -now)
stopOpt=now
shift
;;
-*)
usage "unknown option: '$*'"
;;
*)
break
;;
esac
done
# parent directory for normal or parallel
case "$PWD" in
processor*) caseDir=".." ;;
*) caseDir="." ;;
esac
# check that case directory is writeable
[ -w $caseDir ] || {
echo "$Script : $caseDir is not writeable"
exit 1
}
# check that controlDict is writeable
controlDict=$caseDir/system/controlDict
[ -w $controlDict ] || {
echo "$Script : $controlDict is not writeable"
exit 1
}
# need a pid unless with the -clear option
if [ "$clearOpt" = true ]
then
[ $# -eq 0 ] || usage
else
[ $# -eq 1 ] || usage
PID=$1
fi
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
@ -84,6 +170,7 @@ setRawEntry() {
oldLine=`echo "$oldNumLine" | sed -e 's/^[^:]*://'` oldLine=`echo "$oldNumLine" | sed -e 's/^[^:]*://'`
oldKey=`getKey "$oldLine"` oldKey=`getKey "$oldLine"`
oldVal=`getRawEntry $1 "$2"` oldVal=`getRawEntry $1 "$2"`
if [ ! "$oldKey" -o ! "$oldVal" -o ! "$oldLine" ] if [ ! "$oldKey" -o ! "$oldVal" -o ! "$oldLine" ]
then then
echo "setRawStringEntry: entry $2 not found in $1" echo "setRawStringEntry: entry $2 not found in $1"
@ -92,6 +179,7 @@ setRawEntry() {
echo "oldLine=$oldLine" echo "oldLine=$oldLine"
exit 1 exit 1
fi fi
#echo "oldKey=$oldKey" #echo "oldKey=$oldKey"
#echo "lineNo=$lineNo" #echo "lineNo=$lineNo"
#echo "oldLine=$oldLine" #echo "oldLine=$oldLine"
@ -108,76 +196,30 @@ getBoolEntry()
{ {
val=`getEntry $1 $2` val=`getEntry $1 $2`
case "$val" in case "$val" in
'yes') y | yes | true | on | 1)
return 0 return 0
;; ;;
'no') n | no | false | off | 0)
return 123
;;
'true')
return 0
;;
'false')
return 123
;;
1)
return 0
;;
0)
return 123 return 123
;; ;;
*) *)
echo "$PROGNAME : getBoolEntry : Illegal boolean value $val in dictionary $1" echo "$Script : getBoolEntry : Illegal boolean value $val in dictionary $1"
exit 1 exit 1
;; ;;
esac esac
} }
# newerFile file1 file2
# ... could also use if [ $file1 -nt $file2 ] ...
newerFile()
{
latest=`ls -1 -t $1 $2 2> /dev/null | head -1`
if [ "$latest" = $1 ]
then
return 0
else
return 1
fi
}
# processExists pid # processExists pid
# Returns true if pid exists. # Returns true if pid exists.
processExists() { processExists() {
ps -u $LOGNAME -o 'pid' | fgrep $1 >/dev/null ps -u $LOGNAME -o pid | fgrep $1 >/dev/null
} }
usage() {
cat << USAGE
Usage: $PROGNAME [-n] <root> <case> <pid>
or
$PROGNAME -c <root> <case>
Tries to end running Foam application at next write or at next time
step (-n (at your option). It needs runTimeModifiable switched on in the
controlDict. It changes stopAt in the controlDict and waits for the job to
finish. Restores original controlDict if
- job has finished
- controlDict gets modified (by user)
- $PROGNAME gets killed.
The -c option clears any outstanding $PROGNAME for the case.
USAGE
exit 1
}
# Restore controlDict and clean up # Restore controlDict and clean up
restoreDict() { restoreDict() {
trap 2 3 15 trap QUIT TERM INT
echo "$PROGNAME : Restoring controlDict from controlDict_bak." echo "$Script : Restoring controlDict from controlDict_bak"
if [ -r ${controlDict}_bak ] if [ -r ${controlDict}_bak ]
then then
cp ${controlDict}_bak $controlDict cp ${controlDict}_bak $controlDict
@ -185,7 +227,7 @@ restoreDict() {
rm -f $pidFile rm -f $pidFile
echo "$PROGNAME : Exiting." echo "$Script : Exiting"
exit 0 exit 0
} }
@ -196,105 +238,51 @@ restoreDict() {
# #
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
ARCH=`uname -s`
#-- Force standards behaving ps #-- Force standards behaving ps
# Get info on all $USER processes # Get info on all $USER processes
case $ARCH in case `uname -s` in
HP-UX*) HP-UX*)
UNIX95=a; export UNIX95 UNIX95=a
export UNIX95
;; ;;
IRIX*) IRIX*)
_XPG=1; export _XPG _XPG=1
export _XPG
;; ;;
esac esac
# # Pid actually running
# Initial checks if [ "$clearOpt" != true ]
#
if [ $# -lt 3 ]
then
usage
fi
STOPNOW=''
if [ $1 = '-n' ]
then
STOPNOW='yes'
shift
fi
CLEAR=''
if [ $1 = '-c' ]
then
CLEAR='yes'
shift
if [ $# -ne 2 ]
then
usage
fi
ROOT=$1
CASE=$2
else
if [ $# -ne 3 ]
then
usage
fi
ROOT=$1
CASE=$2
PID=$3
fi
CASE=`echo $CASE | sed -e 's!/.*!!'` # strip of processorXXX ending
#- Pid actually running
if [ ! "$CLEAR" ]
then then
processExists $PID processExists $PID
if [ $? -ne 0 ] if [ $? -ne 0 ]
then then
echo "$PROGNAME : process $PID not running." echo "$Script : process $PID not running"
exit 1 exit 1
fi fi
fi fi
#- case directory writeable
if [ ! -w $ROOT/$CASE ]
then
echo "$PROGNAME : $ROOT/$CASE is not writeable."
exit 1
fi
#- Controldict writeable
controlDict=$ROOT/$CASE/system/controlDict
if [ ! -w $controlDict ]
then
echo "$PROGNAME : $controlDict is not writeable."
exit 1
fi
#- runTimeModifiable #- runTimeModifiable
getBoolEntry $controlDict 'runTimeModifiable' getBoolEntry $controlDict runTimeModifiable || {
if [ $? -ne 0 ] echo "$Script : runTimeModifiable not true in dictionary $controlDict"
then
echo "$PROGNAME : runTimeModifiable not true in dictionary $controlDict."
exit 1 exit 1
fi }
# #
#- Check if another foamEndJob running #- Check if another foamEndJob running
# #
if [ "$CLEAR" ] if [ "$clear" = true ]
then then
pidFiles=`ls $ROOT/$CASE/.foamEndJob* 2>/dev/null` pidFiles=`ls $caseDir/.foamEndJob* 2>/dev/null`
for pidFile in $pidFiles for pidFile in $pidFiles
do do
pid=`cat $pidFile` pid=`cat $pidFile`
if [ "$pid" ] if [ "$pid" ]
then then
echo "$PROGNAME : found $PROGNAME (pid $pid) for Foam process" echo "$Script : found $Script (pid $pid) for OpenFOAM process"
echo " root: $ROOT" echo " case: $PWD/$caseDir"
echo " case: $CASE" echo "$Script : Killing $Script (pid $pid)"
echo "$PROGNAME : Killing $PROGNAME (pid $pid)."
kill $pid kill $pid
rm -f $pidFile rm -f $pidFile
fi fi
@ -302,7 +290,7 @@ then
exit 0 exit 0
fi fi
pidFile=$ROOT/$CASE/.foamEndJob${PID} pidFile=$caseDir/.foamEndJob$PID
if [ -f $pidFile ] if [ -f $pidFile ]
then then
pid=`cat $pidFile` pid=`cat $pidFile`
@ -311,12 +299,11 @@ then
processExists $pid processExists $pid
if [ $? -eq 0 ] if [ $? -eq 0 ]
then then
echo "$PROGNAME : found running $PROGNAME (pid $pid) for Foam process" echo "$Script : found running $Script (pid $pid) for OpenFOAM process"
echo " root: $ROOT" echo " case: $PWD/$caseDir"
echo " case: $CASE"
echo " pid : $PID" echo " pid : $PID"
echo " lock: $pidFile" echo " lock: $pidFile"
echo "Remove the lock if this is not the case." echo "Remove the lock if this is not the case"
exit 1 exit 1
fi fi
fi fi
@ -331,63 +318,60 @@ echo $$ > $pidFile
#- startTime #- startTime
startTime=`getEntry $controlDict 'startTime'` startTime=`getEntry $controlDict startTime`
if [ ! "$startTime" ] [ "$startTime" ] || {
then echo "$Script : startTime not set in dictionary $controlDict"
echo "$PROGNAME : startTime not set in dictionary $controlDict."
exit 1 exit 1
fi }
#- Write interval #- Write interval
writeInterval=`getEntry $controlDict 'writeInterval'` writeInterval=`getEntry $controlDict writeInterval`
if [ ! "$writeInterval" ] [ "$writeInterval" ] || {
then echo "$Script : writeInterval not set in dictionary $controlDict"
echo "$PROGNAME : writeInterval not set in dictionary $controlDict."
exit 1 exit 1
fi }
#- stopAt #- stopAt
stopAt=`getEntry $controlDict 'stopAt'` stopAt=`getEntry $controlDict stopAt`
if [ ! "$stopAt" ] [ "$stopAt" ] || {
then echo "$Script : stopAt not set in dictionary $controlDict"
echo "$PROGNAME : stopAt not set in dictionary $controlDict."
exit 1 exit 1
fi }
#- endTime #- endTime
endTime=`getEntry $controlDict 'endTime'` endTime=`getEntry $controlDict endTime`
if [ ! "$endTime" ] [ "$endTime" ] || {
then echo "$Script : endTime not set in dictionary $controlDict"
echo "$PROGNAME : endTime not set in dictionary $controlDict."
exit 1 exit 1
fi }
echo "$PROGNAME : Read from controlDict:" echo "$Script : Read from controlDict:"
echo " controlDict : $controlDict" echo " controlDict : $controlDict"
echo " writeInterval : $writeInterval" echo " writeInterval : $writeInterval"
#echo " startTime : $startTime" #echo " startTime : $startTime"
echo " stopAt : $stopAt" echo " stopAt : $stopAt"
#echo " endTime : $endTime" #echo " endTime : $endTime"
echo "$PROGNAME : Making backup of controlDict to controlDict_bak" echo "$Script : Making backup of controlDict to controlDict_bak"
cp $controlDict ${controlDict}_bak cp $controlDict ${controlDict}_bak
#- Set up handler to restore controlDict #- Set up handler to restore controlDict
trap restoreDict 2 3 15 trap restoreDict QUIT TERM INT
if [ "$STOPNOW" ] if [ "$stopOpt" = now ]
then then
setRawEntry $controlDict 'stopAt' 'nextWrite' setRawEntry $controlDict stopAt nextWrite
setRawEntry $controlDict 'writeInterval' '1' setRawEntry $controlDict writeInterval 1
echo "$PROGNAME : Changed in controlDict:" echo "$Script : Changed in controlDict:"
echo " `getLine $controlDict 'stopAt'`" echo " `getLine $controlDict stopAt`"
echo " `getLine $controlDict 'writeInterval'`" echo " `getLine $controlDict writeInterval`"
else else
setRawEntry $controlDict 'stopAt' 'nextWrite' setRawEntry $controlDict stopAt nextWrite
echo "$PROGNAME : Changed in controlDict:" echo "$Script : Changed in controlDict:"
echo " `getLine $controlDict 'stopAt'`" echo " `getLine $controlDict stopAt`"
fi fi
@ -401,23 +385,24 @@ sleep 5
touch ${controlDict}_bak touch ${controlDict}_bak
#- Loop a while to give NFS time to update #- Loop a while to give NFS time to update
if newerFile ${controlDict} ${controlDict}_bak; then if [ ${controlDict} -nt ${controlDict}_bak ]
echo "$PROGNAME : controlDict newer than controlDict_bak." then
echo "$PROGNAME : Waiting for file dates to get updated." echo "$Script : controlDict newer than controlDict_bak"
echo "$Script : Waiting for file dates to get updated"
iter=0 iter=0
while newerFile ${controlDict} ${controlDict}_bak while [ ${controlDict} -nt ${controlDict}_bak ]
do do
if [ $iter -ge 120 ] if [ $iter -ge 120 ]
then then
#- 120*5 sec = 10 mins passed. Give up #- 120*5 sec = 10 mins passed. Give up
echo "$PROGNAME : File date not yet ok after 10 mins. Giving up." echo "$Script : File date not yet ok after 10 mins ... giving up"
break break
fi fi
#- Give _bak a later time #- Give _bak a later time
touch ${controlDict}_bak touch ${controlDict}_bak
#- Give nfs some time to update time on controlDict. #- Give NFS a chance to update time on controlDict.
sleep 5 sleep 5
iter=`expr $iter + 1` iter=`expr $iter + 1`
@ -430,21 +415,20 @@ fi
# - controlDict modified. No restore. # - controlDict modified. No restore.
# - controlDict_bak removed. No restore. # - controlDict_bak removed. No restore.
echo "$PROGNAME : Waiting for Foam job $PID to finish ..." echo "$Script : Waiting for OpenFOAM job $PID to finish ..."
while true while true
do do
sleep 5 sleep 5
if [ ! -r ${controlDict}_bak ] [ -r ${controlDict}_bak ] || {
then echo "$Script : ${controlDict}_bak disappeared. Exiting without restore"
echo "$PROGNAME : ${controlDict}_bak dissappeared. Exiting without restore."
exit 1 exit 1
fi }
if newerFile ${controlDict} ${controlDict}_bak if [ ${controlDict} -nt ${controlDict}_bak ]
then then
echo "$PROGNAME : ${controlDict} modified externally. Exiting without restore." echo "$Script : ${controlDict} modified externally. Exiting without restore"
exit 0 exit 0
fi fi
@ -454,7 +438,7 @@ do
#- Job finished #- Job finished
break break
fi fi
# echo "Foam job $PID still running ..." # echo "OpenFOAM job $PID still running ..."
done done
#- Dictionary restore #- Dictionary restore

View File

@ -31,35 +31,36 @@
# Bugs # Bugs
# -solution singularity not handled # -solution singularity not handled
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
Script=${0##*/}
toolsDir=${0%/*}/tools
PROGDIR=`dirname $0` usage() {
PROGNAME=`basename $0` while [ "$#" -ge 1 ]; do echo "$1"; shift; done
DBFILE=${PROGNAME}.db cat <<USAGE
printUsage() { Usage: $Script [OPTIONS] <log>
cat <<USAGE -list lists but does not extract
$PROGNAME - extracts xy files from OpenFOAM logs. -n create single column files with the extracted data only
-quiet quiet operation
-help print the usage
Usage: $PROGNAME [-n][-s] <log> $Script - extracts xy files from OpenFOAM logs.
extracts xy files from log
$PROGNAME -l <log>
lists but does not extract
$PROGNAME -h
for a help message
USAGE USAGE
exit 1
} }
#------------------------------------------------------------------------------
printHelp() { printHelp() {
printUsage cat <<HELP
cat <<LABHELP -----------------------------------------------------------------------------
The default is to extract for all the 'Solved for' variables the initial The default is to extract for all the 'Solved for' variables the initial
residual, the final residual and the number of iterations. Additionally, a residual, the final residual and the number of iterations. Additionally, a
(user editable) database is used to extract data for standard non-solved for (user editable) database is used to extract data for standard non-solved for
variables like Courant number, and execution time. variables like Courant number, and execution time.
$PROGNAME -l lists all the possible variables without extracting them. $Script -l lists all the possible variables without extracting them.
The program will generate and run an awk script which writes a set of files, The program will generate and run an awk script which writes a set of files,
logs/<var>_<subIter>, for every <var> specified, for every occurrence inside logs/<var>_<subIter>, for every <var> specified, for every occurrence inside
@ -79,7 +80,7 @@ separated with '/' :
Column 2 is the extended regular expression (egrep) to select the line. Column 2 is the extended regular expression (egrep) to select the line.
Column 3 is the string (fgrep) to select the column inside the line. Column 3 is the string (fgrep) to select the column inside the line.
The value taken will be the first (non-space)word after this column. The value taken will be the first (non-space)word after this column.
The database ($PROGNAME.db) will taken from these locations: The database ($Script.db) will taken from these locations:
. .
$HOME/.OpenFOAM/$WM_PROJECT_VERSION $HOME/.OpenFOAM/$WM_PROJECT_VERSION
@ -87,61 +88,97 @@ The database ($PROGNAME.db) will taken from these locations:
$WM_PROJECT_INST_DIR/site/$WM_PROJECT_VERSION $WM_PROJECT_INST_DIR/site/$WM_PROJECT_VERSION
$WM_PROJECT_INST_DIR/site $WM_PROJECT_INST_DIR/site
$WM_PROJECT_DIR/etc $WM_PROJECT_DIR/etc
$PROGDIR/tools $toolsDir
Option -s suppresses the default information and only prints the extracted Option -q suppresses the default information and only prints the extracted
variables. variables.
-----------------------------------------------------------------------------
HELP
LABHELP usage
} }
# The various places to be searched: timeName=Time
for i in \ unset listOpt quietOpt
. \
$HOME/.OpenFOAM/$WM_PROJECT_VERSION \ # parse options
$HOME/.OpenFOAM \ while [ "$#" -gt 0 ]
$WM_PROJECT_INST_DIR/site/$WM_PROJECT_VERSION \
$WM_PROJECT_INST_DIR/site \
$WM_PROJECT_DIR/etc \
$PROGDIR/tools \
;
do do
if [ -r $i/$DBFILE ] case "$1" in
then -h | -help)
DBFILE="$i/$DBFILE" printHelp
exit 0
;;
-n)
unset timeName
shift
;;
-l | -list)
listOpt=true
shift
;;
-q | -quiet | -s | -silent)
quietOpt=true
shift
;;
-*)
usage "unknown option: '$*'"
;;
*)
break break
fi ;;
esac
done done
# find the database file
DBFILE=$Script.db
[ -f $DBFILE ] || DBFILE=`foamEtcFile $Script.db` || DBFILE=$toolsDir/$Script.db
myEcho() { # need the database file
if [ "$VERBOSE" ] [ -f $DBFILE ] || {
then echo "$Script: Cannot read database $DBFILE"
echo "$*" exit 1
fi
} }
# single logFile
if [ $# -eq 1 ]
then
LOG=$1
[ -r "$LOG" ] && [ -f "$LOG" ] || usage "Cannot read log $LOG"
else
usage
fi
myEcho()
{
[ "$quietOpt" = true ] || echo "$*"
}
# getSolvedVars logFile # getSolvedVars logFile
# Prints names of all 'solved for' variables in the log file. # Prints names of all 'solved for' variables in the log file.
getSolvedVars() { getSolvedVars()
{
fgrep ' Solving for ' $1 | fgrep ',' | sed -e 's/.* Solving for \([^,]*\)[,:].*/\1/' | sort -u fgrep ' Solving for ' $1 | fgrep ',' | sed -e 's/.* Solving for \([^,]*\)[,:].*/\1/' | sort -u
} }
# getQueries dbFile queryName # getQueries dbFile queryName
# Gets regular expressions for a certain queryName from the database # Gets regular expressions for a certain queryName from the database
getQueries() { getQueries()
if [ ! -f "$1" ] {
then dbFile=$1
echo "Cannot find dbFile $1"
exit 1
fi
queryName=$2 queryName=$2
LINEQ=`grep -v '^#' $1 | awk -F '/' "/$queryName/ {if (\"$queryName\" "'!= $1) next; print $2}'` [ -f "$dbFile" ] || {
NUMQ=`grep -v '^#' $1 | awk -F '/' "/$queryName/ {if (\"$queryName\" "'!= $1) next; print $3}'` echo "Cannot find dbFile $dbFile"
exit 1
}
LINEQ=`grep -v '^#' $dbFile | awk -F '/' "/$queryName/ {if (\"$queryName\" "'!= $1) next; print $2}'`
NUMQ=`grep -v '^#' $dbFile | awk -F '/' "/$queryName/ {if (\"$queryName\" "'!= $1) next; print $3}'`
#echo "For $queryName found line selection /$LINEQ/ , column selection /$NUMQ/" 1>&2 #echo "For $queryName found line selection /$LINEQ/ , column selection /$NUMQ/" 1>&2
#if [ ! "$LINEQ" -o ! "$NUMQ" ] #if [ ! "$LINEQ" -o ! "$NUMQ" ]
@ -153,14 +190,16 @@ getQueries() {
# getDbQueryList dbFile # getDbQueryList dbFile
# Echoes list of possible queries # Echoes list of possible queries
getDbQueryList() { getDbQueryList()
{
grep -v '^#' $1 | grep '[^ \t]' | awk -F '/' '{print $1}' grep -v '^#' $1 | grep '[^ \t]' | awk -F '/' '{print $1}'
} }
# getSolveQueryList logFile # getSolveQueryList logFile
# Echoes list of queries from "solved for" variables in log file # Echoes list of queries from "solved for" variables in log file
getSolveQueryList() { getSolveQueryList()
{
solvedVars=`getSolvedVars $1` solvedVars=`getSolvedVars $1`
for var in $solvedVars for var in $solvedVars
@ -174,7 +213,8 @@ getSolveQueryList() {
# getAllQueries dbFile logFile # getAllQueries dbFile logFile
# Gets all queries from database and from logfile # Gets all queries from database and from logfile
getAllQueries() { getAllQueries()
{
#-- All solved for queries from log file #-- All solved for queries from log file
queries=`getSolveQueryList $2` queries=`getSolveQueryList $2`
@ -208,107 +248,33 @@ getAllQueries() {
# Main # Main
#----------------------------- #-----------------------------
# sort arguments if [ "$listOpt" = true ]
TIMENAME='Time'
VERBOSE='yes'
LISTONLY=''
while getopts nslh flags
do
case $flags in
n)
TIMENAME=""
;;
h)
printHelp
exit 0
;;
s)
VERBOSE=""
;;
l)
LISTONLY='yes'
;;
\?)
printUsage
exit 1
;;
esac
done
# Shift options
shift `expr $OPTIND - 1`
if [ ! -f $DBFILE ]
then then
echo "$PROGNAME: Cannot read database $DBFILE"
exit 1
fi
if [ "$LISTONLY" ]
then
if [ $# -ne 1 ]
then
printUsage
exit 1
fi
LOG=$1;
if [ ! -r $LOG ]
then
echo "$PROGNAME: Cannot read log $LOG"
exit 1
fi
getAllQueries $DBFILE $LOG getAllQueries $DBFILE $LOG
exit 0 exit 0
fi fi
if [ $# -ne 1 ] caseDir=.
then outputDir=$caseDir/logs
printUsage
exit 1
fi
CASEDIR=. [ -d "$caseDir" ] || {
LOG=$1 echo "$Script: Cannot read $caseDir"
if [ ! -r $LOG ]
then
echo "$PROGNAME: Cannot read log $LOG"
exit 1 exit 1
fi }
QUERYNAMES=`getAllQueries $DBFILE $LOG` QUERYNAMES=`getAllQueries $DBFILE $LOG`
#
if [ ! "$CASEDIR" ] # Make logs dir in case directory and place awk file there
then #
printUsage mkdir -p $outputDir
exit 1 AWKFILE=$outputDir/$Script.awk
fi
if [ ! -d "$CASEDIR" ]
then
echo "$PROGNAME: Cannot read $CASEDIR"
exit 1
fi
if [ ! -f "$LOG" ]
then
echo "$PROGNAME: Cannot read log file $LOG"
exit 1
fi
#-- Make logs dir in case directory and put awk file there.
mkdir -p $CASEDIR/logs
AWKFILE=$CASEDIR/logs/$PROGNAME.awk
myEcho "Using:" myEcho "Using:"
myEcho " log : $LOG" myEcho " log : $LOG"
myEcho " database : $DBFILE" myEcho " database : $DBFILE"
myEcho " awk file : $AWKFILE" myEcho " awk file : $AWKFILE"
myEcho " files to : $CASEDIR/logs" myEcho " files to : $outputDir"
myEcho "" myEcho ""
@ -316,22 +282,25 @@ myEcho ""
# Generate Awk program # Generate Awk program
#----------------------------- #-----------------------------
#-- header rm -f $AWKFILE 2> /dev/null
cat << AWK_CONTENTS > $AWKFILE
# header
BEGIN {
Iteration=0
resetCounters()
}
rm -f $AWKFILE; touch $AWKFILE # reset counters used for variable postfix
echo "BEGIN {" >> $AWKFILE function resetCounters() {
echo " Iteration=0" >> $AWKFILE AWK_CONTENTS
echo " resetCounters()" >> $AWKFILE # ----------
echo "}" >> $AWKFILE
echo "" >> $AWKFILE
echo "# reset counters used for variable postfix" >> $AWKFILE
echo "function resetCounters() {" >> $AWKFILE
for queryName in $QUERYNAMES for queryName in $QUERYNAMES
do do
varName=${queryName}Cnt varName=${queryName}Cnt
echo " ${varName}=0" >> $AWKFILE echo " ${varName}=0" >> $AWKFILE
done done
echo " # Reset counters for general Solving for extraction" >> $AWKFILE echo " # Reset counters for general Solving for extraction" >> $AWKFILE
echo " for (varName in subIter)" >> $AWKFILE echo " for (varName in subIter)" >> $AWKFILE
echo " {" >> $AWKFILE echo " {" >> $AWKFILE
@ -341,10 +310,9 @@ echo "}" >> $AWKFILE
echo "" >> $AWKFILE echo "" >> $AWKFILE
cat <<LABEL >> $AWKFILE cat << AWK_CONTENTS >> $AWKFILE
# Extract value after columnSel # Extract value after columnSel
function extract(inLine,columnSel,outVar, function extract(inLine,columnSel,outVar,a,b)
a,b)
{ {
a=index(inLine, columnSel) a=index(inLine, columnSel)
b=length(columnSel) b=length(columnSel)
@ -352,71 +320,82 @@ function extract(inLine,columnSel,outVar,
gsub("[,:]","",outVar[1]) gsub("[,:]","",outVar[1])
} }
LABEL AWK_CONTENTS
# ----------
#
#-- Generate code for iteration separator (increments 'Iteration') # Code for iteration separator (increments 'Iteration')
#
getQueries $DBFILE 'Separator' getQueries $DBFILE 'Separator'
cat <<LABSEP >> $AWKFILE cat << AWK_CONTENTS >> $AWKFILE
#-- Iteration separator (increments 'Iteration') # Iteration separator (increments 'Iteration')
/$LINEQ/ { /$LINEQ/ {
Iteration++ Iteration++
resetCounters() resetCounters()
} }
LABSEP AWK_CONTENTS
# ----------
#
#-- Generate code for extracting Time # Code for extracting Time
#
getQueries $DBFILE 'Time' getQueries $DBFILE 'Time'
cat <<LABTIME >> $AWKFILE cat << AWK_CONTENTS >> $AWKFILE
#-- Time extraction (sets 'Time') # Time extraction (sets 'Time')
/$LINEQ/ { /$LINEQ/ {
extract(\$0, "$NUMQ", val) extract(\$0, "$NUMQ", val)
Time=val[1] Time=val[1]
} }
LABTIME AWK_CONTENTS
# ----------
#
#-- Generate code for singularity handling. # Code for singularity handling.
cat <<LABSING >> $AWKFILE #
#-- Skip whole line with singularity variable cat << AWK_CONTENTS >> $AWKFILE
# Skip whole line with singularity variable
/solution singularity/ { /solution singularity/ {
next; next;
} }
LABSING
AWK_CONTENTS
# ----------
#-- Generate code for extracting solved for quantities #
cat <<LABSOLVE >> $AWKFILE # Code for extracting solved for quantities
#-- Extraction of any solved for variable #
cat << AWK_CONTENTS >> $AWKFILE
# Extraction of any solved for variable
/Solving for/ { /Solving for/ {
extract(\$0, "Solving for ", varNameVal) extract(\$0, "Solving for ", varNameVal)
varName=varNameVal[1] varName=varNameVal[1]
file=varName "_" subIter[varName]++ file=varName "_" subIter[varName]++
file="$CASEDIR/logs/" file file="$outputDir/" file
extract(\$0, "Initial residual = ", val) extract(\$0, "Initial residual = ", val)
print $TIMENAME "\t" val[1] > file print $timeName "\t" val[1] > file
varName=varNameVal[1] "FinalRes" varName=varNameVal[1] "FinalRes"
file=varName "_" subIter[varName]++ file=varName "_" subIter[varName]++
file="$CASEDIR/logs/" file file="$outputDir/" file
extract(\$0, "Final residual = ", val) extract(\$0, "Final residual = ", val)
print $TIMENAME "\t" val[1] > file print $timeName "\t" val[1] > file
varName=varNameVal[1] "Iters" varName=varNameVal[1] "Iters"
file=varName "_" subIter[varName]++ file=varName "_" subIter[varName]++
file="$CASEDIR/logs/" file file="$outputDir/" file
extract(\$0, "No Iterations ", val) extract(\$0, "No Iterations ", val)
print $TIMENAME "\t" val[1] > file print $timeName "\t" val[1] > file
} }
LABSOLVE AWK_CONTENTS
# ----------
#
#-- generate code to process queries # Code to process queries
#
for queryName in $QUERYNAMES for queryName in $QUERYNAMES
do do
getQueries $DBFILE $queryName getQueries $DBFILE $queryName
@ -424,11 +403,11 @@ do
then then
counter=${queryName}Cnt counter=${queryName}Cnt
echo "#-- Extraction of $queryName" >> $AWKFILE echo "# Extraction of $queryName" >> $AWKFILE
echo "/$LINEQ/ {" >> $AWKFILE echo "/$LINEQ/ {" >> $AWKFILE
echo " extract(\$0, \"$NUMQ\", val)" >> $AWKFILE echo " extract(\$0, \"$NUMQ\", val)" >> $AWKFILE
echo " file=\"$CASEDIR/logs/${queryName}_\" ${counter}" >> $AWKFILE echo " file=\"$outputDir/${queryName}_\" ${counter}" >> $AWKFILE
echo " print $TIMENAME \"\\t\" val[1] > file" >> $AWKFILE echo " print $timeName \"\\t\" val[1] > file" >> $AWKFILE
echo " ${counter}++" >> $AWKFILE echo " ${counter}++" >> $AWKFILE
echo "}" >> $AWKFILE echo "}" >> $AWKFILE
echo "" >> $AWKFILE echo "" >> $AWKFILE

View File

@ -32,41 +32,70 @@
# Also removes consecutive blank lines from file. # Also removes consecutive blank lines from file.
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
foamVersion=$WM_PROJECT_VERSION
usage() { usage() {
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
cat<<USAGE cat<<USAGE
Usage: ${0##*/} [OPTION] <file1> ... <fileN> Usage: ${0##*/} [OPTION] <file1> ... <fileN>
options: options:
-v VER specifies the version to be written in the header -version <ver> specifies the version to be written in the header
-h help -help print the usage
Updates the header of application files and removes consecutive blank lines. Updates the header of application files and removes consecutive blank lines.
By default, writes current OpenFOAM version in the header. By default, writes current OpenFOAM version in the header.
An alternative version can be specified with the -v option. An alternative version can be specified with the -version option.
USAGE USAGE
exit 1 exit 1
} }
#------------------------------------------------------------------------------
printHeader() { # parse options
while [ "$#" -gt 0 ]
do
case "$1" in
-h | -help)
usage
;;
-v | -version)
[ "$#" -ge 2 ] || usage "'$1' option requires an argument"
version="$2"
shift 2
;;
-*)
usage "unknown option: '$*'"
;;
*)
break
;;
esac
done
# constant width for version - default to WM_PROJECT_VERSION
version=$(printf %-36s ${version:-$WM_PROJECT_VERSION})
[ $# -ge 1 ] || usage
#------------------------------------------------------------------------------
printHeader()
{
cat<<HEADER cat<<HEADER
/*--------------------------------*- C++ -*----------------------------------*\\ /*--------------------------------*- C++ -*----------------------------------*\\
| ========= | | | ========= | |
| \\\\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\\\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\\\ / O peration | Version: ${foamVersion} | | \\\\ / O peration | Version: $version |
| \\\\ / A nd | Web: www.OpenFOAM.org | | \\\\ / A nd | Web: www.OpenFOAM.org |
| \\\\/ M anipulation | | | \\\\/ M anipulation | |
\\*---------------------------------------------------------------------------*/ \\*---------------------------------------------------------------------------*/
FoamFile FoamFile
{ {
version 2.0; version 2.0;
format ${1}; format $1;
class ${2}; class $2;
object ${3}; object $3;
} }
HEADER HEADER
} }
@ -75,68 +104,40 @@ HEADER
# #
# extract attribute '$1' from file '$2' # extract attribute '$1' from file '$2'
# #
FoamFileAttribute() { FoamFileAttribute()
{
sed -n -e 's/[ ;]*$//' -e "s/^ *$1 *//p" $2 sed -n -e 's/[ ;]*$//' -e "s/^ *$1 *//p" $2
} }
# #
# OPTIONS # main
# #
opts=$(getopt hv: $*)
if [ $? -ne 0 ]
then
echo "Aborting due to invalid option"
usage
fi
eval set -- '$opts'
while [ "$1" != "--" ]
do
case $1 in
-v)
foamVersion=$2
shift
;;
-h)
usage
;;
esac
shift
done
shift
[ $# -ge 1 ] || usage
# constant width for version
foamVersion=$(printf %-36s $foamVersion)
#
# MAIN
#
unset NOTE
tmpFile=FoamFile.tmp$$
for caseFile for caseFile
do do
if grep FoamFile $caseFile >/dev/null 2>&1 if grep FoamFile $caseFile >/dev/null 2>&1
then then
echo "Updating case file: $caseFile" echo "Updating case file: $caseFile"
sed -n '/FoamFile/,/}/p' $caseFile > FoamFile.tmp sed -n '/FoamFile/,/}/p' $caseFile > $tmpFile
FORMAT=$(FoamFileAttribute format FoamFile.tmp) format=$(FoamFileAttribute format $tmpFile)
CLASS=$(FoamFileAttribute class FoamFile.tmp) class=$(FoamFileAttribute class $tmpFile)
OBJECT=$(FoamFileAttribute object FoamFile.tmp) object=$(FoamFileAttribute object $tmpFile)
# extract NOTE? # extract note? - needs special handling
unset note
printHeader $FORMAT $CLASS $OBJECT $NOTE > FoamFile.tmp printHeader $format $class $object "$note" > $tmpFile
sed '1,/}/d' $caseFile | sed '/./,/^$/!d' >> FoamFile.tmp
sed '1,/}/d' $caseFile | sed '/./,/^$/!d' >> $tmpFile
# use cat to avoid removing/replace soft-links # use cat to avoid removing/replace soft-links
[ -s FoamFile.tmp ] && cat FoamFile.tmp >| $caseFile [ -s $tmpFile ] && cat $tmpFile >| $caseFile
rm -f FoamFile.tmp 2>/dev/null rm -f $tmpFile 2>/dev/null
else else
echo " Invalid case file: $caseFile" 1>&2 echo " Invalid case file: $caseFile" 1>&2
fi fi
done done
#------------------------------------------------------------------------------ #------------------------------------------------------------------ end-of-file

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -101,7 +101,7 @@ public:
explicit inline DynamicList(const label); explicit inline DynamicList(const label);
//- Construct copy. //- Construct copy.
explicit inline DynamicList inline DynamicList
( (
const DynamicList<T, SizeInc, SizeMult, SizeDiv>& const DynamicList<T, SizeInc, SizeMult, SizeDiv>&
); );
@ -116,7 +116,7 @@ public:
//- Construct by transferring the parameter contents //- Construct by transferring the parameter contents
explicit inline DynamicList(const Xfer<List<T> >&); explicit inline DynamicList(const Xfer<List<T> >&);
//- Construct from Istream. Size set to size of read list. //- Construct from Istream. Size set to size of list read.
explicit DynamicList(Istream&); explicit DynamicList(Istream&);

View File

@ -518,11 +518,28 @@ bool Foam::Time::loop()
if (running) if (running)
{ {
operator++(); if (!subCycling_)
{
readModifiedObjects();
if (timeIndex_ == startTimeIndex_)
{
functionObjects_.start();
}
else
{
functionObjects_.execute();
}
}
// Check update the "running" status following the "++" operation // Check update the "running" status following the "++" operation
// to take into account possible side-effects from functionObjects // to take into account possible side-effects from functionObjects
running = run(); running = run();
if (running)
{
operator++();
}
} }
return running; return running;
@ -667,20 +684,6 @@ Foam::Time& Foam::Time::operator+=(const scalar deltaT)
Foam::Time& Foam::Time::operator++() Foam::Time& Foam::Time::operator++()
{ {
if (!subCycling_)
{
readModifiedObjects();
if (timeIndex_ == startTimeIndex_)
{
functionObjects_.start();
}
else
{
functionObjects_.execute();
}
}
deltaT0_ = deltaTSave_; deltaT0_ = deltaTSave_;
deltaTSave_ = deltaT_; deltaTSave_ = deltaT_;

View File

@ -750,6 +750,20 @@ Foam::argList::~argList()
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::argList::printNotes() const
{
// output notes directly - no automatic text wrapping
if (!notes.empty())
{
Info<< nl;
forAllConstIter(SLList<string>, notes, iter)
{
Info<< iter().c_str() << nl;
}
}
}
void Foam::argList::printUsage() const void Foam::argList::printUsage() const
{ {
Info<< "\nUsage: " << executable_ << " [OPTIONS]"; Info<< "\nUsage: " << executable_ << " [OPTIONS]";
@ -819,20 +833,7 @@ void Foam::argList::printUsage() const
); );
// output notes directly - no automatic text wrapping printNotes();
if (!notes.empty())
{
Info<< nl;
for
(
SLList<string>::const_iterator iter = notes.begin();
iter != notes.end();
++iter
)
{
Info<< iter().c_str() << nl;
}
}
Info<< nl Info<< nl
<<"Using OpenFOAM-" << Foam::FOAMversion <<"Using OpenFOAM-" << Foam::FOAMversion

View File

@ -329,6 +329,9 @@ public:
// Print // Print
//- Print notes (if any)
void printNotes() const;
//- Print usage //- Print usage
void printUsage() const; void printUsage() const;

View File

@ -6,7 +6,7 @@ wmake libso field
wmake libso forces wmake libso forces
wmake libso IO wmake libso IO
wmake libso utilities wmake libso utilities
wmake libso residualControl wmake libso jobControl
wmake libso systemCall wmake libso systemCall
# ----------------------------------------------------------------- end-of-file # ----------------------------------------------------------------- end-of-file

View File

@ -29,10 +29,7 @@ License
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam defineTypeNameAndDebug(Foam::writeRegisteredObject, 0);
{
defineTypeNameAndDebug(writeRegisteredObject, 0);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //

View File

@ -36,13 +36,13 @@ writeFormat ascii;
writePrecision 6; writePrecision 6;
writeCompression uncompressed; writeCompression off;
timeFormat general; timeFormat general;
timePrecision 6; timePrecision 6;
runTimeModifiable yes; runTimeModifiable true;
functions functions
{ {

View File

@ -31,10 +31,7 @@ License
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam defineTypeNameAndDebug(Foam::fieldMinMax, 0);
{
defineTypeNameAndDebug(fieldMinMax, 0);
}
template<> template<>

View File

@ -30,31 +30,27 @@ License
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam defineTypeNameAndDebug(Foam::fieldValues::cellSource, 0);
template<>
const char* Foam::NamedEnum<Foam::fieldValues::cellSource::sourceType, 1>::
names[] =
{ {
namespace fieldValues "cellZone"
{ };
defineTypeNameAndDebug(cellSource, 0);
}
template<> const Foam::NamedEnum<Foam::fieldValues::cellSource::sourceType, 1>
const char* NamedEnum<fieldValues::cellSource::sourceType, 1>:: Foam::fieldValues::cellSource::sourceTypeNames_;
names[] = {"cellZone"};
const NamedEnum<fieldValues::cellSource::sourceType, 1> template<>
fieldValues::cellSource::sourceTypeNames_; const char* Foam::NamedEnum<Foam::fieldValues::cellSource::operationType, 5>::
names[] =
template<> {
const char* NamedEnum<fieldValues::cellSource::operationType, 5>::
names[] =
{
"none", "sum", "volAverage", "volIntegrate", "weightedAverage" "none", "sum", "volAverage", "volIntegrate", "weightedAverage"
}; };
const NamedEnum<fieldValues::cellSource::operationType, 5> const Foam::NamedEnum<Foam::fieldValues::cellSource::operationType, 5>
fieldValues::cellSource::operationTypeNames_; Foam::fieldValues::cellSource::operationTypeNames_;
}
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
@ -238,4 +234,3 @@ void Foam::fieldValues::cellSource::write()
// ************************************************************************* // // ************************************************************************* //

View File

@ -37,16 +37,16 @@ writeFormat ascii;
writePrecision 6; writePrecision 6;
writeCompression uncompressed; writeCompression off;
timeFormat general; timeFormat general;
timePrecision 6; timePrecision 6;
runTimeModifiable yes; runTimeModifiable true;
functions functions
( {
faceObj1 faceObj1
{ {
type faceSource; type faceSource;
@ -60,6 +60,7 @@ functions
// source faceZone; // source faceZone;
// sourceName f0; // sourceName f0;
operation areaAverage; operation areaAverage;
fields fields
( (
p p
@ -79,6 +80,7 @@ functions
source faceZone; source faceZone;
sourceName f0; sourceName f0;
operation sum; operation sum;
fields fields
( (
phi phi
@ -96,13 +98,13 @@ functions
source cellZone; source cellZone;
sourceName c0; sourceName c0;
operation volAverage; operation volAverage;
fields fields
( (
p p
U U
); );
} }
); }
// ************************************************************************* // // ************************************************************************* //

View File

@ -34,31 +34,27 @@ License
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam defineTypeNameAndDebug(Foam::fieldValues::faceSource, 0);
template<>
const char* Foam::NamedEnum<Foam::fieldValues::faceSource::sourceType, 2>::
names[] =
{ {
namespace fieldValues "faceZone", "patch"
{ };
defineTypeNameAndDebug(faceSource, 0);
}
template<> const Foam::NamedEnum<Foam::fieldValues::faceSource::sourceType, 2>
const char* NamedEnum<fieldValues::faceSource::sourceType, 2>:: Foam::fieldValues::faceSource::sourceTypeNames_;
names[] = {"faceZone", "patch"};
const NamedEnum<fieldValues::faceSource::sourceType, 2> template<>
fieldValues::faceSource::sourceTypeNames_; const char* Foam::NamedEnum<Foam::fieldValues::faceSource::operationType, 5>::
names[] =
template<> {
const char* NamedEnum<fieldValues::faceSource::operationType, 5>::
names[] =
{
"none", "sum", "areaAverage", "areaIntegrate", "weightedAverage" "none", "sum", "areaAverage", "areaIntegrate", "weightedAverage"
}; };
const NamedEnum<fieldValues::faceSource::operationType, 5> const Foam::NamedEnum<Foam::fieldValues::faceSource::operationType, 5>
fieldValues::faceSource::operationTypeNames_; Foam::fieldValues::faceSource::operationTypeNames_;
}
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //

View File

@ -16,7 +16,7 @@ FoamFile
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
functions functions
( {
readFields1 readFields1
{ {
type readFields; type readFields;
@ -24,11 +24,13 @@ functions
enabled true; enabled true;
outputControl timeStep; outputControl timeStep;
outputInterval 1; outputInterval 1;
fields fields
( (
interpolateU interpolateU
); );
} }
faceObj2 faceObj2
{ {
type faceSource; type faceSource;
@ -41,12 +43,12 @@ functions
source faceZone; source faceZone;
sourceName f0; sourceName f0;
operation areaAverage; operation areaAverage;
fields fields
( (
interpolateU interpolateU
); );
} }
); }
// ************************************************************************* // // ************************************************************************* //

View File

@ -28,10 +28,7 @@ License
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam defineTypeNameAndDebug(Foam::readFields, 0);
{
defineTypeNameAndDebug(readFields, 0);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //

View File

@ -31,14 +31,17 @@ License
namespace Foam namespace Foam
{ {
defineTypeNameAndDebug(streamLineParticle, 0); defineTypeNameAndDebug(streamLineParticle, 0);
defineParticleTypeNameAndDebug(streamLineParticle, 0); defineParticleTypeNameAndDebug(streamLineParticle, 0);
defineTemplateTypeNameAndDebugWithName defineTemplateTypeNameAndDebugWithName
( (
IOField<vectorField>, IOField<vectorField>,
"vectorFieldField", "vectorFieldField",
0 0
); );
}; }
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //

View File

@ -30,7 +30,7 @@ License
namespace Foam namespace Foam
{ {
defineTemplateTypeNameAndDebug(Cloud<streamLineParticle>, 0); defineTemplateTypeNameAndDebug(Cloud<streamLineParticle>, 0);
}; }
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //

View File

@ -30,10 +30,7 @@ License
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam defineTypeNameAndDebug(Foam::forceCoeffs, 0);
{
defineTypeNameAndDebug(forceCoeffs, 0);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //

View File

@ -39,10 +39,8 @@ License
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam defineTypeNameAndDebug(Foam::forces, 0);
{
defineTypeNameAndDebug(forces, 0);
}
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //

View File

@ -34,14 +34,15 @@ namespace Foam
namespace sixDoFRigidBodyMotionConstraints namespace sixDoFRigidBodyMotionConstraints
{ {
defineTypeNameAndDebug(fixedAxis, 0); defineTypeNameAndDebug(fixedAxis, 0);
addToRunTimeSelectionTable addToRunTimeSelectionTable
( (
sixDoFRigidBodyMotionConstraint, sixDoFRigidBodyMotionConstraint,
fixedAxis, fixedAxis,
dictionary dictionary
); );
}; }
}; }
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //

View File

@ -34,14 +34,15 @@ namespace Foam
namespace sixDoFRigidBodyMotionConstraints namespace sixDoFRigidBodyMotionConstraints
{ {
defineTypeNameAndDebug(fixedLine, 0); defineTypeNameAndDebug(fixedLine, 0);
addToRunTimeSelectionTable addToRunTimeSelectionTable
( (
sixDoFRigidBodyMotionConstraint, sixDoFRigidBodyMotionConstraint,
fixedLine, fixedLine,
dictionary dictionary
); );
}; }
}; }
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //

View File

@ -34,14 +34,15 @@ namespace Foam
namespace sixDoFRigidBodyMotionConstraints namespace sixDoFRigidBodyMotionConstraints
{ {
defineTypeNameAndDebug(fixedOrientation, 0); defineTypeNameAndDebug(fixedOrientation, 0);
addToRunTimeSelectionTable addToRunTimeSelectionTable
( (
sixDoFRigidBodyMotionConstraint, sixDoFRigidBodyMotionConstraint,
fixedOrientation, fixedOrientation,
dictionary dictionary
); );
}; }
}; }
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //

View File

@ -34,14 +34,15 @@ namespace Foam
namespace sixDoFRigidBodyMotionConstraints namespace sixDoFRigidBodyMotionConstraints
{ {
defineTypeNameAndDebug(fixedPlane, 0); defineTypeNameAndDebug(fixedPlane, 0);
addToRunTimeSelectionTable addToRunTimeSelectionTable
( (
sixDoFRigidBodyMotionConstraint, sixDoFRigidBodyMotionConstraint,
fixedPlane, fixedPlane,
dictionary dictionary
); );
}; }
}; }
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //

View File

@ -34,14 +34,15 @@ namespace Foam
namespace sixDoFRigidBodyMotionConstraints namespace sixDoFRigidBodyMotionConstraints
{ {
defineTypeNameAndDebug(fixedPoint, 0); defineTypeNameAndDebug(fixedPoint, 0);
addToRunTimeSelectionTable addToRunTimeSelectionTable
( (
sixDoFRigidBodyMotionConstraint, sixDoFRigidBodyMotionConstraint,
fixedPoint, fixedPoint,
dictionary dictionary
); );
}; }
}; }
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //

View File

@ -35,14 +35,15 @@ namespace Foam
namespace sixDoFRigidBodyMotionRestraints namespace sixDoFRigidBodyMotionRestraints
{ {
defineTypeNameAndDebug(linearAxialAngularSpring, 0); defineTypeNameAndDebug(linearAxialAngularSpring, 0);
addToRunTimeSelectionTable addToRunTimeSelectionTable
( (
sixDoFRigidBodyMotionRestraint, sixDoFRigidBodyMotionRestraint,
linearAxialAngularSpring, linearAxialAngularSpring,
dictionary dictionary
); );
}; }
}; }
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //

View File

@ -34,14 +34,15 @@ namespace Foam
namespace sixDoFRigidBodyMotionRestraints namespace sixDoFRigidBodyMotionRestraints
{ {
defineTypeNameAndDebug(linearSpring, 0); defineTypeNameAndDebug(linearSpring, 0);
addToRunTimeSelectionTable addToRunTimeSelectionTable
( (
sixDoFRigidBodyMotionRestraint, sixDoFRigidBodyMotionRestraint,
linearSpring, linearSpring,
dictionary dictionary
); );
}; }
}; }
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //

View File

@ -34,14 +34,15 @@ namespace Foam
namespace sixDoFRigidBodyMotionRestraints namespace sixDoFRigidBodyMotionRestraints
{ {
defineTypeNameAndDebug(sphericalAngularSpring, 0); defineTypeNameAndDebug(sphericalAngularSpring, 0);
addToRunTimeSelectionTable addToRunTimeSelectionTable
( (
sixDoFRigidBodyMotionRestraint, sixDoFRigidBodyMotionRestraint,
sphericalAngularSpring, sphericalAngularSpring,
dictionary dictionary
); );
}; }
}; }
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //

View File

@ -36,14 +36,15 @@ namespace Foam
namespace sixDoFRigidBodyMotionRestraints namespace sixDoFRigidBodyMotionRestraints
{ {
defineTypeNameAndDebug(tabulatedAxialAngularSpring, 0); defineTypeNameAndDebug(tabulatedAxialAngularSpring, 0);
addToRunTimeSelectionTable addToRunTimeSelectionTable
( (
sixDoFRigidBodyMotionRestraint, sixDoFRigidBodyMotionRestraint,
tabulatedAxialAngularSpring, tabulatedAxialAngularSpring,
dictionary dictionary
); );
}; }
}; }
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //

View File

@ -0,0 +1,7 @@
abortCalculation/abortCalculation.C
abortCalculation/abortCalculationFunctionObject.C
residualControl/residualControl.C
residualControl/residualControlFunctionObject.C
LIB = $(FOAM_LIBBIN)/libjobControl

View File

@ -31,10 +31,8 @@ License
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam defineTypeNameAndDebug(Foam::abortCalculation, 0);
{
defineTypeNameAndDebug(abortCalculation, 0);
}
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //

View File

@ -1,4 +1,4 @@
*--------------------------------*- C++ -*----------------------------------*\ /*--------------------------------*- C++ -*----------------------------------*\
| ========= | | | ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 | | \\ / O peration | Version: 1.6 |
@ -37,31 +37,32 @@ writeFormat ascii;
writePrecision 6; writePrecision 6;
writeCompression uncompressed; writeCompression off;
timeFormat general; timeFormat general;
timePrecision 6; timePrecision 6;
runTimeModifiable yes; runTimeModifiable true;
functions functions
( {
convergenceChecks convergenceChecks
{ {
type residualControl; type residualControl;
functionObjectLibs ( "libresidualControl.so" ); functionObjectLibs ( "libjobControl.so" );
outputControl timeStep; outputControl timeStep;
outputInterval 1; outputInterval 1;
maxResiduals maxResiduals
( {
(p 5e-4) p 5e-4;
(U 1e-3) U 1e-3;
);
}
);
// possibly check turbulence fields
"(k|epsilon|omega)" 1e-3;
}
}
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -24,40 +24,35 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "residualControl.H" #include "residualControl.H"
#include "dictionary.H"
#include "fvMesh.H" #include "fvMesh.H"
#include "Time.H" #include "Time.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam defineTypeNameAndDebug(Foam::residualControl, 0);
{
defineTypeNameAndDebug(residualControl, 0);
}
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
bool Foam::residualControl::checkCriteria(const bool output) const bool Foam::residualControl::checkCriteria(const bool verbose) const
{ {
bool achieved = true; bool achieved = true;
const fvMesh& mesh = static_cast<const fvMesh&>(obr_); const fvMesh& mesh = static_cast<const fvMesh&>(obr_);
const dictionary& solverDict = mesh.solverPerformanceDict(); const dictionary& solverDict = mesh.solverPerformanceDict();
forAll(maxResiduals_, i)
{
const word& variableName = maxResiduals_[i].first();
if (solverDict.found(variableName))
{
const scalar maxResidual = maxResiduals_[i].second();
const lduMatrix::solverPerformance forAllConstIter(dictionary, solverDict, iter)
sp(solverDict.lookup(variableName)); {
const word& variableName = iter().keyword();
scalar maxResidual;
const scalar eqnResidual = sp.initialResidual(); if (maxResiduals_.readIfPresent(variableName, maxResidual))
{
const scalar eqnResidual =
lduMatrix::solverPerformance(iter().stream()).initialResidual();
achieved = achieved && (eqnResidual < maxResidual); achieved = achieved && (eqnResidual < maxResidual);
if (output) if (verbose)
{ {
Info<< " " << variableName Info<< " " << variableName
<< ": requested max residual = " << maxResidual << ": requested max residual = " << maxResidual
@ -121,7 +116,7 @@ void Foam::residualControl::read(const dictionary& dict)
{ {
if (active_) if (active_)
{ {
dict.lookup("maxResiduals") >> maxResiduals_; maxResiduals_ = dict.subDict("maxResiduals");
} }
} }

View File

@ -37,8 +37,8 @@ SourceFiles
#ifndef residualControl_H #ifndef residualControl_H
#define residualControl_H #define residualControl_H
#include "dictionary.H"
#include "pointFieldFwd.H" #include "pointFieldFwd.H"
#include "Tuple2.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -69,8 +69,8 @@ protected:
//- On/off switch - on if obr_ is an fvMesh object //- On/off switch - on if obr_ is an fvMesh object
bool active_; bool active_;
//- List of variable name vs max residual //- Dictionary of variable names vs max residual
List<Tuple2<word, scalar> > maxResiduals_; dictionary maxResiduals_;
//- Flag to indicate whether convergence criteria have been met //- Flag to indicate whether convergence criteria have been met
bool criteriaSatisfied_; bool criteriaSatisfied_;
@ -79,7 +79,7 @@ protected:
// Protected Member Functions // Protected Member Functions
//- Perform residual control checks //- Perform residual control checks
bool checkCriteria(const bool output) const; bool checkCriteria(const bool verbose) const;
//- Disallow default bitwise copy construct //- Disallow default bitwise copy construct
residualControl(const residualControl&); residualControl(const residualControl&);
@ -113,7 +113,7 @@ public:
// Member Functions // Member Functions
//- Return name of the system call set //- Return name of the residual criteria check name
virtual const word& name() const virtual const word& name() const
{ {
return name_; return name_;
@ -122,13 +122,13 @@ public:
//- Read the system calls //- Read the system calls
virtual void read(const dictionary&); virtual void read(const dictionary&);
//- Execute the "executeCalls" at each time-step //- Check the residual criteria at each time-step
virtual void execute(); virtual void execute();
//- Execute the "endCalls" at the final time-loop //- Report residual criteria check at the final time-loop
virtual void end(); virtual void end();
//- Write, execute the "writeCalls" //- Write, not used
virtual void write(); virtual void write();
//- Update for changes of mesh //- Update for changes of mesh

View File

@ -1,4 +0,0 @@
residualControl.C
residualControlFunctionObject.C
LIB = $(FOAM_LIBBIN)/libresidualControl

View File

@ -29,10 +29,7 @@ License
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam defineTypeNameAndDebug(Foam::systemCall, 0);
{
defineTypeNameAndDebug(systemCall, 0);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //

View File

@ -1,6 +1,3 @@
abortCalculation/abortCalculation.C
abortCalculation/abortCalculationFunctionObject.C
staticPressure/staticPressure.C staticPressure/staticPressure.C
staticPressure/staticPressureFunctionObject.C staticPressure/staticPressureFunctionObject.C

View File

@ -34,10 +34,7 @@ using namespace Foam::constant;
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam defineTypeNameAndDebug(Foam::dsmcFields, 0);
{
defineTypeNameAndDebug(dsmcFields, 0);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //

View File

@ -29,10 +29,8 @@ License
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam defineTypeNameAndDebug(Foam::staticPressure, 0);
{
defineTypeNameAndDebug(staticPressure, 0);
}
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //

View File

@ -37,13 +37,13 @@ writeFormat ascii;
writePrecision 6; writePrecision 6;
writeCompression uncompressed; writeCompression off;
timeFormat general; timeFormat general;
timePrecision 6; timePrecision 6;
runTimeModifiable yes; runTimeModifiable true;
functions functions
{ {
@ -54,12 +54,13 @@ functions
outputControl timeStep; outputControl timeStep;
outputInterval 1; outputInterval 1;
fileToUpdate "$FOAM_CASE/system/fvSolution"; fileToUpdate "$FOAM_CASE/system/fvSolution";
timeVsFile timeVsFile
( (
(-1 "$FOAM_CASE/system/fvSolution.0") ( -1 "$FOAM_CASE/system/fvSolution.0" )
(0.10 "$FOAM_CASE/system/fvSolution.10") ( 0.10 "$FOAM_CASE/system/fvSolution.10" )
(0.20 "$FOAM_CASE/system/fvSolution.20") ( 0.20 "$FOAM_CASE/system/fvSolution.20" )
(0.35 "$FOAM_CASE/system/fvSolution.35") ( 0.35 "$FOAM_CASE/system/fvSolution.35" )
); );
} }
} }

View File

@ -30,10 +30,7 @@ License
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam defineTypeNameAndDebug(Foam::timeActivatedFileUpdate, 0);
{
defineTypeNameAndDebug(timeActivatedFileUpdate, 0);
}
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //

View File

@ -36,10 +36,8 @@ License
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam defineTypeNameAndDebug(Foam::isoSurface, 0);
{
defineTypeNameAndDebug(isoSurface, 0);
}
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //

View File

@ -34,10 +34,8 @@ License
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam defineTypeNameAndDebug(Foam::isoSurfaceCell, 0);
{
defineTypeNameAndDebug(isoSurfaceCell, 0);
}
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //

View File

@ -36,11 +36,11 @@ usage()
while [ "$#" -ge 1 ]; do echo "$1"; shift; done while [ "$#" -ge 1 ]; do echo "$1"; shift; done
cat<<USAGE cat<<USAGE
usage: $0 [OPTION] usage: ${0##*/} [OPTION]
options: options:
-d sets up a default scheme on all schemes -default sets up a default scheme on all schemes
-h this usage -help print the usage
* quickly tests the tutorials and writes out the scheme/solver information * quickly tests the tutorials and writes out the scheme/solver information
@ -48,6 +48,30 @@ USAGE
exit 1 exit 1
} }
#------------------------------------------------------------------------------
unset DEFAULT_SCHEMES
# parse options
while [ "$#" -gt 0 ]
do
case "$1" in
-h | -help)
usage
;;
-d | -default)
DEFAULT_SCHEMES=true
shift
;;
-*)
usage "unknown option: '$*'"
;;
*)
break
;;
esac
done
setDefaultFvSchemes() setDefaultFvSchemes()
{ {
@ -98,6 +122,7 @@ done
[ -f "$MAIN_CONTROL_DICT" ] || usage "main controlDict not found" [ -f "$MAIN_CONTROL_DICT" ] || usage "main controlDict not found"
TUTORIALS_DIR=. TUTORIALS_DIR=.
TEST_RUN_DIR=../tutorialsTest TEST_RUN_DIR=../tutorialsTest
FV_SCHEMES=\ FV_SCHEMES=\
@ -113,30 +138,7 @@ SCHEMES_FILE="FvSchemes"
SCHEMES_TEMP="FvSchemes.temp" SCHEMES_TEMP="FvSchemes.temp"
SOLVERS_FILE="FvSolution" SOLVERS_FILE="FvSolution"
SOLVERS_TEMP="FvSolution.temp" SOLVERS_TEMP="FvSolution.temp"
DEFAULT_SCHEMES=0
#
# OPTIONS
#
OPTS=`getopt hd $*`
if [ $? -ne 0 ]
then
usage "Aborting due to invalid option"
fi
eval set -- "$OPTS"
while [ $1 != -- ]
do
case $1 in
-d)
DEFAULT_SCHEMES=1
;;
-h)
usage
;;
esac
shift
done
shift
# #
# MAIN # MAIN
@ -182,7 +184,7 @@ do
${CD}.org > ${CD} ${CD}.org > ${CD}
done done
if [ $DEFAULT_SCHEMES = 1 ] if [ "$DEFAULT_SCHEMES" = true ]
then then
echo "Modifying the fvSchemes to contain only default schemes" echo "Modifying the fvSchemes to contain only default schemes"
for FV_SC in `find . -name fvSchemes` for FV_SC in `find . -name fvSchemes`
@ -209,8 +211,7 @@ do
echo "$APP: " | tr -d "\n" >> $SOLVERS_FILE echo "$APP: " | tr -d "\n" >> $SOLVERS_FILE
for ST in $FV_SCHEMES for ST in $FV_SCHEMES
do do
rm $SCHEMES_TEMP > /dev/null 2>&1 rm $SCHEMES_TEMP $SOLVERS_TEMP > /dev/null 2>&1
rm $SOLVERS_TEMP > /dev/null 2>&1
echo " ${ST}" >> $SCHEMES_FILE echo " ${ST}" >> $SCHEMES_FILE
for LOG in `find ${APP} -name "log.${APP}"` for LOG in `find ${APP} -name "log.${APP}"`
do do

View File

@ -37,13 +37,13 @@ writeFormat ascii;
writePrecision 6; writePrecision 6;
writeCompression uncompressed; writeCompression off;
timeFormat general; timeFormat general;
timePrecision 6; timePrecision 6;
runTimeModifiable yes; runTimeModifiable true;
graphFormat raw; graphFormat raw;

View File

@ -37,13 +37,13 @@ writeFormat ascii;
writePrecision 6; writePrecision 6;
writeCompression uncompressed; writeCompression off;
timeFormat general; timeFormat general;
timePrecision 6; timePrecision 6;
runTimeModifiable yes; runTimeModifiable true;
// ************************************************************************* // // ************************************************************************* //

View File

@ -37,13 +37,13 @@ writeFormat ascii;
writePrecision 6; writePrecision 6;
writeCompression uncompressed; writeCompression off;
timeFormat general; timeFormat general;
timePrecision 6; timePrecision 6;
runTimeModifiable yes; runTimeModifiable true;
// ************************************************************************* // // ************************************************************************* //

View File

@ -37,13 +37,13 @@ writeFormat ascii;
writePrecision 6; writePrecision 6;
writeCompression uncompressed; writeCompression off;
timeFormat general; timeFormat general;
timePrecision 6; timePrecision 6;
runTimeModifiable yes; runTimeModifiable true;
// ************************************************************************* // // ************************************************************************* //

View File

@ -37,13 +37,13 @@ writeFormat ascii;
writePrecision 6; writePrecision 6;
writeCompression uncompressed; writeCompression off;
timeFormat general; timeFormat general;
timePrecision 6; timePrecision 6;
runTimeModifiable yes; runTimeModifiable true;
// ************************************************************************* // // ************************************************************************* //

View File

@ -37,13 +37,13 @@ writeFormat ascii;
writePrecision 6; writePrecision 6;
writeCompression uncompressed; writeCompression off;
timeFormat general; timeFormat general;
timePrecision 6; timePrecision 6;
runTimeModifiable yes; runTimeModifiable true;
adjustTimeStep yes; adjustTimeStep yes;
@ -57,6 +57,7 @@ functions
functionObjectLibs ( "libfieldFunctionObjects.so" ); functionObjectLibs ( "libfieldFunctionObjects.so" );
enabled true; enabled true;
outputControl outputTime; outputControl outputTime;
fields fields
( (
U U
@ -76,5 +77,4 @@ functions
} }
} }
// ************************************************************************* // // ************************************************************************* //

View File

@ -37,13 +37,13 @@ writeFormat ascii;
writePrecision 6; writePrecision 6;
writeCompression compressed; writeCompression off;
timeFormat general; timeFormat general;
timePrecision 6; timePrecision 6;
runTimeModifiable yes; runTimeModifiable true;
adjustTimeStep yes; adjustTimeStep yes;
@ -57,6 +57,7 @@ functions
functionObjectLibs ( "libfieldFunctionObjects.so" ); functionObjectLibs ( "libfieldFunctionObjects.so" );
enabled true; enabled true;
outputControl outputTime; outputControl outputTime;
fields fields
( (
U U
@ -76,5 +77,4 @@ functions
} }
} }
// ************************************************************************* // // ************************************************************************* //

View File

@ -37,13 +37,13 @@ writeFormat ascii;
writePrecision 6; writePrecision 6;
writeCompression uncompressed; writeCompression off;
timeFormat general; timeFormat general;
timePrecision 6; timePrecision 6;
runTimeModifiable yes; runTimeModifiable true;
adjustTimeStep no; adjustTimeStep no;

View File

@ -37,7 +37,7 @@ writeFormat binary;
writePrecision 6; writePrecision 6;
writeCompression uncompressed; writeCompression off;
timeFormat general; timeFormat general;
@ -47,7 +47,7 @@ adjustTimeStep yes;
maxCo 0.1; maxCo 0.1;
runTimeModifiable yes; runTimeModifiable true;
// ************************************************************************* // // ************************************************************************* //

View File

@ -37,13 +37,13 @@ writeFormat ascii;
writePrecision 6; writePrecision 6;
writeCompression uncompressed; writeCompression off;
timeFormat general; timeFormat general;
timePrecision 6; timePrecision 6;
runTimeModifiable yes; runTimeModifiable true;
adjustTimeStep no; adjustTimeStep no;

View File

@ -37,13 +37,13 @@ writeFormat ascii;
writePrecision 6; writePrecision 6;
writeCompression uncompressed; writeCompression off;
timeFormat general; timeFormat general;
timePrecision 6; timePrecision 6;
runTimeModifiable yes; runTimeModifiable true;
adjustTimeStep no; adjustTimeStep no;

View File

@ -37,13 +37,13 @@ writeFormat ascii;
writePrecision 6; writePrecision 6;
writeCompression uncompressed; writeCompression off;
timeFormat general; timeFormat general;
timePrecision 6; timePrecision 6;
runTimeModifiable yes; runTimeModifiable true;
adjustTimeStep no; adjustTimeStep no;

View File

@ -36,7 +36,7 @@ writeFormat ascii;
writePrecision 6; writePrecision 6;
writeCompression uncompressed; writeCompression off;
timeFormat general; timeFormat general;
@ -44,7 +44,7 @@ timePrecision 6;
graphFormat raw; graphFormat raw;
runTimeModifiable yes; runTimeModifiable true;
adjustTimeStep yes; adjustTimeStep yes;

View File

@ -37,13 +37,13 @@ writeFormat ascii;
writePrecision 6; writePrecision 6;
writeCompression uncompressed; writeCompression off;
timeFormat general; timeFormat general;
timePrecision 6; timePrecision 6;
runTimeModifiable yes; runTimeModifiable true;
adjustTimeStep yes; adjustTimeStep yes;

View File

@ -37,7 +37,7 @@ writeFormat ascii;
writePrecision 15; writePrecision 15;
writeCompression uncompressed; writeCompression off;
timeFormat general; timeFormat general;

View File

@ -20,32 +20,34 @@ USAGE
exit 1 exit 1
} }
# -----------------------------------------------------------------------------
unset timeOpt unset timeOpt
OPTS=`getopt hl $*` # parse options
[ $? -eq 0 ] || usage "Aborting due to invalid option" while [ "$#" -gt 0 ]
eval set -- "$OPTS"
while [ $1 != -- ]
do do
case $1 in case "$1" in
-l) -h | -help)
timeOpt="-latestTime"
;;
-h)
usage usage
;; ;;
esac -l | -latestTime)
timeOpt="-latestTime"
shift shift
;;
*)
usage "unknown option/argument: '$*'"
;;
esac
done done
shift
sample $timeOpt sample $timeOpt
SDIR="sets" SDIR=sets
LSDIR=`ls $SDIR | head -1` LSDIR=`ls $SDIR | head -1`
EXAMPLE_FILE=`ls -1 $SDIR/${LSDIR}/* | head -1` EXAMPLE_FILE=`ls -1 $SDIR/${LSDIR}/* | head -1`
FS=`basename $EXAMPLE_FILE | cut -d_ -f2-` FS=`basename $EXAMPLE_FILE | cut -d_ -f2-`
for d in $SDIR/* for d in $SDIR/*
do do
cat ${d}/cone25_${FS} ${d}/cone55_${FS} ${d}/base_${FS} > ${d}/biconic_${FS} cat ${d}/cone25_${FS} ${d}/cone55_${FS} ${d}/base_${FS} > ${d}/biconic_${FS}

View File

@ -37,7 +37,7 @@ writeFormat ascii;
writePrecision 15; writePrecision 15;
writeCompression uncompressed; writeCompression off;
timeFormat general; timeFormat general;

View File

@ -37,13 +37,13 @@ writeFormat ascii;
writePrecision 6; writePrecision 6;
writeCompression uncompressed; writeCompression off;
timeFormat general; timeFormat general;
timePrecision 6; timePrecision 6;
runTimeModifiable yes; runTimeModifiable true;
adjustTimeStep yes; adjustTimeStep yes;

View File

@ -37,7 +37,7 @@ writeFormat ascii;
writePrecision 6; writePrecision 6;
writeCompression uncompressed; writeCompression off;
timeFormat general; timeFormat general;
@ -45,7 +45,7 @@ timePrecision 6;
graphFormat raw; graphFormat raw;
runTimeModifiable yes; runTimeModifiable true;
adjustTimeStep yes; adjustTimeStep yes;

View File

@ -37,13 +37,13 @@ writeFormat ascii;
writePrecision 6; writePrecision 6;
writeCompression uncompressed; writeCompression off;
timeFormat general; timeFormat general;
timePrecision 6; timePrecision 6;
runTimeModifiable yes; runTimeModifiable true;
adjustTimeStep yes; adjustTimeStep yes;

View File

@ -37,13 +37,13 @@ writeFormat ascii;
writePrecision 6; writePrecision 6;
writeCompression uncompressed; writeCompression off;
timeFormat general; timeFormat general;
timePrecision 6; timePrecision 6;
runTimeModifiable yes; runTimeModifiable true;
adjustTimeStep no; adjustTimeStep no;

View File

@ -37,13 +37,13 @@ writeFormat ascii;
writePrecision 6; writePrecision 6;
writeCompression uncompressed; writeCompression off;
timeFormat general; timeFormat general;
timePrecision 6; timePrecision 6;
runTimeModifiable yes; runTimeModifiable true;
adjustTimeStep no; adjustTimeStep no;

View File

@ -37,19 +37,18 @@ writeFormat ascii;
writePrecision 6; writePrecision 6;
writeCompression uncompressed; writeCompression off;
timeFormat general; timeFormat general;
timePrecision 6; timePrecision 6;
runTimeModifiable yes; runTimeModifiable true;
adjustTimeStep no; adjustTimeStep no;
maxCo 0.5; maxCo 0.5;
functions functions
{ {
fieldAverage1 fieldAverage1
@ -58,6 +57,7 @@ functions
functionObjectLibs ( "libfieldFunctionObjects.so" ); functionObjectLibs ( "libfieldFunctionObjects.so" );
enabled true; enabled true;
outputControl outputTime; outputControl outputTime;
fields fields
( (
U U
@ -77,5 +77,4 @@ functions
} }
} }
// ************************************************************************* // // ************************************************************************* //

View File

@ -37,13 +37,13 @@ writeFormat ascii;
writePrecision 6; writePrecision 6;
writeCompression uncompressed; writeCompression off;
timeFormat general; timeFormat general;
timePrecision 6; timePrecision 6;
runTimeModifiable yes; runTimeModifiable true;
adjustTimeStep no; adjustTimeStep no;

View File

@ -37,13 +37,13 @@ writeFormat ascii;
writePrecision 6; writePrecision 6;
writeCompression uncompressed; writeCompression off;
timeFormat general; timeFormat general;
timePrecision 6; timePrecision 6;
runTimeModifiable yes; runTimeModifiable true;
adjustTimeStep yes; adjustTimeStep yes;

View File

@ -37,7 +37,7 @@ writeFormat ascii;
writePrecision 6; writePrecision 6;
writeCompression uncompressed; writeCompression off;
timeFormat general; timeFormat general;
@ -45,7 +45,7 @@ timePrecision 6;
graphFormat raw; graphFormat raw;
runTimeModifiable yes; runTimeModifiable true;
// ************************************************************************* // // ************************************************************************* //

View File

@ -37,7 +37,7 @@ writeFormat binary;
writePrecision 6; writePrecision 6;
writeCompression uncompressed; writeCompression off;
timeFormat general; timeFormat general;
@ -45,7 +45,7 @@ timePrecision 6;
graphFormat raw; graphFormat raw;
runTimeModifiable yes; runTimeModifiable true;
// ************************************************************************* // // ************************************************************************* //

View File

@ -37,7 +37,7 @@ writeFormat ascii;
writePrecision 6; writePrecision 6;
writeCompression uncompressed; writeCompression off;
timeFormat general; timeFormat general;
@ -45,7 +45,7 @@ timePrecision 6;
graphFormat raw; graphFormat raw;
runTimeModifiable yes; runTimeModifiable true;
// ************************************************************************* // // ************************************************************************* //

View File

@ -37,13 +37,13 @@ writeFormat ascii;
writePrecision 6; writePrecision 6;
writeCompression uncompressed; writeCompression off;
timeFormat general; timeFormat general;
timePrecision 6; timePrecision 6;
runTimeModifiable yes; runTimeModifiable true;
// ************************************************************************* // // ************************************************************************* //

View File

@ -37,13 +37,13 @@ writeFormat ascii;
writePrecision 6; writePrecision 6;
writeCompression uncompressed; writeCompression off;
timeFormat general; timeFormat general;
timePrecision 6; timePrecision 6;
runTimeModifiable yes; runTimeModifiable true;
// ************************************************************************* // // ************************************************************************* //

View File

@ -37,13 +37,13 @@ writeFormat ascii;
writePrecision 6; writePrecision 6;
writeCompression uncompressed; writeCompression off;
timeFormat general; timeFormat general;
timePrecision 6; timePrecision 6;
runTimeModifiable yes; runTimeModifiable true;
adjustTimeStep no; adjustTimeStep no;

View File

@ -37,13 +37,13 @@ writeFormat ascii;
writePrecision 6; writePrecision 6;
writeCompression uncompressed; writeCompression off;
timeFormat general; timeFormat general;
timePrecision 6; timePrecision 6;
runTimeModifiable yes; runTimeModifiable true;
adjustTimeStep no; adjustTimeStep no;

View File

@ -37,13 +37,13 @@ writeFormat ascii;
writePrecision 6; writePrecision 6;
writeCompression uncompressed; writeCompression off;
timeFormat general; timeFormat general;
timePrecision 6; timePrecision 6;
runTimeModifiable yes; runTimeModifiable true;
// ************************************************************************* // // ************************************************************************* //

View File

@ -37,13 +37,13 @@ writeFormat ascii;
writePrecision 6; writePrecision 6;
writeCompression uncompressed; writeCompression off;
timeFormat general; timeFormat general;
timePrecision 6; timePrecision 6;
runTimeModifiable yes; runTimeModifiable true;
// ************************************************************************* // // ************************************************************************* //

View File

@ -37,13 +37,13 @@ writeFormat ascii;
writePrecision 6; writePrecision 6;
writeCompression compressed; writeCompression off;
timeFormat general; timeFormat general;
timePrecision 6; timePrecision 6;
runTimeModifiable yes; runTimeModifiable true;
functions functions
{ {
@ -53,10 +53,12 @@ functions
functionObjectLibs ( "libforces.so" ); functionObjectLibs ( "libforces.so" );
outputControl timeStep; outputControl timeStep;
outputInterval 1; outputInterval 1;
patches patches
( (
WALL10 WALL10
); );
pName p; pName p;
UName U; UName U;
log true; log true;
@ -71,5 +73,4 @@ functions
} }
} }
// ************************************************************************* // // ************************************************************************* //

View File

@ -37,13 +37,13 @@ writeFormat ascii;
writePrecision 6; writePrecision 6;
writeCompression uncompressed; writeCompression off;
timeFormat general; timeFormat general;
timePrecision 6; timePrecision 6;
runTimeModifiable yes; runTimeModifiable true;
// ************************************************************************* // // ************************************************************************* //

View File

@ -37,13 +37,13 @@ writeFormat ascii;
writePrecision 6; writePrecision 6;
writeCompression compressed; writeCompression off;
timeFormat general; timeFormat general;
timePrecision 6; timePrecision 6;
runTimeModifiable yes; runTimeModifiable true;
// ************************************************************************* // // ************************************************************************* //

View File

@ -37,23 +37,23 @@ writeFormat ascii;
writePrecision 10; writePrecision 10;
writeCompression uncompressed; writeCompression off;
timeFormat general; timeFormat general;
timePrecision 6; timePrecision 6;
runTimeModifiable yes; runTimeModifiable true;
adjustTimeStep no; adjustTimeStep no;
functions functions
( {
dsmcFields1 dsmcFields1
{ {
type dsmcFields; type dsmcFields;
enabled on;
functionObjectLibs ( "libutilityFunctionObjects.so" ); functionObjectLibs ( "libutilityFunctionObjects.so" );
enabled true;
outputControl outputTime; outputControl outputTime;
} }
fieldAverage1 fieldAverage1
@ -62,6 +62,7 @@ functions
functionObjectLibs ( "libfieldFunctionObjects.so" ); functionObjectLibs ( "libfieldFunctionObjects.so" );
outputControl outputTime; outputControl outputTime;
resetOnOutput off; resetOnOutput off;
fields fields
( (
rhoN rhoN
@ -120,7 +121,6 @@ functions
} }
); );
} }
); }
// ************************************************************************* // // ************************************************************************* //

View File

@ -37,23 +37,23 @@ writeFormat ascii;
writePrecision 10; writePrecision 10;
writeCompression uncompressed; writeCompression off;
timeFormat general; timeFormat general;
timePrecision 6; timePrecision 6;
runTimeModifiable yes; runTimeModifiable true;
adjustTimeStep no; adjustTimeStep no;
functions functions
( {
dsmcFields1 dsmcFields1
{ {
type dsmcFields; type dsmcFields;
enabled on;
functionObjectLibs ( "libutilityFunctionObjects.so" ); functionObjectLibs ( "libutilityFunctionObjects.so" );
enabled true;
outputControl outputTime; outputControl outputTime;
} }
fieldAverage1 fieldAverage1
@ -62,6 +62,7 @@ functions
functionObjectLibs ( "libfieldFunctionObjects.so" ); functionObjectLibs ( "libfieldFunctionObjects.so" );
outputControl outputTime; outputControl outputTime;
resetOnOutput off; resetOnOutput off;
fields fields
( (
rhoN rhoN
@ -120,7 +121,6 @@ functions
} }
); );
} }
); }
// ************************************************************************* // // ************************************************************************* //

View File

@ -37,23 +37,23 @@ writeFormat ascii;
writePrecision 10; writePrecision 10;
writeCompression uncompressed; writeCompression off;
timeFormat general; timeFormat general;
timePrecision 6; timePrecision 6;
runTimeModifiable yes; runTimeModifiable true;
adjustTimeStep no; adjustTimeStep no;
functions functions
( {
dsmcFields1 dsmcFields1
{ {
type dsmcFields; type dsmcFields;
enabled on;
functionObjectLibs ( "libutilityFunctionObjects.so" ); functionObjectLibs ( "libutilityFunctionObjects.so" );
enabled true;
outputControl outputTime; outputControl outputTime;
} }
fieldAverage1 fieldAverage1
@ -62,6 +62,7 @@ functions
functionObjectLibs ( "libfieldFunctionObjects.so" ); functionObjectLibs ( "libfieldFunctionObjects.so" );
outputControl outputTime; outputControl outputTime;
resetOnOutput off; resetOnOutput off;
fields fields
( (
rhoN rhoN
@ -120,7 +121,6 @@ functions
} }
); );
} }
); }
// ************************************************************************* // // ************************************************************************* //

View File

@ -38,23 +38,23 @@ writeFormat ascii;
writePrecision 10; writePrecision 10;
writeCompression uncompressed; writeCompression off;
timeFormat general; timeFormat general;
timePrecision 6; timePrecision 6;
runTimeModifiable yes; runTimeModifiable true;
adjustTimeStep no; adjustTimeStep no;
functions functions
( {
dsmcFields1 dsmcFields1
{ {
type dsmcFields; type dsmcFields;
enabled on;
functionObjectLibs ( "libutilityFunctionObjects.so" ); functionObjectLibs ( "libutilityFunctionObjects.so" );
enabled true;
outputControl outputTime; outputControl outputTime;
} }
@ -64,6 +64,7 @@ functions
functionObjectLibs ( "libfieldFunctionObjects.so" ); functionObjectLibs ( "libfieldFunctionObjects.so" );
outputControl outputTime; outputControl outputTime;
resetOnOutput off; resetOnOutput off;
fields fields
( (
rhoN rhoN
@ -126,7 +127,7 @@ functions
forces1 forces1
{ {
type forces; type forces;
enabled on; enabled true;
functionObjectLibs ( "libforces.so" ); functionObjectLibs ( "libforces.so" );
outputControl outputTime; outputControl outputTime;
patches ( obstacle ); patches ( obstacle );
@ -135,7 +136,6 @@ functions
CofR ( 0 0 0 ); CofR ( 0 0 0 );
log on; log on;
} }
); }
// ************************************************************************* // // ************************************************************************* //

View File

@ -36,13 +36,13 @@ writeFormat ascii;
writePrecision 12; writePrecision 12;
writeCompression uncompressed; writeCompression off;
timeFormat general; timeFormat general;
timePrecision 6; timePrecision 6;
runTimeModifiable yes; runTimeModifiable true;
adjustTimeStep no; adjustTimeStep no;

View File

@ -36,13 +36,13 @@ writeFormat ascii;
writePrecision 12; writePrecision 12;
writeCompression uncompressed; writeCompression off;
timeFormat general; timeFormat general;
timePrecision 6; timePrecision 6;
runTimeModifiable yes; runTimeModifiable true;
adjustTimeStep no; adjustTimeStep no;

View File

@ -36,13 +36,13 @@ writeFormat ascii;
writePrecision 12; writePrecision 12;
writeCompression uncompressed; writeCompression off;
timeFormat general; timeFormat general;
timePrecision 6; timePrecision 6;
runTimeModifiable yes; runTimeModifiable true;
adjustTimeStep no; adjustTimeStep no;

View File

@ -37,13 +37,13 @@ writeFormat ascii;
writePrecision 6; writePrecision 6;
writeCompression uncompressed; writeCompression off;
timeFormat general; timeFormat general;
timePrecision 6; timePrecision 6;
runTimeModifiable yes; runTimeModifiable true;
// ************************************************************************* // // ************************************************************************* //

View File

@ -37,13 +37,13 @@ writeFormat ascii;
writePrecision 6; writePrecision 6;
writeCompression uncompressed; writeCompression off;
timeFormat general; timeFormat general;
timePrecision 6; timePrecision 6;
runTimeModifiable yes; runTimeModifiable true;
// ************************************************************************* // // ************************************************************************* //

View File

@ -37,13 +37,13 @@ writeFormat ascii;
writePrecision 6; writePrecision 6;
writeCompression uncompressed; writeCompression off;
timeFormat general; timeFormat general;
timePrecision 6; timePrecision 6;
runTimeModifiable yes; runTimeModifiable true;
graphFormat raw; graphFormat raw;

View File

@ -37,13 +37,13 @@ writeFormat ascii;
writePrecision 6; writePrecision 6;
writeCompression uncompressed; writeCompression off;
timeFormat general; timeFormat general;
timePrecision 6; timePrecision 6;
runTimeModifiable yes; runTimeModifiable true;
adjustTimeStep no; adjustTimeStep no;

Some files were not shown because too many files have changed in this diff Show More