File: diffusion.sh

package info (click to toggle)
gerris 20131206%2Bdfsg-22
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 14,248 kB
  • sloc: ansic: 66,595; sh: 15,922; f90: 1,513; makefile: 1,152; fortran: 696; python: 493; awk: 104; lisp: 89; xml: 27
file content (37 lines) | stat: -rw-r--r-- 768 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
if gerris2D diffusion.gfs; then
    mv end.gfs end-explicit.gfs
    mv prof prof-explicit
else
    exit 1
fi

if sed -e 's/SourceDiffusionExplicit T/#/' \
       -e 's/#    SourceDiffusion/    SourceDiffusion/' < diffusion.gfs | \
   gerris2D -; then
    mv end.gfs end-implicit.gfs
    mv prof prof-implicit
else
    exit 1
fi

if cat <<EOF | gnuplot; then :
    set term postscript eps color lw 3 solid 20
    set output 'profile.eps'
    set xlabel 'r'
    set ylabel 'T'
    set key top left
    plot 'prof-explicit' t 'explicit', 'prof-implicit' t 'implicit'
EOF
else
    exit 1
fi

if gfscompare2D -v end-explicit.gfs end-implicit.gfs T 2>&1 | awk '{
  if ($1 == "total" && ($6 > 3e-3 || $8 > 4e-3)) {
    print $0
    exit (1)
  }
}'; then :
else
    exit 1
fi