bin/foamGraph.*: Converted to POSIX shell
This commit is contained in:
@ -1,9 +1,9 @@
|
|||||||
#!/bin/csh -f
|
#!/bin/sh
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# ========= |
|
# ========= |
|
||||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
# \\ / O peration |
|
# \\ / O peration |
|
||||||
# \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
# \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
# \\/ M anipulation |
|
# \\/ M anipulation |
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
# License
|
# License
|
||||||
@ -28,17 +28,19 @@
|
|||||||
# Description
|
# Description
|
||||||
#
|
#
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
if (! -f "$1" ) then
|
Script=${0##*/}
|
||||||
echo "No file: '$1'"
|
|
||||||
exit 1
|
|
||||||
endif
|
|
||||||
|
|
||||||
set tmpTime = newTime$$.dat
|
if [ ! -f "$1" ]; then
|
||||||
|
echo "$Script: $1 is not a valid filename"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
tmpTime=newTime$$.dat
|
||||||
cat $1 | grep "ExecutionTime = " | awk 'BEGIN { NENTRIES = 0 ; TPREV = 0.0 }{NENTRIES++; printf("%f %e\n", NENTRIES, $3 - TPREV); TPREV = $3}' - > $tmpTime
|
cat $1 | grep "ExecutionTime = " | awk 'BEGIN { NENTRIES = 0 ; TPREV = 0.0 }{NENTRIES++; printf("%f %e\n", NENTRIES, $3 - TPREV); TPREV = $3}' - > $tmpTime
|
||||||
|
|
||||||
set linesExec = `cat $tmpTime | wc -l`
|
linesExec=$(cat $tmpTime | wc -l)
|
||||||
|
|
||||||
set ngraphs = 0
|
ngraphs=0
|
||||||
|
|
||||||
cat << EOF > executionTime.dat
|
cat << EOF > executionTime.dat
|
||||||
Solver Performance
|
Solver Performance
|
||||||
@ -49,14 +51,14 @@ time/iteration
|
|||||||
1
|
1
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
if ($linesExec > 1) then
|
if [ "$linesExec" -gt 1 ]; then
|
||||||
cat << EOF >> executionTime.dat
|
cat << EOF >> executionTime.dat
|
||||||
time
|
time
|
||||||
0
|
0
|
||||||
$linesExec
|
$linesExec
|
||||||
EOF
|
EOF
|
||||||
cat $tmpTime >> executionTime.dat
|
cat $tmpTime >> executionTime.dat
|
||||||
endif
|
fi
|
||||||
|
|
||||||
rm $tmpTime
|
rm $tmpTime
|
||||||
|
|
||||||
|
|||||||
@ -1,9 +1,9 @@
|
|||||||
#!/bin/csh -f
|
#!/bin/sh
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# ========= |
|
# ========= |
|
||||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
# \\ / O peration |
|
# \\ / O peration |
|
||||||
# \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
# \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
# \\/ M anipulation |
|
# \\/ M anipulation |
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
# License
|
# License
|
||||||
@ -28,29 +28,31 @@
|
|||||||
# Description
|
# Description
|
||||||
#
|
#
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
if (! -f "$1" ) then
|
Script=${0##*/}
|
||||||
echo "No file: '$1'"
|
|
||||||
exit 1
|
|
||||||
endif
|
|
||||||
|
|
||||||
set tmpK = newK$$.dat
|
if [ ! -f "$1" ]; then
|
||||||
|
echo "$Script: $1 is not a valid filename"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
tmpK=newK$$.dat
|
||||||
cat $1 | grep "Solving for k" | grep -v "solution singularity" | sed s/,//g | awk 'BEGIN { NENTRIES = 0 }{NENTRIES++; printf("%f %e\n", NENTRIES, $8)}' - > $tmpK
|
cat $1 | grep "Solving for k" | grep -v "solution singularity" | sed s/,//g | awk 'BEGIN { NENTRIES = 0 }{NENTRIES++; printf("%f %e\n", NENTRIES, $8)}' - > $tmpK
|
||||||
|
|
||||||
set tmpEpsilon = newEpsilon$$.dat
|
tmpEpsilon=newEpsilon$$.dat
|
||||||
cat $1 | grep "Solving for epsilon" | grep -v "solution singularity" | sed s/,//g | awk 'BEGIN { NENTRIES = 0 }{NENTRIES++; printf("%f %e\n", NENTRIES, $8)}' - > $tmpEpsilon
|
cat $1 | grep "Solving for epsilon" | grep -v "solution singularity" | sed s/,//g | awk 'BEGIN { NENTRIES = 0 }{NENTRIES++; printf("%f %e\n", NENTRIES, $8)}' - > $tmpEpsilon
|
||||||
|
|
||||||
set linesK = `cat $tmpK | wc -l`
|
linesK=$(cat $tmpK | wc -l)
|
||||||
set linesEpsilon = `cat $tmpEpsilon | wc -l`
|
linesEpsilon=$(cat $tmpEpsilon | wc -l)
|
||||||
|
|
||||||
set ngraphs = 0
|
ngraphs=0
|
||||||
|
|
||||||
if ($linesK > 1) then
|
if [ "$linesK" -gt 1 ]; then
|
||||||
@ ngraphs = $ngraphs + 1
|
ngraphs=$(($ngraphs+1))
|
||||||
endif
|
fi
|
||||||
|
|
||||||
if ($linesEpsilon > 1) then
|
if [ "$linesEpsilon" -gt 1 ]; then
|
||||||
@ ngraphs = $ngraphs + 1
|
ngraphs=$(($ngraphs+1))
|
||||||
endif
|
fi
|
||||||
|
|
||||||
cat << EOF > residualKE.dat
|
cat << EOF > residualKE.dat
|
||||||
Solver Performance
|
Solver Performance
|
||||||
@ -61,23 +63,23 @@ residual
|
|||||||
$ngraphs
|
$ngraphs
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
if ($linesK > 1) then
|
if [ "$linesK" -gt 1 ]; then
|
||||||
cat << EOF >> residualKE.dat
|
cat << EOF >> residualKE.dat
|
||||||
k
|
k
|
||||||
0
|
0
|
||||||
$linesK
|
$linesK
|
||||||
EOF
|
EOF
|
||||||
cat $tmpK >> residualKE.dat
|
cat $tmpK >> residualKE.dat
|
||||||
endif
|
fi
|
||||||
|
|
||||||
if ($linesEpsilon > 1) then
|
if [ "$linesEpsilon" -gt 1 ]; then
|
||||||
cat << EOF >> residualKE.dat
|
cat << EOF >> residualKE.dat
|
||||||
epsilon
|
epsilon
|
||||||
0
|
0
|
||||||
$linesEpsilon
|
$linesEpsilon
|
||||||
EOF
|
EOF
|
||||||
cat $tmpEpsilon >> residualKE.dat
|
cat $tmpEpsilon >> residualKE.dat
|
||||||
endif
|
fi
|
||||||
|
|
||||||
rm $tmpK
|
rm $tmpK
|
||||||
rm $tmpEpsilon
|
rm $tmpEpsilon
|
||||||
|
|||||||
@ -1,9 +1,9 @@
|
|||||||
#!/bin/csh -f
|
#!/bin/sh
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# ========= |
|
# ========= |
|
||||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
# \\ / O peration |
|
# \\ / O peration |
|
||||||
# \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
# \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
# \\/ M anipulation |
|
# \\/ M anipulation |
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
# License
|
# License
|
||||||
@ -28,45 +28,47 @@
|
|||||||
# Description
|
# Description
|
||||||
#
|
#
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
if (! -f "$1" ) then
|
Script=${0##*/}
|
||||||
echo "No file: '$1'"
|
|
||||||
exit 1
|
|
||||||
endif
|
|
||||||
|
|
||||||
set tmpU = newU$$.dat
|
if [ ! -f "$1" ]; then
|
||||||
|
echo "$Script: $1 is not a valid filename"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
tmpU=newU$$.dat
|
||||||
cat $1 | grep "Solving for Ux" | grep -v "solution singularity" | sed s/,//g | awk 'BEGIN { NENTRIES = 0 }{NENTRIES++; printf("%d %e\n", NENTRIES, $8)}' - > $tmpU
|
cat $1 | grep "Solving for Ux" | grep -v "solution singularity" | sed s/,//g | awk 'BEGIN { NENTRIES = 0 }{NENTRIES++; printf("%d %e\n", NENTRIES, $8)}' - > $tmpU
|
||||||
|
|
||||||
set tmpV = newV$$.dat
|
tmpV=newV$$.dat
|
||||||
cat $1 | grep "Solving for Uy" | grep -v "solution singularity" | sed s/,//g | awk 'BEGIN { NENTRIES = 0 }{NENTRIES++; printf("%d %e\n", NENTRIES, $8)}' - > $tmpV
|
cat $1 | grep "Solving for Uy" | grep -v "solution singularity" | sed s/,//g | awk 'BEGIN { NENTRIES = 0 }{NENTRIES++; printf("%d %e\n", NENTRIES, $8)}' - > $tmpV
|
||||||
|
|
||||||
set tmpW = newW$$.dat
|
tmpW=newW$$.dat
|
||||||
cat $1 | grep "Solving for Uz" | grep -v "solution singularity" | sed s/,//g | awk 'BEGIN { NENTRIES = 0 }{NENTRIES++; printf("%d %e\n", NENTRIES, $8)}' - > $tmpW
|
cat $1 | grep "Solving for Uz" | grep -v "solution singularity" | sed s/,//g | awk 'BEGIN { NENTRIES = 0 }{NENTRIES++; printf("%d %e\n", NENTRIES, $8)}' - > $tmpW
|
||||||
|
|
||||||
set tmpP = newP$$.dat
|
tmpP=newP$$.dat
|
||||||
cat $1 | grep "Solving for p" | grep -v "solution singularity" | sed s/,//g | awk 'BEGIN { NENTRIES = 0 }{NENTRIES++; printf("%d %e\n", NENTRIES, $8)}' - > $tmpP
|
cat $1 | grep "Solving for p" | grep -v "solution singularity" | sed s/,//g | awk 'BEGIN { NENTRIES = 0 }{NENTRIES++; printf("%d %e\n", NENTRIES, $8)}' - > $tmpP
|
||||||
|
|
||||||
set linesU = `cat $tmpU | wc -l`
|
linesU=$(cat $tmpU | wc -l)
|
||||||
set linesV = `cat $tmpV | wc -l`
|
linesV=$(cat $tmpV | wc -l)
|
||||||
set linesW = `cat $tmpW | wc -l`
|
linesW=$(cat $tmpW | wc -l)
|
||||||
set linesP = `cat $tmpP | wc -l`
|
linesP=$(cat $tmpP | wc -l)
|
||||||
|
|
||||||
set ngraphs = 0
|
ngraphs=0
|
||||||
|
|
||||||
if ($linesU > 1) then
|
if [ "$linesU" -gt 1 ]; then
|
||||||
@ ngraphs = $ngraphs + 1
|
ngraphs=$(($ngraphs+1))
|
||||||
endif
|
fi
|
||||||
|
|
||||||
if ($linesV > 1) then
|
if [ "$linesV" -gt 1 ]; then
|
||||||
@ ngraphs = $ngraphs + 1
|
ngraphs=$(($ngraphs+1))
|
||||||
endif
|
fi
|
||||||
|
|
||||||
if ($linesW > 1) then
|
if [ "$linesW" -gt 1 ]; then
|
||||||
@ ngraphs = $ngraphs + 1
|
ngraphs=$(($ngraphs+1))
|
||||||
endif
|
fi
|
||||||
|
|
||||||
if ($linesP > 1) then
|
if [ "$linesP" -gt 1 ]; then
|
||||||
@ ngraphs = $ngraphs + 1
|
ngraphs=$(($ngraphs+1))
|
||||||
endif
|
fi
|
||||||
|
|
||||||
cat << EOF > residualUVWP.dat
|
cat << EOF > residualUVWP.dat
|
||||||
EOF
|
EOF
|
||||||
@ -78,7 +80,7 @@ EOF
|
|||||||
#$ngraphs
|
#$ngraphs
|
||||||
#EOF
|
#EOF
|
||||||
|
|
||||||
if ($linesU > 1) then
|
if [ "$linesU" -gt 1 ]; then
|
||||||
cat << EOF >> residualUVWP.dat
|
cat << EOF >> residualUVWP.dat
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
@ -87,9 +89,9 @@ EOF
|
|||||||
#$linesU
|
#$linesU
|
||||||
#EOF
|
#EOF
|
||||||
cat $tmpU >> residualUVWP.dat
|
cat $tmpU >> residualUVWP.dat
|
||||||
endif
|
fi
|
||||||
|
|
||||||
if ($linesV > 1) then
|
if [ "$linesV" -gt 1 ]; then
|
||||||
cat << EOF >> residualUVWP.dat
|
cat << EOF >> residualUVWP.dat
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
@ -98,9 +100,9 @@ EOF
|
|||||||
#$linesV
|
#$linesV
|
||||||
#EOF
|
#EOF
|
||||||
cat $tmpV >> residualUVWP.dat
|
cat $tmpV >> residualUVWP.dat
|
||||||
endif
|
fi
|
||||||
|
|
||||||
if ($linesW > 1) then
|
if [ "$linesW" -gt 1 ]; then
|
||||||
cat << EOF >> residualUVWP.dat
|
cat << EOF >> residualUVWP.dat
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
@ -109,9 +111,9 @@ EOF
|
|||||||
#$linesW
|
#$linesW
|
||||||
#EOF
|
#EOF
|
||||||
cat $tmpW >> residualUVWP.dat
|
cat $tmpW >> residualUVWP.dat
|
||||||
endif
|
fi
|
||||||
|
|
||||||
if ($linesP > 1) then
|
if [ "$linesP" -gt 1 ]; then
|
||||||
cat << EOF >> residualUVWP.dat
|
cat << EOF >> residualUVWP.dat
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
@ -120,7 +122,7 @@ EOF
|
|||||||
#$linesP
|
#$linesP
|
||||||
#EOF
|
#EOF
|
||||||
cat $tmpP >> residualUVWP.dat
|
cat $tmpP >> residualUVWP.dat
|
||||||
endif
|
fi
|
||||||
|
|
||||||
rm $tmpU
|
rm $tmpU
|
||||||
rm $tmpV
|
rm $tmpV
|
||||||
|
|||||||
Reference in New Issue
Block a user