Merge branch 'master' of github.com:OpenCFD/OpenFOAM-1.7.x
[OpenFOAM-1.7.x.git] / bin / foamGraphResUVWP
blob323a547f4ca5cc1e6e99e9e0010916406cd37b04
1 #!/bin/csh -f
2 #---------------------------------*- sh -*-------------------------------------
3 # ========= |
4 # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 # \\ / O peration |
6 # \\ / A nd | Copyright (C) 1991-2010 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
14 # the Free Software Foundation, either version 3 of the License, or
15 # (at your 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, see <http://www.gnu.org/licenses/>.
25 # Script
26 # foamGraphResUVWP
28 # Description
30 #------------------------------------------------------------------------------
32 set tmpU = newU$$.dat
33 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
35 set tmpV = newV$$.dat
36 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
38 set tmpW = newW$$.dat
39 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
41 set tmpP = newP$$.dat
42 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
44 set linesU = `cat $tmpU | wc -l`
45 set linesV = `cat $tmpV | wc -l`
46 set linesW = `cat $tmpW | wc -l`
47 set linesP = `cat $tmpP | wc -l`
49 set ngraphs = 0
51 if ($linesU > 1) then
52 @ ngraphs = $ngraphs + 1
53 endif
55 if ($linesV > 1) then
56 @ ngraphs = $ngraphs + 1
57 endif
59 if ($linesW > 1) then
60 @ ngraphs = $ngraphs + 1
61 endif
63 if ($linesP > 1) then
64 @ ngraphs = $ngraphs + 1
65 endif
67 cat << EOF > residualUVWP.dat
68 EOF
69 #Solver Performance
70 #number of iterations
71 #residual
72 #0 0
73 #0 0
74 #$ngraphs
75 #EOF
77 if ($linesU > 1) then
78 cat << EOF >> residualUVWP.dat
80 EOF
83 #$linesU
84 #EOF
85 cat $tmpU >> residualUVWP.dat
86 endif
88 if ($linesV > 1) then
89 cat << EOF >> residualUVWP.dat
91 EOF
94 #$linesV
95 #EOF
96 cat $tmpV >> residualUVWP.dat
97 endif
99 if ($linesW > 1) then
100 cat << EOF >> residualUVWP.dat
105 #$linesW
106 #EOF
107 cat $tmpW >> residualUVWP.dat
108 endif
110 if ($linesP > 1) then
111 cat << EOF >> residualUVWP.dat
116 #$linesP
117 #EOF
118 cat $tmpP >> residualUVWP.dat
119 endif
121 rm $tmpU
122 rm $tmpV
123 rm $tmpW
124 rm $tmpP
126 #------------------------------------------------------------------------------