Upgraded the ParaView build scripts to version 3.3-cvs.
[OpenFOAM-1.5.x.git] / bin / foamGraphResUVWP
blob6e2bfbdc9dd7e3f9c8dce6b3614be1fff0f182bf
1 #!/bin/csh -f
2 #------------------------------------------------------------------------------
3 # ========= |
4 # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 # \\ / O peration |
6 # \\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd.
7 # \\/ M anipulation |
8 #-------------------------------------------------------------------------------
9 # License
10 # This file is part of OpenFOAM.
12 # OpenFOAM is free software; you can redistribute it and/or modify it
13 # under the terms of the GNU General Public License as published by the
14 # Free Software Foundation; either version 2 of the License, or (at your
15 # option) any later version.
17 # OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
18 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
19 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
20 # for more details.
22 # You should have received a copy of the GNU General Public License
23 # along with OpenFOAM; if not, write to the Free Software Foundation,
24 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
26 # Script
27 # foamGraphResUVWP
29 # Description
31 #------------------------------------------------------------------------------
33 set tmpU = newU$$.dat
34 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
36 set tmpV = newV$$.dat
37 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
39 set tmpW = newW$$.dat
40 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
42 set tmpP = newP$$.dat
43 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
45 set linesU = `cat $tmpU | wc -l`
46 set linesV = `cat $tmpV | wc -l`
47 set linesW = `cat $tmpW | wc -l`
48 set linesP = `cat $tmpP | wc -l`
50 set ngraphs = 0
52 if ($linesU > 1) then
53 @ ngraphs = $ngraphs + 1
54 endif
56 if ($linesV > 1) then
57 @ ngraphs = $ngraphs + 1
58 endif
60 if ($linesW > 1) then
61 @ ngraphs = $ngraphs + 1
62 endif
64 if ($linesP > 1) then
65 @ ngraphs = $ngraphs + 1
66 endif
68 cat << EOF > residualUVWP.dat
69 EOF
70 #Solver Performance
71 #number of iterations
72 #residual
73 #0 0
74 #0 0
75 #$ngraphs
76 #EOF
78 if ($linesU > 1) then
79 cat << EOF >> residualUVWP.dat
81 EOF
84 #$linesU
85 #EOF
86 cat $tmpU >> residualUVWP.dat
87 endif
89 if ($linesV > 1) then
90 cat << EOF >> residualUVWP.dat
92 EOF
95 #$linesV
96 #EOF
97 cat $tmpV >> residualUVWP.dat
98 endif
100 if ($linesW > 1) then
101 cat << EOF >> residualUVWP.dat
106 #$linesW
107 #EOF
108 cat $tmpW >> residualUVWP.dat
109 endif
111 if ($linesP > 1) then
112 cat << EOF >> residualUVWP.dat
117 #$linesP
118 #EOF
119 cat $tmpP >> residualUVWP.dat
120 endif
122 rm $tmpU
123 rm $tmpV
124 rm $tmpW
125 rm $tmpP
127 #------------------------------------------------------------------------------