Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
openfoam
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Development
openfoam
Commits
a67876c2
Commit
a67876c2
authored
14 years ago
by
mattijs
Browse files
Options
Downloads
Patches
Plain Diff
ENH: foamLog: added -localDB and made -quiet really quiet
parent
0ca4904e
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bin/foamLog
+32
-26
32 additions, 26 deletions
bin/foamLog
with
32 additions
and
26 deletions
bin/foamLog
100755 → 100644
+
32
−
26
View file @
a67876c2
...
@@ -45,6 +45,7 @@ Usage: $Script [OPTIONS] <log>
...
@@ -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
...
@@ -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
...
@@ -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()
...
@@ -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,29 +374,30 @@ AWK_CONTENTS
...
@@ -369,29 +374,30 @@ AWK_CONTENTS
#
#
# Code for extracting solved for quantities
# Code for extracting solved for quantities
#
#
cat
<<
AWK_CONTENTS
>>
$AWKFILE
[
"
$localDB
"
=
true
]
||
# Extraction of any solved for variable
cat
<<
AWK_CONTENTS
>>
$AWKFILE
/Solving for/ {
# Extraction of any solved for variable
extract(
\$
0, "Solving for ", varNameVal)
/Solving for/ {
extract(
\$
0, "Solving for ", varNameVal)
varName=varNameVal[1]
file=varName "_" subIter[varName]++
varName=varNameVal[1]
file="
$outputDir
/" file
file=varName "_" subIter[varName]++
extract(
\$
0, "Initial residual = ", val)
file="
$outputDir
/" file
print
$timeName
"
\t
" val[1] > file
extract(
\$
0, "Initial residual = ", val)
print
$timeName
"
\t
" val[1] > file
varName=varNameVal[1] "FinalRes"
file=varName "_" subIter[varName]++
varName=varNameVal[1] "FinalRes"
file="
$outputDir
/" file
file=varName "_" subIter[varName]++
extract(
\$
0, "Final residual = ", val)
file="
$outputDir
/" file
print
$timeName
"
\t
" val[1] > file
extract(
\$
0, "Final residual = ", val)
print
$timeName
"
\t
" val[1] > file
varName=varNameVal[1] "Iters"
file=varName "_" subIter[varName]++
varName=varNameVal[1] "Iters"
file="
$outputDir
/" file
file=varName "_" subIter[varName]++
extract(
\$
0, "No Iterations ", val)
file="
$outputDir
/" file
print
$timeName
"
\t
" val[1] > file
extract(
\$
0, "No Iterations ", val)
}
print
$timeName
"
\t
" val[1] > file
}
AWK_CONTENTS
AWK_CONTENTS
# ----------
# ----------
...
@@ -432,7 +438,7 @@ done
...
@@ -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"
#------------------------------------------------------------------------------
#------------------------------------------------------------------------------
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment