ENH: foamLog: added -localDB and made -quiet really quiet

This commit is contained in:
mattijs
2011-07-21 09:40:22 +01:00
parent 0ca4904ec5
commit a67876c202

12
bin/foamLog Executable file → Normal file
View File

@ -45,6 +45,7 @@ Usage: $Script [OPTIONS] <log>
-list lists but does not extract -list lists but does not extract
-n create single column files with the extracted data only -n create single column files with the extracted data only
-quiet quiet operation -quiet quiet operation
-localDB only use the local database file
-help print the usage -help print the usage
$Script - extracts xy files from OpenFOAM logs. $Script - extracts xy files from OpenFOAM logs.
@ -103,7 +104,7 @@ usage
timeName=Time timeName=Time
unset listOpt quietOpt unset listOpt quietOpt localDB
# parse options # parse options
while [ "$#" -gt 0 ] while [ "$#" -gt 0 ]
@ -125,6 +126,10 @@ do
quietOpt=true quietOpt=true
shift shift
;; ;;
-localDB)
localDB=true
shift
;;
-*) -*)
usage "unknown option: '$*'" usage "unknown option: '$*'"
;; ;;
@ -219,7 +224,7 @@ getSolveQueryList()
getAllQueries() getAllQueries()
{ {
#-- All solved for queries from log file #-- All solved for queries from log file
queries=`getSolveQueryList $2` [ "$localDB" = true ] || queries=`getSolveQueryList $2`
#-- Add ones from database, present in log file #-- Add ones from database, present in log file
# Note: just like awk, line selected with regular expression, # Note: just like awk, line selected with regular expression,
@ -369,6 +374,7 @@ AWK_CONTENTS
# #
# Code for extracting solved for quantities # Code for extracting solved for quantities
# #
[ "$localDB" = true ] ||
cat << AWK_CONTENTS >> $AWKFILE cat << AWK_CONTENTS >> $AWKFILE
# Extraction of any solved for variable # Extraction of any solved for variable
/Solving for/ { /Solving for/ {
@ -432,7 +438,7 @@ done
# Print found # Print found
#----------------------------- #-----------------------------
myEcho "Generated XY files for:" myEcho "Generated XY files for:"
getAllQueries $DBFILE $LOG [ "$quietOpt" = true ] || getAllQueries $DBFILE $LOG
myEcho "End" myEcho "End"
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------