File: bipolar.sh

package info (click to toggle)
gerris 20131206%2Bdfsg-21
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 14,252 kB
  • sloc: ansic: 66,595; sh: 15,922; f90: 1,513; makefile: 1,150; fortran: 696; python: 493; awk: 104; lisp: 89; xml: 27
file content (59 lines) | stat: -rw-r--r-- 1,436 bytes parent folder | download | duplicates (2)
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
if test x$donotrun != xtrue; then
    for level in 2 3 4 5 6; do
	if gerris2D -DLEVEL=$level $1; then :
	else
	    exit 1
	fi
    done > error
fi

# fixme: for the moment GfsView doesn't do coordinate transformations,
# but the Gnuplot output does
if echo "Save mesh.gnu { format = Gnuplot }" | \
    gfsview-batch2D end-3.gfs mesh.gfv; then :
else
    exit 1
fi

if gnuplot <<EOF ; then :
    set term postscript eps color lw 3 solid 20 enhanced
    set output 'convergence.eps'
    set xlabel 'Spatial resolution'
    set ylabel 'Error norms'
    set logscale
    set grid
    set xtics 2
    set key spacing 1.5 bottom left
    ftitle(a,b) = sprintf("%.3g/x^{%4.2f}", exp(a), -b)
    f2(x)=a2+b2*x
    fit f2(x) 'error' u (log(2**\$1)):(log(\$3)) via a2,b2
    fm(x)=am+bm*x
    fit fm(x) 'error' u (log(2**\$1)):(log(\$4)) via am,bm
    plot [3:96]'error' u (2**\$1):4 t 'Max' w p ps 2, exp(fm(log(x))) t ftitle(am,bm), \
               'error' u (2**\$1):3 t 'L2' w p ps 2,  exp(f2(log(x))) t ftitle(a2,b2)

    set term postscript eps lw 2 solid
    set output 'mesh.eps'
    unset key
    unset logscale
    unset border
    unset xtics
    unset ytics
    unset xlabel
    unset ylabel
    set size ratio -1
    plot 'mesh.gnu' w l lc 0
EOF
else
    exit 1
fi

if cat <<EOF | python3 ; then :
from check import *
from sys import *
if (Curve('error',1,4) - Curve('error.ref',1,4)).max() > 1e-6:
    exit(1)
EOF
else
   exit 1
fi