View | Details | Raw Unified | Return to bug 49940
Collapse All | Expand All

(-)a/doc/examples/Makefile.am (-2 / +2 lines)
Lines 68-74 DOC = examples Link Here
68
BIBINPUTS = $(top_srcdir)/doc
68
BIBINPUTS = $(top_srcdir)/doc
69
69
70
Makefile.deps: template.tex depend.py Makefile.am
70
Makefile.deps: template.tex depend.py Makefile.am
71
	python depend.py `grep \\test{[^/]*} < template.tex | sed 's/\\\\test{\(.*\)}/\1/g'` > Makefile.deps
71
	python3 depend.py `grep \\test{[^/]*} < template.tex | sed 's/\\\\test{\(.*\)}/\1/g'` > Makefile.deps
72
	echo "" >> Makefile.deps
72
	echo "" >> Makefile.deps
73
	echo -n "EXAMPLES = " >> Makefile.deps
73
	echo -n "EXAMPLES = " >> Makefile.deps
74
	echo `grep \\test{[^/]*} < template.tex | sed 's/\\\\test{\(.*\)}/\1/g'` >> Makefile.deps
74
	echo `grep \\test{[^/]*} < template.tex | sed 's/\\\\test{\(.*\)}/\1/g'` >> Makefile.deps
Lines 77-83 include Makefile.deps Link Here
77
77
78
examples.tex: template.tex Makefile.deps gfs2tex gfs2tex.py
78
examples.tex: template.tex Makefile.deps gfs2tex gfs2tex.py
79
	rm -r -f examples
79
	rm -r -f examples
80
	python gfs2tex $(EXAMPLES)
80
	python3 gfs2tex $(EXAMPLES)
81
	sed -e "s/GFS_VERSION/`$(top_srcdir)/src/gerris2D -V 2>&1 | head -1 | cut -d' ' -f6-`/g" \
81
	sed -e "s/GFS_VERSION/`$(top_srcdir)/src/gerris2D -V 2>&1 | head -1 | cut -d' ' -f6-`/g" \
82
	    -e 's/\\test{\(.*\)\/\(.*\)}/\\input{\1\/\2\/\2.tex}/g' \
82
	    -e 's/\\test{\(.*\)\/\(.*\)}/\\input{\1\/\2\/\2.tex}/g' \
83
	    -e 's/\\test{\(.*\)}/\\input{\1\/\1.tex}/g' \
83
	    -e 's/\\test{\(.*\)}/\\input{\1\/\1.tex}/g' \
(-)a/doc/examples/Makefile.in (-2 / +2 lines)
Lines 1240-1246 clean-generic: Link Here
1240
	$(RM) -r examples
1240
	$(RM) -r examples
1241
1241
1242
Makefile.deps: template.tex depend.py Makefile.am
1242
Makefile.deps: template.tex depend.py Makefile.am
1243
	python depend.py `grep \\test{[^/]*} < template.tex | sed 's/\\\\test{\(.*\)}/\1/g'` > Makefile.deps
1243
	python3 depend.py `grep \\test{[^/]*} < template.tex | sed 's/\\\\test{\(.*\)}/\1/g'` > Makefile.deps
1244
	echo "" >> Makefile.deps
1244
	echo "" >> Makefile.deps
1245
	echo -n "EXAMPLES = " >> Makefile.deps
1245
	echo -n "EXAMPLES = " >> Makefile.deps
1246
	echo `grep \\test{[^/]*} < template.tex | sed 's/\\\\test{\(.*\)}/\1/g'` >> Makefile.deps
1246
	echo `grep \\test{[^/]*} < template.tex | sed 's/\\\\test{\(.*\)}/\1/g'` >> Makefile.deps
Lines 1409-1415 examples.tex: \ Link Here
1409
1409
1410
examples.tex: template.tex Makefile.deps gfs2tex gfs2tex.py
1410
examples.tex: template.tex Makefile.deps gfs2tex gfs2tex.py
1411
	rm -r -f examples
1411
	rm -r -f examples
1412
	python gfs2tex $(EXAMPLES)
1412
	python3 gfs2tex $(EXAMPLES)
1413
	sed -e "s/GFS_VERSION/`$(top_srcdir)/src/gerris2D -V 2>&1 | head -1 | cut -d' ' -f6-`/g" \
1413
	sed -e "s/GFS_VERSION/`$(top_srcdir)/src/gerris2D -V 2>&1 | head -1 | cut -d' ' -f6-`/g" \
1414
	    -e 's/\\test{\(.*\)\/\(.*\)}/\\input{\1\/\2\/\2.tex}/g' \
1414
	    -e 's/\\test{\(.*\)\/\(.*\)}/\\input{\1\/\2\/\2.tex}/g' \
1415
	    -e 's/\\test{\(.*\)}/\\input{\1\/\1.tex}/g' \
1415
	    -e 's/\\test{\(.*\)}/\\input{\1\/\1.tex}/g' \
(-)a/doc/examples/atomisation.sh (-1 / +1 lines)
Line 1 Link Here
1
python -u test.py atomisation
1
python3 -u test.py atomisation
(-)a/doc/examples/boussinesq.sh (-1 / +1 lines)
Line 1 Link Here
1
python -u test.py boussinesq
1
python3 -u test.py boussinesq
(-)a/doc/examples/bubble.sh (-1 / +1 lines)
Line 1 Link Here
1
python -u test.py bubble
1
python3 -u test.py bubble
(-)a/doc/examples/column.sh (-1 / +1 lines)
Line 1 Link Here
1
python -u test.py column
1
python3 -u test.py column
(-)a/doc/examples/cyclone.sh (-1 / +1 lines)
Line 1 Link Here
1
python -u test.py cyclone
1
python3 -u test.py cyclone
(-)a/doc/examples/cylinder.sh (-1 / +1 lines)
Line 1 Link Here
1
python -u test.py cylinder
1
python3 -u test.py cylinder
(-)a/doc/examples/dam.sh (-1 / +1 lines)
Line 1 Link Here
1
python -u test.py dam
1
python3 -u test.py dam
(-)a/doc/examples/depend.py (-12 / +14 lines)
Lines 1-12 Link Here
1
#!/usr/bin/python
1
#!/usr/bin/python3
2
2
3
import sys
3
import sys
4
import os
4
import os
5
import os.path
5
import os.path
6
import gfs2tex
6
import gfs2tex
7
7
8
print "## File generated automatically by depend.py: do not modify by hand"
8
print("## File generated automatically by depend.py: do not modify by hand")
9
print ""
9
print("")
10
10
11
dists = ""
11
dists = ""
12
depends = ""
12
depends = ""
Lines 15-23 tests = "" Link Here
15
for start in sys.argv[1:]:
15
for start in sys.argv[1:]:
16
    tests += "\\\n\t" + start + ".sh"
16
    tests += "\\\n\t" + start + ".sh"
17
    f = open(start + ".sh", "w")
17
    f = open(start + ".sh", "w")
18
    f.write("python -u test.py " + start + "\n")
18
    f.write("python3 -u test.py " + start + "\n")
19
    f.close()
19
    f.close()
20
    os.chmod(start + ".sh",0755)
20
    os.chmod(start + ".sh",0o755)
21
    for root, dirs, files in os.walk(start,topdown=True):
21
    for root, dirs, files in os.walk(start,topdown=True):
22
        if not ".xvpics" in root:
22
        if not ".xvpics" in root:
23
            example = gfs2tex.Example(root)
23
            example = gfs2tex.Example(root)
Lines 33-42 for start in sys.argv[1:]: Link Here
33
                if f[-4:] == ".mpg" or f[-4:] == ".ogv" or f[-4:] == ".png" or f[-4:] == ".mp4":
33
                if f[-4:] == ".mpg" or f[-4:] == ".ogv" or f[-4:] == ".png" or f[-4:] == ".mp4":
34
                    docs += "\\\n\t" + example.path + "/" + f
34
                    docs += "\\\n\t" + example.path + "/" + f
35
35
36
print "DOCS = " + docs + dists
36
print("DOCS = " + docs + dists)
37
print ""
37
print("")
38
print "TESTS = " + tests
38
print("TESTS = " + tests)
39
print ""
39
print("")
40
print "EXTRA_DIST += $(TESTS)" + dists
40
print("EXTRA_DIST += $(TESTS)" + dists)
41
print ""
41
print("")
42
print "examples.tex: " + depends
42
print("TESTS = " + tests)
43
print("")
44
print("examples.tex: " + depends)
(-)a/doc/examples/forcedturbulence.sh (-1 / +1 lines)
Line 1 Link Here
1
python -u test.py forcedturbulence
1
python3 -u test.py forcedturbulence
(-)a/doc/examples/garden.sh (-1 / +1 lines)
Line 1 Link Here
1
python -u test.py garden
1
python3 -u test.py garden
(-)a/doc/examples/gfs2doc.in (-10 / +10 lines)
Lines 1-4 Link Here
1
#!/usr/bin/python
1
#!/usr/bin/python3
2
2
3
import sys
3
import sys
4
import os
4
import os
Lines 10-16 sys.path.append("@prefix@/share/gerris") Link Here
10
import gfs2tex
10
import gfs2tex
11
11
12
if len(sys.argv) < 2:
12
if len(sys.argv) < 2:
13
    print "usage: gfs2doc DIR1 DIR2..."
13
    print("usage: gfs2doc DIR1 DIR2...")
14
    sys.exit(1)
14
    sys.exit(1)
15
15
16
def myexit(s):
16
def myexit(s):
Lines 51-60 for d in sys.argv[1:]: Link Here
51
              "&& dvips -Ppdf -G0 " + example.name + ".dvi -o " + example.name + ".ps" +\
51
              "&& dvips -Ppdf -G0 " + example.name + ".dvi -o " + example.name + ".ps" +\
52
              "&& ps2pdf -sPAPERSIZE=a4 -dMaxSubsetPct=100 -dCompatibilityLevel=1.2 -dSubsetFonts=true -dEmbedAllFonts=true " + example.name + ".ps " + example.name + ".pdf" +\
52
              "&& ps2pdf -sPAPERSIZE=a4 -dMaxSubsetPct=100 -dCompatibilityLevel=1.2 -dSubsetFonts=true -dEmbedAllFonts=true " + example.name + ".ps " + example.name + ".pdf" +\
53
              "&& mv " + example.name + ".pdf " + os.getcwd()):
53
              "&& mv " + example.name + ".pdf " + os.getcwd()):
54
        print "\n\n**** Errors occured while generating file ****: " + example.name + ".pdf"
54
        print("\n\n**** Errors occured while generating file ****: " + example.name + ".pdf")
55
        myexit(1)
55
        myexit(1)
56
        
56
        
57
    print "\n\n**** Successfully generated file ****: " + example.name + ".pdf\n\n"
57
    print("\n\n**** Successfully generated file ****: " + example.name + ".pdf\n\n")
58
    hname = wdname + "/" + example.name + "_html"
58
    hname = wdname + "/" + example.name + "_html"
59
    os.mkdir(hname)
59
    os.mkdir(hname)
60
    os.symlink("../" + example.name, hname + "/" + example.name)
60
    os.symlink("../" + example.name, hname + "/" + example.name)
Lines 63-69 for d in sys.argv[1:]: Link Here
63
                 "&& cd " + wdname + \
63
                 "&& cd " + wdname + \
64
		 "&& hevea -fix -I @prefix@/share/gerris " + example.name + ".tex" + \
64
		 "&& hevea -fix -I @prefix@/share/gerris " + example.name + ".tex" + \
65
                 "&& sh @prefix@/share/gerris/kaltura.sh " + example.name):
65
                 "&& sh @prefix@/share/gerris/kaltura.sh " + example.name):
66
        print "\n\n**** Errors occured while generating directory ****: " + example.name + "_html"
66
        print("\n\n**** Errors occured while generating directory ****: " + example.name + "_html")
67
        myexit(1)
67
        myexit(1)
68
    os.system("export TEXINPUTS=\".:@prefix@/share/gerris:\" " +\
68
    os.system("export TEXINPUTS=\".:@prefix@/share/gerris:\" " +\
69
                  "&& cd " + wdname + \
69
                  "&& cd " + wdname + \
Lines 72-91 for d in sys.argv[1:]: Link Here
72
                  hname + \
72
                  hname + \
73
                  "; mv " + hname + " " + wdir)
73
                  "; mv " + hname + " " + wdir)
74
        
74
        
75
    print "\n\n**** Successfully generated directory ****: " + example.name + "_html\n"
75
    print("\n\n**** Successfully generated directory ****: " + example.name + "_html\n")
76
    files = example.name + "/" + example.name + ".gfs"
76
    files = example.name + "/" + example.name + ".gfs"
77
    for f in example.required:
77
    for f in example.required:
78
        files += " " + example.name + "/" + f
78
        files += " " + example.name + "/" + f
79
    if os.system("tar czf " + example.name + ".tgz " + files):
79
    if os.system("tar czf " + example.name + ".tgz " + files):
80
        print "**** Errors occured while generating file ****: " + example.name + ".tgz"
80
        print("**** Errors occured while generating file ****: " + example.name + ".tgz")
81
        os.remove(example.name + ".tgz")
81
        os.remove(example.name + ".tgz")
82
        myexit(1)
82
        myexit(1)
83
    status,msg = example.test()
83
    status,msg = example.test()
84
    if status != None:
84
    if status != None:
85
        print "**** Errors occured while generating file ****: " + example.name + ".tgz"
85
        print("**** Errors occured while generating file ****: " + example.name + ".tgz")
86
        print " ".join(msg)
86
        print(" ".join(msg))
87
        os.remove(example.name + ".tgz")
87
        os.remove(example.name + ".tgz")
88
        myexit(1)
88
        myexit(1)
89
89
90
    print "**** Successfully generated file ****: " + example.name + ".tgz"
90
    print("**** Successfully generated file ****: " + example.name + ".tgz")
91
    os.system("rm -r -f " + wdname)
91
    os.system("rm -r -f " + wdname)
(-)a/doc/examples/gfs2tex (-1 / +1 lines)
Lines 1-4 Link Here
1
#!/usr/bin/python
1
#!/usr/bin/python3
2
2
3
import sys
3
import sys
4
import os
4
import os
(-)a/doc/examples/gfs2tex.py (-1 / +1 lines)
Lines 163-169 class Example: Link Here
163
            if len(record) > 0:
163
            if len(record) > 0:
164
                if record[0] == "user":
164
                if record[0] == "user":
165
                    self.runtime = float(record[1])
165
                    self.runtime = float(record[1])
166
                    print >>open(self.path + "/runtime",'w'), self.runtime
166
                    print(self.runtime, file=open(self.path + "/runtime",'w'))
167
                elif record[0] != "real" and record[0] != "sys":
167
                elif record[0] != "real" and record[0] != "sys":
168
                    lines.append(l)
168
                    lines.append(l)
169
            else:
169
            else:
(-)a/doc/examples/hump.sh (-1 / +1 lines)
Line 1 Link Here
1
python -u test.py hump
1
python3 -u test.py hump
(-)a/doc/examples/logo.sh (-1 / +1 lines)
Line 1 Link Here
1
python -u test.py logo
1
python3 -u test.py logo
(-)a/doc/examples/monai.sh (-1 / +1 lines)
Line 1 Link Here
1
python -u test.py monai
1
python3 -u test.py monai
(-)a/doc/examples/plateau.sh (-1 / +1 lines)
Line 1 Link Here
1
python -u test.py plateau
1
python3 -u test.py plateau
(-)a/doc/examples/rt.sh (-1 / +1 lines)
Line 1 Link Here
1
python -u test.py rt
1
python3 -u test.py rt
(-)a/doc/examples/ship.sh (-1 / +1 lines)
Line 1 Link Here
1
python -u test.py ship
1
python3 -u test.py ship
(-)a/doc/examples/shock.sh (-1 / +1 lines)
Line 1 Link Here
1
python -u test.py shock
1
python3 -u test.py shock
(-)a/doc/examples/starting.sh (-1 / +1 lines)
Line 1 Link Here
1
python -u test.py starting
1
python3 -u test.py starting
(-)a/doc/examples/tangaroa.sh (-1 / +1 lines)
Line 1 Link Here
1
python -u test.py tangaroa
1
python3 -u test.py tangaroa
(-)a/doc/examples/test.py (-6 / +6 lines)
Lines 11-22 for start in sys.argv[1:]: Link Here
11
            example = gfs2tex.Example(root)
11
            example = gfs2tex.Example(root)
12
            status,msg = example.test()
12
            status,msg = example.test()
13
            if status != None:
13
            if status != None:
14
                print "FAIL:",root
14
                print("FAIL:",root)
15
                if len(msg) > 0:
15
                if len(msg) > 0:
16
                    print " ".join(msg)
16
                    print(" ".join(msg))
17
                failed += 1
17
                failed += 1
18
            else:
18
            else:
19
                print "PASS:",root
19
                print("PASS:",root)
20
            n += 1
20
            n += 1
21
21
22
if failed:
22
if failed:
Lines 24-32 if failed: Link Here
24
else:
24
else:
25
    msg = "All " + repr(n) + " tests passed"
25
    msg = "All " + repr(n) + " tests passed"
26
26
27
print len(msg)*"="
27
print(len(msg)*"=")
28
print msg
28
print(msg)
29
print len(msg)*"="
29
print(len(msg)*"=")
30
30
31
if failed:
31
if failed:
32
    sys.exit(1)
32
    sys.exit(1)
(-)a/doc/examples/tides.sh (-1 / +1 lines)
Line 1 Link Here
1
python -u test.py tides
1
python3 -u test.py tides
(-)a/doc/examples/tsunami.sh (-1 / +1 lines)
Line 1 Link Here
1
python -u test.py tsunami
1
python3 -u test.py tsunami
(-)a/doc/examples/viscmix.sh (-1 / +1 lines)
Line 1 Link Here
1
python -u test.py viscmix
1
python3 -u test.py viscmix
(-)a/doc/examples/wingtip.sh (-1 / +1 lines)
Line 1 Link Here
1
python -u test.py wingtip
1
python3 -u test.py wingtip
(-)a/test/Makefile.am (-2 / +2 lines)
Lines 24-30 TEXINPUTS = .:$(top_srcdir)/doc/examples: Link Here
24
BIBINPUTS = $(top_srcdir)/doc
24
BIBINPUTS = $(top_srcdir)/doc
25
25
26
Makefile.deps: template.tex depend.py Makefile.am
26
Makefile.deps: template.tex depend.py Makefile.am
27
	python depend.py `grep \\test{[^/]*} < template.tex | sed 's/\\\\test{\(.*\)}/\1/g'` > Makefile.deps
27
	python3 depend.py `grep \\test{[^/]*} < template.tex | sed 's/\\\\test{\(.*\)}/\1/g'` > Makefile.deps
28
	echo "" >> Makefile.deps
28
	echo "" >> Makefile.deps
29
	echo -n "TESTDIRS = " >> Makefile.deps
29
	echo -n "TESTDIRS = " >> Makefile.deps
30
	echo `grep \\test{[^/]*} < template.tex | sed 's/\\\\test{\(.*\)}/\1/g'` >> Makefile.deps
30
	echo `grep \\test{[^/]*} < template.tex | sed 's/\\\\test{\(.*\)}/\1/g'` >> Makefile.deps
Lines 33-39 include Makefile.deps Link Here
33
33
34
tests.tex: template.tex Makefile.deps
34
tests.tex: template.tex Makefile.deps
35
	rm -r -f tests
35
	rm -r -f tests
36
	python gfs2tex $(TESTDIRS)
36
	python3 gfs2tex $(TESTDIRS)
37
	sed -e 's/\\test{\(.*\)\/\(.*\)}/\\input{\1\/\2\/\2.tex}/g' \
37
	sed -e 's/\\test{\(.*\)\/\(.*\)}/\\input{\1\/\2\/\2.tex}/g' \
38
	    -e 's/\\test{\(.*\)}/\\input{\1\/\1.tex}/g' < template.tex > tests.tex
38
	    -e 's/\\test{\(.*\)}/\\input{\1\/\1.tex}/g' < template.tex > tests.tex
39
39
(-)a/test/Makefile.in (-2 / +2 lines)
Lines 1439-1445 clean-generic: Link Here
1439
	mv -f summary.sh.bak summary.sh
1439
	mv -f summary.sh.bak summary.sh
1440
1440
1441
Makefile.deps: template.tex depend.py Makefile.am
1441
Makefile.deps: template.tex depend.py Makefile.am
1442
	python depend.py `grep \\test{[^/]*} < template.tex | sed 's/\\\\test{\(.*\)}/\1/g'` > Makefile.deps
1442
	python3 depend.py `grep \\test{[^/]*} < template.tex | sed 's/\\\\test{\(.*\)}/\1/g'` > Makefile.deps
1443
	echo "" >> Makefile.deps
1443
	echo "" >> Makefile.deps
1444
	echo -n "TESTDIRS = " >> Makefile.deps
1444
	echo -n "TESTDIRS = " >> Makefile.deps
1445
	echo `grep \\test{[^/]*} < template.tex | sed 's/\\\\test{\(.*\)}/\1/g'` >> Makefile.deps
1445
	echo `grep \\test{[^/]*} < template.tex | sed 's/\\\\test{\(.*\)}/\1/g'` >> Makefile.deps
Lines 1917-1923 tests.tex: \ Link Here
1917
1917
1918
tests.tex: template.tex Makefile.deps
1918
tests.tex: template.tex Makefile.deps
1919
	rm -r -f tests
1919
	rm -r -f tests
1920
	python gfs2tex $(TESTDIRS)
1920
	python3 gfs2tex $(TESTDIRS)
1921
	sed -e 's/\\test{\(.*\)\/\(.*\)}/\\input{\1\/\2\/\2.tex}/g' \
1921
	sed -e 's/\\test{\(.*\)\/\(.*\)}/\\input{\1\/\2\/\2.tex}/g' \
1922
	    -e 's/\\test{\(.*\)}/\\input{\1\/\1.tex}/g' < template.tex > tests.tex
1922
	    -e 's/\\test{\(.*\)}/\\input{\1\/\1.tex}/g' < template.tex > tests.tex
1923
1923
(-)a/test/advection.sh (-1 / +1 lines)
Line 1 Link Here
1
python -u test.py advection
1
python3 -u test.py advection
(-)a/test/advection/advection.sh (-1 / +1 lines)
Lines 54-60 else Link Here
54
    exit 1
54
    exit 1
55
fi
55
fi
56
56
57
if cat <<EOF | python ; then :
57
if cat <<EOF | python3 ; then :
58
from check import *
58
from check import *
59
from sys import *
59
from sys import *
60
if (Curve('error',1,4) - Curve('error.ref',1,4)).max() > 1e-6:
60
if (Curve('error',1,4) - Curve('error.ref',1,4)).max() > 1e-6:
(-)a/test/annulus.sh (-1 / +1 lines)
Line 1 Link Here
1
python -u test.py annulus
1
python3 -u test.py annulus
(-)a/test/annulus/annulus.sh (-1 / +1 lines)
Lines 42-48 else Link Here
42
    exit 1
42
    exit 1
43
fi
43
fi
44
44
45
if cat <<EOF | python ; then :
45
if cat <<EOF | python3 ; then :
46
from check import *
46
from check import *
47
from sys import *
47
from sys import *
48
if (Curve('error',1,4) - Curve('error.ref',1,4)).max() > 1e-6:
48
if (Curve('error',1,4) - Curve('error.ref',1,4)).max() > 1e-6:
(-)a/test/axi.sh (-1 / +1 lines)
Line 1 Link Here
1
python -u test.py axi
1
python3 -u test.py axi
(-)a/test/axi/axi.sh (-1 / +1 lines)
Lines 55-61 else Link Here
55
    exit 1
55
    exit 1
56
fi
56
fi
57
57
58
if cat <<EOF | python ; then :
58
if cat <<EOF | python3 ; then :
59
from check import *
59
from check import *
60
from sys import *
60
from sys import *
61
if (Curve('error',1,3) - Curve('error.ref',1,3)).max() > 1e-5:
61
if (Curve('error',1,3) - Curve('error.ref',1,3)).max() > 1e-5:
(-)a/test/axi/viscous/viscous.sh (-2 / +2 lines)
Lines 38-48 else Link Here
38
    exit 1
38
    exit 1
39
fi
39
fi
40
40
41
if cat <<EOF | python ; then :
41
if cat <<EOF | python3 ; then :
42
from check import *
42
from check import *
43
from sys import *
43
from sys import *
44
if (Curve('cp-12-100',1,2) - Curve('fadlun-cp-100',1,2)).norm2() > 1.6e-2:
44
if (Curve('cp-12-100',1,2) - Curve('fadlun-cp-100',1,2)).norm2() > 1.6e-2:
45
    print (Curve('cp-12-100',1,2) - Curve('fadlun-cp-100',1,2)).norm2()
45
    print((Curve('cp-12-100',1,2) - Curve('fadlun-cp-100',1,2)).norm2())
46
    exit(1)
46
    exit(1)
47
EOF
47
EOF
48
else
48
else
(-)a/test/axiadvection.sh (-1 / +1 lines)
Line 1 Link Here
1
python -u test.py axiadvection
1
python3 -u test.py axiadvection
(-)a/test/boundaries.sh (-1 / +1 lines)
Line 1 Link Here
1
python -u test.py boundaries
1
python3 -u test.py boundaries
(-)a/test/boundaries/boundaries.sh (-13 / +13 lines)
Lines 27-43 for v in U V; do Link Here
27
    done
27
    done
28
done
28
done
29
29
30
if cat <<EOF | python > convergence.tex; then :
30
if cat <<EOF | python3 > convergence.tex; then :
31
from check import *
31
from check import *
32
from sys import *
32
from sys import *
33
from math import *
33
from math import *
34
34
35
for component,variable in [('x','U'),('y','V')]:
35
for component,variable in [('x','U'),('y','V')]:
36
  print r"""\begin{table}[htbp]
36
  print(r"""\begin{table}[htbp])
37
  \caption{"""
37
  \caption{"""
38
  print r"\label{boundaries-" + component + "}"
38
  print(r"\label{boundaries-" + component + "}")
39
  print r"Errors and convergence rates for the \$"+component+r"\$-component of the velocity.}"  
39
  print(r"Errors and convergence rates for the \$"+component+r"\$-component of the velocity.}"  )
40
  print r"""\begin{center}
40
  print(r"""\begin{center})
41
  \begin{tabular}{||l|c|c|c||c|c|c||} \hline
41
  \begin{tabular}{||l|c|c|c||c|c|c||} \hline
42
           & \multicolumn{3}{c||}{All cells} & \multicolumn{3}{c||}{Full 128 cells} \\\ \hline
42
           & \multicolumn{3}{c||}{All cells} & \multicolumn{3}{c||}{Full 128 cells} \\\ \hline
43
           & 128-256  & Rate & 256-512  & 128-256  & Rate & 256-512  \\\ \hline"""
43
           & 128-256  & Rate & 256-512  & 128-256  & Rate & 256-512  \\\ \hline"""
Lines 45-65 for component,variable in [('x','U'),('y','V')]: Link Here
45
  for i,name in [(2,r"\$L_1\$"),(3,r"\$L_2\$"),(4,r"\$L_\infty\$")]:
45
  for i,name in [(2,r"\$L_1\$"),(3,r"\$L_2\$"),(4,r"\$L_\infty\$")]:
46
    a=Curve('order'+variable,1,i)
46
    a=Curve('order'+variable,1,i)
47
    b=Curve('orderf'+variable,1,i)
47
    b=Curve('orderf'+variable,1,i)
48
    print name,
48
    print(name,)
49
    print "& %.2e & %4.2f & %.2e & %.2e & %4.2f & %.2e" % (\
49
    print("& %.2e & %4.2f & %.2e & %.2e & %4.2f & %.2e" % (\)
50
    a.l[0][1], log(a.l[0][1]/a.l[1][1])/log(2.), a.l[1][1], \
50
    a.l[0][1], log(a.l[0][1]/a.l[1][1])/log(2.), a.l[1][1], \
51
    b.l[0][1], log(b.l[0][1]/b.l[1][1])/log(2.), b.l[1][1]),
51
    b.l[0][1], log(b.l[0][1]/b.l[1][1])/log(2.), b.l[1][1]),
52
    print r"\\\"
52
    print(r"\\\")
53
53
54
    a=Curve('order'+variable+'.ref',1,i)
54
    a=Curve('order'+variable+'.ref',1,i)
55
    b=Curve('orderf'+variable+'.ref',1,i)
55
    b=Curve('orderf'+variable+'.ref',1,i)
56
    print "& {\color{blue}%.2e} & {\color{blue}%4.2f} & {\color{blue}%.2e} & {\color{blue}%.2e} & {\color{blue}%4.2f} & {\color{blue}%.2e}" % (\
56
    print("& {\color{blue}%.2e} & {\color{blue}%4.2f} & {\color{blue}%.2e} & {\color{blue}%.2e} & {\color{blue}%4.2f} & {\color{blue}%.2e}" % (\)
57
    a.l[0][1], log(a.l[0][1]/a.l[1][1])/log(2.), a.l[1][1], \
57
    a.l[0][1], log(a.l[0][1]/a.l[1][1])/log(2.), a.l[1][1], \
58
    b.l[0][1], log(b.l[0][1]/b.l[1][1])/log(2.), b.l[1][1]),
58
    b.l[0][1], log(b.l[0][1]/b.l[1][1])/log(2.), b.l[1][1]),
59
    print r"\\\"
59
    print(r"\\\")
60
60
61
  print r"\hline"
61
  print(r"\hline")
62
  print r"""\end{tabular}
62
  print(r"""\end{tabular})
63
  \end{center}
63
  \end{center}
64
  \end{table}"""
64
  \end{table}"""
65
EOF
65
EOF
Lines 67-73 else Link Here
67
    exit 1
67
    exit 1
68
fi
68
fi
69
69
70
if cat <<EOF | python ; then :
70
if cat <<EOF | python3 ; then :
71
from check import *
71
from check import *
72
from sys import *
72
from sys import *
73
73
(-)a/test/bump.sh (-1 / +1 lines)
Line 1 Link Here
1
python -u test.py bump
1
python3 -u test.py bump
(-)a/test/bump/bump.sh (-7 / +7 lines)
Lines 79-96 else Link Here
79
    exit 1
79
    exit 1
80
fi
80
fi
81
81
82
if cat <<EOF | python ; then :
82
if cat <<EOF | python3 ; then :
83
from check import *
83
from check import *
84
if (Curve('norms-explicit',3,7) - Curve('norms-explicit.ref',3,7)).max() > 1e-5 or \
84
if (Curve('norms-explicit',3,7) - Curve('norms-explicit.ref',3,7)).max() > 1e-5 or \
85
   (Curve('norms-explicit',3,9) - Curve('norms-explicit.ref',3,9)).max() > 1e-5 or \
85
   (Curve('norms-explicit',3,9) - Curve('norms-explicit.ref',3,9)).max() > 1e-5 or \
86
   (Curve('norms-implicit',3,7) - Curve('norms-implicit.ref',3,7)).max() > 1e-5 or \
86
   (Curve('norms-implicit',3,7) - Curve('norms-implicit.ref',3,7)).max() > 1e-5 or \
87
   (Curve('norms-implicit',3,9) - Curve('norms-implicit.ref',3,9)).max() > 1e-5:
87
   (Curve('norms-implicit',3,9) - Curve('norms-implicit.ref',3,9)).max() > 1e-5:
88
    print (Curve('norms-explicit',3,7) - Curve('norms-explicit.ref',3,7)).max()
88
    print((Curve('norms-explicit',3,7) - Curve('norms-explicit.ref',3,7)).max())
89
    print (Curve('norms-explicit',3,9) - Curve('norms-explicit.ref',3,9)).max()
89
    print((Curve('norms-explicit',3,9) - Curve('norms-explicit.ref',3,9)).max())
90
    print (Curve('norms-explicit',3,7) - Curve('norms-explicit.ref',3,7)).max()
90
    print((Curve('norms-explicit',3,7) - Curve('norms-explicit.ref',3,7)).max())
91
    print (Curve('norms-explicit',3,9) - Curve('norms-explicit.ref',3,9)).max()
91
    print((Curve('norms-explicit',3,9) - Curve('norms-explicit.ref',3,9)).max())
92
    print (Curve('norms-implicit',3,7) - Curve('norms-implicit.ref',3,7)).max()
92
    print((Curve('norms-implicit',3,7) - Curve('norms-implicit.ref',3,7)).max())
93
    print (Curve('norms-implicit',3,9) - Curve('norms-implicit.ref',3,9)).max()
93
    print((Curve('norms-implicit',3,9) - Curve('norms-implicit.ref',3,9)).max())
94
    exit(1)
94
    exit(1)
95
EOF
95
EOF
96
else
96
else
(-)a/test/capwave.sh (-1 / +1 lines)
Line 1 Link Here
1
python -u test.py capwave
1
python3 -u test.py capwave
(-)a/test/capwave/capwave.sh (-1 / +1 lines)
Lines 63-69 EOF Link Here
63
    fi
63
    fi
64
fi
64
fi
65
65
66
if cat <<EOF | python ; then :
66
if cat <<EOF | python3 ; then :
67
from check import *
67
from check import *
68
from sys import *
68
from sys import *
69
if (Curve('convergence',1,2) - Curve('convergence.ref',1,2)).max() > 1e-5:
69
if (Curve('convergence',1,2) - Curve('convergence.ref',1,2)).max() > 1e-5:
(-)a/test/channel.sh (-1 / +1 lines)
Line 1 Link Here
1
python -u test.py channel
1
python3 -u test.py channel
(-)a/test/channel/channel.sh (-13 / +13 lines)
Lines 28-44 for v in U V; do Link Here
28
    done
28
    done
29
done
29
done
30
30
31
if cat <<EOF | python > convergence.tex; then :
31
if cat <<EOF | python3 > convergence.tex; then :
32
from check import *
32
from check import *
33
from sys import *
33
from sys import *
34
from math import *
34
from math import *
35
35
36
for component,variable in [('x','U'),('y','V')]:
36
for component,variable in [('x','U'),('y','V')]:
37
  print r"""\begin{table}[htbp]
37
  print(r"""\begin{table}[htbp])
38
  \caption{"""
38
  \caption{"""
39
  print r"\label{channel-" + component + "}"
39
  print(r"\label{channel-" + component + "}")
40
  print r"Errors and convergence rates for the \$"+component+r"\$-component of the velocity.}"
40
  print(r"Errors and convergence rates for the \$"+component+r"\$-component of the velocity.}")
41
  print r"""\begin{center}
41
  print(r"""\begin{center})
42
  \begin{tabular}{||l|c|c|c||c|c|c||} \hline
42
  \begin{tabular}{||l|c|c|c||c|c|c||} \hline
43
           & \multicolumn{3}{c||}{All cells} & \multicolumn{3}{c||}{Full 128 cells} \\\ \hline
43
           & \multicolumn{3}{c||}{All cells} & \multicolumn{3}{c||}{Full 128 cells} \\\ \hline
44
           & 128-256  & Rate & 256-512  & 128-256  & Rate & 256-512  \\\ \hline"""
44
           & 128-256  & Rate & 256-512  & 128-256  & Rate & 256-512  \\\ \hline"""
Lines 46-66 for component,variable in [('x','U'),('y','V')]: Link Here
46
  for i,name in [(2,r"\$L_1\$"),(3,r"\$L_2\$"),(4,r"\$L_\infty\$")]:
46
  for i,name in [(2,r"\$L_1\$"),(3,r"\$L_2\$"),(4,r"\$L_\infty\$")]:
47
    a=Curve('order'+variable,1,i)
47
    a=Curve('order'+variable,1,i)
48
    b=Curve('orderf'+variable,1,i)
48
    b=Curve('orderf'+variable,1,i)
49
    print name,
49
    print(name,)
50
    print "& %.2e & %4.2f & %.2e & %.2e & %4.2f & %.2e" % (\
50
    print("& %.2e & %4.2f & %.2e & %.2e & %4.2f & %.2e" % (\)
51
    a.l[0][1], log(a.l[0][1]/a.l[1][1])/log(2.), a.l[1][1], \
51
    a.l[0][1], log(a.l[0][1]/a.l[1][1])/log(2.), a.l[1][1], \
52
    b.l[0][1], log(b.l[0][1]/b.l[1][1])/log(2.), b.l[1][1]),
52
    b.l[0][1], log(b.l[0][1]/b.l[1][1])/log(2.), b.l[1][1]),
53
    print r"\\\"
53
    print(r"\\\")
54
54
55
    a=Curve('order'+variable+'.ref',1,i)
55
    a=Curve('order'+variable+'.ref',1,i)
56
    b=Curve('orderf'+variable+'.ref',1,i)
56
    b=Curve('orderf'+variable+'.ref',1,i)
57
    print "& {\color{blue}%.2e} & {\color{blue}%4.2f} & {\color{blue}%.2e} & {\color{blue}%.2e} & {\color{blue}%4.2f} & {\color{blue}%.2e}" % (\
57
    print("& {\color{blue}%.2e} & {\color{blue}%4.2f} & {\color{blue}%.2e} & {\color{blue}%.2e} & {\color{blue}%4.2f} & {\color{blue}%.2e}" % (\)
58
    a.l[0][1], log(a.l[0][1]/a.l[1][1])/log(2.), a.l[1][1], \
58
    a.l[0][1], log(a.l[0][1]/a.l[1][1])/log(2.), a.l[1][1], \
59
    b.l[0][1], log(b.l[0][1]/b.l[1][1])/log(2.), b.l[1][1]),
59
    b.l[0][1], log(b.l[0][1]/b.l[1][1])/log(2.), b.l[1][1]),
60
    print r"\\\"
60
    print(r"\\\")
61
61
62
  print r"\hline"
62
  print(r"\hline")
63
  print r"""\end{tabular}
63
  print(r"""\end{tabular})
64
  \end{center}
64
  \end{center}
65
  \end{table}"""
65
  \end{table}"""
66
EOF
66
EOF
Lines 68-74 else Link Here
68
    exit 1
68
    exit 1
69
fi
69
fi
70
70
71
if cat <<EOF | python ; then :
71
if cat <<EOF | python3 ; then :
72
from check import *
72
from check import *
73
from sys import *
73
from sys import *
74
74
(-)a/test/check.py (-1 / +1 lines)
Lines 66-69 class Curve: Link Here
66
		return self.max(lambda x: abs(x))
66
		return self.max(lambda x: abs(x))
67
	def write(self):
67
	def write(self):
68
		for p in self.l:
68
		for p in self.l:
69
			print p[0],p[1]
69
			print(p[0],p[1])
(-)a/test/circle.sh (-1 / +1 lines)
Line 1 Link Here
1
python -u test.py circle
1
python3 -u test.py circle
(-)a/test/circle/circle.sh (-5 / +5 lines)
Lines 103-119 else Link Here
103
    exit 1
103
    exit 1
104
fi
104
fi
105
105
106
if cat <<EOF | python ; then :
106
if cat <<EOF | python3 ; then :
107
from check import *
107
from check import *
108
from sys import *
108
from sys import *
109
if (Curve('res-7-gerris',1,3) - Curve('res-7.ref',1,3)).max() > 1e-8 or\
109
if (Curve('res-7-gerris',1,3) - Curve('res-7.ref',1,3)).max() > 1e-8 or\
110
   (Curve('res-7-hypre',1,3) - Curve('res-7.ref',1,7)).max() > 1e-8 or\
110
   (Curve('res-7-hypre',1,3) - Curve('res-7.ref',1,7)).max() > 1e-8 or\
111
   (Curve('error-gerris',1,4) - Curve('error.ref',1,4)).max() > 1e-6 or\
111
   (Curve('error-gerris',1,4) - Curve('error.ref',1,4)).max() > 1e-6 or\
112
   (Curve('error-hypre',1,4) - Curve('error.ref',1,8)).max() > 1e-6:
112
   (Curve('error-hypre',1,4) - Curve('error.ref',1,8)).max() > 1e-6:
113
    print (Curve('res-7-gerris',1,3) - Curve('res-7.ref',1,3)).max()
113
    print((Curve('res-7-gerris',1,3) - Curve('res-7.ref',1,3)).max())
114
    print (Curve('res-7-hypre',1,3) - Curve('res-7.ref',1,7)).max()
114
    print((Curve('res-7-hypre',1,3) - Curve('res-7.ref',1,7)).max())
115
    print (Curve('error-gerris',1,4) - Curve('error.ref',1,4)).max()
115
    print((Curve('error-gerris',1,4) - Curve('error.ref',1,4)).max())
116
    print (Curve('error-hypre',1,4) - Curve('error.ref',1,8)).max()
116
    print((Curve('error-hypre',1,4) - Curve('error.ref',1,8)).max())
117
    exit(1)
117
    exit(1)
118
EOF
118
EOF
119
else
119
else
(-)a/test/conservation.sh (-1 / +1 lines)
Line 1 Link Here
1
python -u test.py conservation
1
python3 -u test.py conservation
(-)a/test/coriolis.sh (-1 / +1 lines)
Line 1 Link Here
1
python -u test.py coriolis
1
python3 -u test.py coriolis
(-)a/test/coriolis/coriolis.sh (-1 / +1 lines)
Lines 40-46 else Link Here
40
    exit 1
40
    exit 1
41
fi
41
fi
42
42
43
if cat <<EOF | python ; then :
43
if cat <<EOF | python3 ; then :
44
from check import *
44
from check import *
45
from sys import *
45
from sys import *
46
if (Curve('error.dat',1,2)).max() > 1e-6:
46
if (Curve('error.dat',1,2)).max() > 1e-6:
(-)a/test/cosine.sh (-1 / +1 lines)
Line 1 Link Here
1
python -u test.py cosine
1
python3 -u test.py cosine
(-)a/test/cosine/cosine.sh (-5 / +5 lines)
Lines 53-66 EOF Link Here
53
    fi
53
    fi
54
done
54
done
55
55
56
if cat <<EOF | python ; then :
56
if cat <<EOF | python3 ; then :
57
from check import *
57
from check import *
58
from sys import *
58
from sys import *
59
c = Curve()
59
c = Curve()
60
print (Curve('error-45',1,4) - Curve('error-45.ref',1,4)).max()
60
print((Curve('error-45',1,4) - Curve('error-45.ref',1,4)).max())
61
print (Curve('error-45',1,5) - Curve('error-45.ref',1,5)).max()
61
print((Curve('error-45',1,5) - Curve('error-45.ref',1,5)).max())
62
print (Curve('error-90',1,4) - Curve('error-90.ref',1,4)).max()
62
print((Curve('error-90',1,4) - Curve('error-90.ref',1,4)).max())
63
print (Curve('error-90',1,5) - Curve('error-90.ref',1,5)).max() 
63
print((Curve('error-90',1,5) - Curve('error-90.ref',1,5)).max() )
64
if (Curve('error-45',1,4) - Curve('error-45.ref',1,4)).max() > 1e-10 or\
64
if (Curve('error-45',1,4) - Curve('error-45.ref',1,4)).max() > 1e-10 or\
65
   (Curve('error-45',1,5) - Curve('error-45.ref',1,5)).max() > 1e-10 or\
65
   (Curve('error-45',1,5) - Curve('error-45.ref',1,5)).max() > 1e-10 or\
66
   (Curve('error-90',1,4) - Curve('error-90.ref',1,4)).max() > 1e-10 or\
66
   (Curve('error-90',1,4) - Curve('error-90.ref',1,4)).max() > 1e-10 or\
(-)a/test/couette.sh (-1 / +1 lines)
Line 1 Link Here
1
python -u test.py couette
1
python3 -u test.py couette
(-)a/test/couette/couette.sh (-3 / +3 lines)
Lines 24-36 else Link Here
24
   exit 1
24
   exit 1
25
fi
25
fi
26
26
27
if cat <<EOF | python ; then :
27
if cat <<EOF | python3 ; then :
28
from check import *
28
from check import *
29
from sys import *
29
from sys import *
30
print (Curve('prof-0',1,2) - Curve('prof-0.ref',1,2)).norm2(),\
30
print((Curve('prof-0',1,2) - Curve('prof-0.ref',1,2)).norm2(),\
31
   (Curve('prof-1',1,2) - Curve('prof-1.ref',1,2)).norm2(),\
31
   (Curve('prof-1',1,2) - Curve('prof-1.ref',1,2)).norm2(),\
32
   (Curve('prof-2',1,2) - Curve('prof-2.ref',1,2)).norm2(),\
32
   (Curve('prof-2',1,2) - Curve('prof-2.ref',1,2)).norm2(),\
33
   (Curve('prof-3',1,2) - Curve('prof-3.ref',1,2)).norm2()
33
   (Curve('prof-3',1,2) - Curve('prof-3.ref',1,2)).norm2())
34
if (Curve('prof-0',1,2) - Curve('prof-0.ref',1,2)).norm2() > 3.6e-4 or \
34
if (Curve('prof-0',1,2) - Curve('prof-0.ref',1,2)).norm2() > 3.6e-4 or \
35
   (Curve('prof-1',1,2) - Curve('prof-1.ref',1,2)).norm2() > 6.3e-4 or \
35
   (Curve('prof-1',1,2) - Curve('prof-1.ref',1,2)).norm2() > 6.3e-4 or \
36
   (Curve('prof-2',1,2) - Curve('prof-2.ref',1,2)).norm2() > 21e-4 or \
36
   (Curve('prof-2',1,2) - Curve('prof-2.ref',1,2)).norm2() > 21e-4 or \
(-)a/test/cylinder.sh (-1 / +1 lines)
Line 1 Link Here
1
python -u test.py cylinder
1
python3 -u test.py cylinder
(-)a/test/cylinder/cylinder.sh (-3 / +3 lines)
Lines 83-94 for level in 6 7 8; do Link Here
83
done
83
done
84
84
85
# check error norms
85
# check error norms
86
if cat <<EOF | python ; then :
86
if cat <<EOF | python3 ; then :
87
from check import *
87
from check import *
88
if (Curve('norms',1,8) - Curve('norms.ref',1,8)).max() > 1e-5 or \
88
if (Curve('norms',1,8) - Curve('norms.ref',1,8)).max() > 1e-5 or \
89
   (Curve('norms',1,10) - Curve('norms.ref',1,10)).max() > 1e-5:
89
   (Curve('norms',1,10) - Curve('norms.ref',1,10)).max() > 1e-5:
90
    print (Curve('norms',1,8) - Curve('norms.ref',1,8)).max()
90
    print((Curve('norms',1,8) - Curve('norms.ref',1,8)).max())
91
    print (Curve('norms',1,10) - Curve('norms.ref',1,10)).max()
91
    print((Curve('norms',1,10) - Curve('norms.ref',1,10)).max())
92
    exit(1)
92
    exit(1)
93
EOF
93
EOF
94
else
94
else
(-)a/test/debye.sh (-1 / +1 lines)
Line 1 Link Here
1
python -u test.py debye
1
python3 -u test.py debye
(-)a/test/debye/debye.sh (-4 / +4 lines)
Lines 21-32 else Link Here
21
    exit 1
21
    exit 1
22
fi
22
fi
23
 
23
 
24
if python <<EOF ; then :
24
if python3 <<EOF ; then :
25
from check import *
25
from check import *
26
from sys import *
26
from sys import *
27
print (Curve('profile',1,2) - Curve('analytical',1,2)).normi()
27
print((Curve('profile',1,2) - Curve('analytical',1,2)).normi())
28
print (Curve('profile',1,3) - Curve('analytical',1,3)).normi()
28
print((Curve('profile',1,3) - Curve('analytical',1,3)).normi())
29
print (Curve('profile',1,4) - Curve('analytical',1,4)).normi()
29
print((Curve('profile',1,4) - Curve('analytical',1,4)).normi())
30
if (Curve('profile',1,2) - Curve('analytical',1,2)).normi() > 1.6e-3 or \
30
if (Curve('profile',1,2) - Curve('analytical',1,2)).normi() > 1.6e-3 or \
31
   (Curve('profile',1,3) - Curve('analytical',1,3)).normi() > 6.9e-3 or \
31
   (Curve('profile',1,3) - Curve('analytical',1,3)).normi() > 6.9e-3 or \
32
   (Curve('profile',1,4) - Curve('analytical',1,4)).normi() > 6.77e-3:
32
   (Curve('profile',1,4) - Curve('analytical',1,4)).normi() > 6.77e-3:
(-)a/test/depend.py (-17 / +24 lines)
Lines 1-4 Link Here
1
#!/usr/bin/python
1
#!/usr/bin/python3
2
2
3
import sys
3
import sys
4
import os
4
import os
Lines 6-13 import os.path Link Here
6
sys.path.append("../doc/examples")
6
sys.path.append("../doc/examples")
7
import gfs2tex
7
import gfs2tex
8
8
9
print "## File generated automatically by depend.py: do not modify by hand"
9
print("## File generated automatically by depend.py: do not modify by hand")
10
print ""
10
print()
11
11
12
dists = ""
12
dists = ""
13
depends = ""
13
depends = ""
Lines 20-28 for start in sys.argv[1:]: Link Here
20
    reps += " " + start
20
    reps += " " + start
21
    logs += "\\\n\t" + start + ".log"
21
    logs += "\\\n\t" + start + ".log"
22
    f = open(start + ".sh", "w")
22
    f = open(start + ".sh", "w")
23
    f.write("python -u test.py " + start + "\n")
23
    f.write("python3 -u test.py " + start + "\n")
24
    f.close()
24
    f.close()
25
    os.chmod(start + ".sh",0755)
25
    os.chmod(start + ".sh",0o755)
26
    for root, dirs, files in os.walk(start,topdown=True):
26
    for root, dirs, files in os.walk(start,topdown=True):
27
        if not ".xvpics" in root:
27
        if not ".xvpics" in root:
28
            test = gfs2tex.Example(root)
28
            test = gfs2tex.Example(root)
Lines 38-52 for start in sys.argv[1:]: Link Here
38
                if f[-4:] == ".mpg" or f[-4:] == ".ogv" or f[-4:] == ".png" or f[-4:] == ".mp4":
38
                if f[-4:] == ".mpg" or f[-4:] == ".ogv" or f[-4:] == ".png" or f[-4:] == ".mp4":
39
                    docs += "\\\n\t" + test.path + "/" + f
39
                    docs += "\\\n\t" + test.path + "/" + f
40
40
41
print "DOCS = " + docs + dists
41
print("DOCS = " + docs + dists)
42
print ""
42
print()
43
print "TESTS = " + tests + "\\\n\tsummary.sh"
43
print("TESTS = " + tests + "\\\n\tsummary.sh")
44
os.chmod("summary.sh",0755)
44
os.chmod("summary.sh",0o755)
45
print ""
45
print()
46
print "EXTRA_DIST += $(TESTS)" + dists
46
print("EXTRA_DIST += $(TESTS)" + dists)
47
print ""
47
print()
48
print "TESTS_ENVIRONMENT = TESTS=\"" + reps + "\""
48
print("TESTS_ENVIRONMENT = TESTS=\"" + reps + "\"")
49
print "TEST_EXTENSIONS = .sh"
49
print("TEST_EXTENSIONS = .sh")
50
print "summary.log:" + logs
50
print("summary.log:" + logs)
51
print ""
51
print()
52
print "tests.tex: " + depends
52
print("TESTS = " + tests + "\\\n\tsummary.sh")
53
os.chmod("summary.sh",0o755)
54
print()
55
print("TESTS_ENVIRONMENT = TESTS=\"" + reps + "\"")
56
print("TEST_EXTENSIONS = .sh")
57
print("summary.log:" + logs)
58
print()
59
print("tests.tex: " + depends)
(-)a/test/diffusion.sh (-1 / +1 lines)
Line 1 Link Here
1
python -u test.py diffusion
1
python3 -u test.py diffusion
(-)a/test/dumbell.sh (-1 / +1 lines)
Line 1 Link Here
1
python -u test.py dumbell
1
python3 -u test.py dumbell
(-)a/test/electro.sh (-1 / +1 lines)
Line 1 Link Here
1
python -u test.py electro
1
python3 -u test.py electro
(-)a/test/electro/electro.sh (-4 / +4 lines)
Lines 54-66 else Link Here
54
    exit 1
54
    exit 1
55
fi
55
fi
56
56
57
if cat <<EOF | python ; then :
57
if cat <<EOF | python3 ; then :
58
from check import *
58
from check import *
59
from sys import *
59
from sys import *
60
c = Curve()
60
c = Curve()
61
print (Curve('convergence',1,2) - Curve('convergence.ref',1,2)).max()
61
print((Curve('convergence',1,2) - Curve('convergence.ref',1,2)).max())
62
print (Curve('convergence',1,3) - Curve('convergence.ref',1,3)).max()
62
print((Curve('convergence',1,3) - Curve('convergence.ref',1,3)).max())
63
print Curve('rhoe',3,5).max()
63
print(Curve('rhoe',3,5).max())
64
if (Curve('convergence',1,2) - Curve('convergence.ref',1,2)).max() > 1e-6 or\
64
if (Curve('convergence',1,2) - Curve('convergence.ref',1,2)).max() > 1e-6 or\
65
   (Curve('convergence',1,3) - Curve('convergence.ref',1,3)).max() > 1e-6 or\
65
   (Curve('convergence',1,3) - Curve('convergence.ref',1,3)).max() > 1e-6 or\
66
    Curve('rhoe',3,5).max() > 1e-9:
66
    Curve('rhoe',3,5).max() > 1e-9:
(-)a/test/gaussian.sh (-1 / +1 lines)
Line 1 Link Here
1
python -u test.py gaussian
1
python3 -u test.py gaussian
(-)a/test/gaussian/gaussian.sh (-3 / +3 lines)
Lines 11-26 else Link Here
11
    exit 1
11
    exit 1
12
fi
12
fi
13
13
14
if cat <<EOF | python ; then :
14
if cat <<EOF | python3 ; then :
15
from check import *
15
from check import *
16
from sys import *
16
from sys import *
17
avg = (Curve('prof.ref',1,2) - Curve('prof.dat',3,5)).mean()
17
avg = (Curve('prof.ref',1,2) - Curve('prof.dat',3,5)).mean()
18
print avg
18
print(avg)
19
c = Curve()
19
c = Curve()
20
for p in Curve('prof.dat',3,5).l:
20
for p in Curve('prof.dat',3,5).l:
21
    c.l.append((p[0], p[1] + avg))
21
    c.l.append((p[0], p[1] + avg))
22
if (Curve('prof.ref',1,2) - c).normi() > $emax:
22
if (Curve('prof.ref',1,2) - c).normi() > $emax:
23
   print (Curve('prof.ref',1,2) - c).normi()
23
   print((Curve('prof.ref',1,2) - c).normi())
24
   exit(1)
24
   exit(1)
25
EOF
25
EOF
26
else
26
else
(-)a/test/geo.sh (-1 / +1 lines)
Line 1 Link Here
1
python -u test.py geo
1
python3 -u test.py geo
(-)a/test/geo/beta/beta.sh (-1 / +1 lines)
Lines 23-29 else Link Here
23
    exit 1
23
    exit 1
24
fi
24
fi
25
25
26
if cat <<EOF | python ; then :
26
if cat <<EOF | python3 ; then :
27
from check import *
27
from check import *
28
from sys import *
28
from sys import *
29
if Curve('energy',1,2).max() > 1. or \
29
if Curve('energy',1,2).max() > 1. or \
(-)a/test/geo/geo.sh (-1 / +1 lines)
Lines 5-11 if test x$donotrun != xtrue; then Link Here
5
    gerris3D $1
5
    gerris3D $1
6
fi
6
fi
7
7
8
python <<EOF
8
python3 <<EOF
9
from check import *
9
from check import *
10
from sys import *
10
from sys import *
11
if (Curve('e',1,2) - Curve('e.ref',1,2)).max() > 1e-3:
11
if (Curve('e',1,2) - Curve('e.ref',1,2)).max() > 1e-3:
(-)a/test/geo/river/geo.sh (-1 / +1 lines)
Lines 5-11 if test x$donotrun != xtrue; then Link Here
5
    gerris2D $1
5
    gerris2D $1
6
fi
6
fi
7
7
8
python <<EOF
8
python3 <<EOF
9
from check import *
9
from check import *
10
from sys import *
10
from sys import *
11
if (Curve('e',1,2) - Curve('e.ref',1,2)).max() > 1e-3:
11
if (Curve('e',1,2) - Curve('e.ref',1,2)).max() > 1e-3:
(-)a/test/gfs2tex (-1 / +1 lines)
Lines 1-4 Link Here
1
#!/usr/bin/python
1
#!/usr/bin/python3
2
2
3
import sys
3
import sys
4
import os
4
import os
(-)a/test/groundwater.sh (-1 / +1 lines)
Line 1 Link Here
1
python -u test.py groundwater
1
python3 -u test.py groundwater
(-)a/test/groundwater/groundwater.sh (-4 / +4 lines)
Lines 36-52 else Link Here
36
    exit 1
36
    exit 1
37
fi
37
fi
38
38
39
if cat <<EOF | python ; then :
39
if cat <<EOF | python3 ; then :
40
from check import *
40
from check import *
41
from sys import *
41
from sys import *
42
if (Curve('p',1,2) - Curve('p.ref',1,2)).max() > 1e-8 or\
42
if (Curve('p',1,2) - Curve('p.ref',1,2)).max() > 1e-8 or\
43
   (Curve('p',1,3) - Curve('p.ref',1,3)).max() > 1e-6:
43
   (Curve('p',1,3) - Curve('p.ref',1,3)).max() > 1e-6:
44
    print (Curve('p',1,2) - Curve('p.ref',1,2)).max()
44
    print((Curve('p',1,2) - Curve('p.ref',1,2)).max())
45
    print (Curve('p',1,3) - Curve('p.ref',1,3)).max()
45
    print((Curve('p',1,3) - Curve('p.ref',1,3)).max())
46
    exit(1)
46
    exit(1)
47
if (Curve('U',1,2) - Curve('U.ref',1,2)).max() > 1e-8 or\
47
if (Curve('U',1,2) - Curve('U.ref',1,2)).max() > 1e-8 or\
48
   (Curve('U',1,3) - Curve('U.ref',1,3)).max() > 1e-6:
48
   (Curve('U',1,3) - Curve('U.ref',1,3)).max() > 1e-6:
49
    print (Curve('U',1,2) - Curve('U.ref',1,2)).max()
49
    print((Curve('U',1,2) - Curve('U.ref',1,2)).max())
50
    exit(1)
50
    exit(1)
51
EOF
51
EOF
52
else
52
else
(-)a/test/harmonic.sh (-1 / +1 lines)
Line 1 Link Here
1
python -u test.py harmonic
1
python3 -u test.py harmonic
(-)a/test/harmonic/harmonic.sh (-3 / +3 lines)
Lines 93-105 else Link Here
93
    exit 1
93
    exit 1
94
fi
94
fi
95
95
96
if cat <<EOF | python ; then :
96
if cat <<EOF | python3 ; then :
97
from check import *
97
from check import *
98
from sys import *
98
from sys import *
99
if (Curve('res-7-gerris',1,3) - Curve('res-7.ref',1,3)).max() > 1e-8 or\
99
if (Curve('res-7-gerris',1,3) - Curve('res-7.ref',1,3)).max() > 1e-8 or\
100
   (Curve('error-gerris',1,4) - Curve('error.ref',1,4)).max() > 1e-6:
100
   (Curve('error-gerris',1,4) - Curve('error.ref',1,4)).max() > 1e-6:
101
    print (Curve('res-7-gerris',1,3) - Curve('res-7.ref',1,3)).max()
101
    print((Curve('res-7-gerris',1,3) - Curve('res-7.ref',1,3)).max())
102
    print (Curve('error-gerris',1,4) - Curve('error.ref',1,4)).max()
102
    print((Curve('error-gerris',1,4) - Curve('error.ref',1,4)).max())
103
    exit(1)
103
    exit(1)
104
EOF
104
EOF
105
else
105
else
(-)a/test/height.sh (-1 / +1 lines)
Line 1 Link Here
1
python -u test.py height
1
python3 -u test.py height
(-)a/test/hexagon.sh (-1 / +1 lines)
Line 1 Link Here
1
python -u test.py hexagon
1
python3 -u test.py hexagon
(-)a/test/hexagon/hexagon.sh (-1 / +1 lines)
Lines 27-33 else Link Here
27
    exit 1
27
    exit 1
28
fi
28
fi
29
29
30
if cat <<EOF | python ; then :
30
if cat <<EOF | python3 ; then :
31
from check import *
31
from check import *
32
from sys import *
32
from sys import *
33
if Curve('tracersum-1',1,2).normi() > 1e-6 or \
33
if Curve('tracersum-1',1,2).normi() > 1e-6 or \
(-)a/test/hydrostatic.sh (-1 / +1 lines)
Line 1 Link Here
1
python -u test.py hydrostatic
1
python3 -u test.py hydrostatic
(-)a/test/injectionaxi.sh (-1 / +1 lines)
Line 1 Link Here
1
python -u test.py injectionaxi
1
python3 -u test.py injectionaxi
(-)a/test/kinetic.sh (-1 / +1 lines)
Line 1 Link Here
1
python -u test.py kinetic
1
python3 -u test.py kinetic
(-)a/test/lake.sh (-1 / +1 lines)
Line 1 Link Here
1
python -u test.py lake
1
python3 -u test.py lake
(-)a/test/lake/river/river.sh (-2 / +2 lines)
Lines 47-57 else Link Here
47
    exit 1
47
    exit 1
48
fi
48
fi
49
49
50
if python <<EOF ; then :
50
if python3 <<EOF ; then :
51
from check import *
51
from check import *
52
from sys import *
52
from sys import *
53
if (Curve('error',1,2) - Curve('error.ref',1,2)).max() > 1e-6:
53
if (Curve('error',1,2) - Curve('error.ref',1,2)).max() > 1e-6:
54
    print (Curve('error',1,2) - Curve('error.ref',1,2)).max()
54
    print((Curve('error',1,2) - Curve('error.ref',1,2)).max())
55
    exit(1)
55
    exit(1)
56
EOF
56
EOF
57
else
57
else
(-)a/test/lake/stratified/stratified.sh (-2 / +2 lines)
Lines 82-92 else Link Here
82
    exit 1
82
    exit 1
83
fi
83
fi
84
84
85
if python <<EOF ; then :
85
if python3 <<EOF ; then :
86
from check import *
86
from check import *
87
from sys import *
87
from sys import *
88
if (Curve('error',1,2) - Curve('error.ref',1,2)).max() > 1e-6:
88
if (Curve('error',1,2) - Curve('error.ref',1,2)).max() > 1e-6:
89
    print (Curve('error',1,2) - Curve('error.ref',1,2)).max()
89
    print((Curve('error',1,2) - Curve('error.ref',1,2)).max())
90
    exit(1)
90
    exit(1)
91
EOF
91
EOF
92
else
92
else
(-)a/test/lid.sh (-1 / +1 lines)
Line 1 Link Here
1
python -u test.py lid
1
python3 -u test.py lid
(-)a/test/lid/explicit/lid.sh (-3 / +3 lines)
Lines 5-15 if test x$donotrun != xtrue; then Link Here
5
    fi
5
    fi
6
fi
6
fi
7
7
8
if cat <<EOF | python ; then :
8
if cat <<EOF | python3 ; then :
9
from check import *
9
from check import *
10
from sys import *
10
from sys import *
11
print (Curve('xprof',3,7) - Curve('../xprof.ghia',1,2)).normi()
11
print((Curve('xprof',3,7) - Curve('../xprof.ghia',1,2)).normi())
12
print (Curve('yprof',2,8) - Curve('../yprof.ghia',1,2)).normi()
12
print((Curve('yprof',2,8) - Curve('../yprof.ghia',1,2)).normi())
13
if (Curve('xprof',3,7) - Curve('../xprof.ghia',1,2)).normi() > 2.2e-2 or \
13
if (Curve('xprof',3,7) - Curve('../xprof.ghia',1,2)).normi() > 2.2e-2 or \
14
   (Curve('yprof',2,8) - Curve('../yprof.ghia',1,2)).normi() > 2.1e-2:
14
   (Curve('yprof',2,8) - Curve('../yprof.ghia',1,2)).normi() > 2.1e-2:
15
    exit(1)
15
    exit(1)
(-)a/test/lid/lid.sh (-3 / +3 lines)
Lines 5-17 if test x$donotrun != xtrue; then Link Here
5
    fi
5
    fi
6
fi
6
fi
7
7
8
if python <<EOF ; then :
8
if python3 <<EOF ; then :
9
from check import *
9
from check import *
10
from sys import *
10
from sys import *
11
if (Curve('xprof',3,7) - Curve('xprof.ghia',1,2)).normi() > 2e-2 or \
11
if (Curve('xprof',3,7) - Curve('xprof.ghia',1,2)).normi() > 2e-2 or \
12
   (Curve('yprof',2,8) - Curve('yprof.ghia',1,2)).normi() > 1.7e-2:
12
   (Curve('yprof',2,8) - Curve('yprof.ghia',1,2)).normi() > 1.7e-2:
13
    print (Curve('xprof',3,7) - Curve('xprof.ghia',1,2)).normi()
13
    print((Curve('xprof',3,7) - Curve('xprof.ghia',1,2)).normi())
14
    print (Curve('yprof',2,8) - Curve('yprof.ghia',1,2)).normi()
14
    print((Curve('yprof',2,8) - Curve('yprof.ghia',1,2)).normi())
15
    exit(1)
15
    exit(1)
16
EOF
16
EOF
17
else
17
else
(-)a/test/lonlat.sh (-1 / +1 lines)
Line 1 Link Here
1
python -u test.py lonlat
1
python3 -u test.py lonlat
(-)a/test/merging.sh (-1 / +1 lines)
Line 1 Link Here
1
python -u test.py merging
1
python3 -u test.py merging
(-)a/test/merging/merging.sh (-11 / +11 lines)
Lines 39-84 for s in sim simc; do Link Here
39
    done
39
    done
40
done
40
done
41
41
42
if cat <<EOF | python > convergence.tex ; then :
42
if cat <<EOF | python3 > convergence.tex ; then :
43
from check import *
43
from check import *
44
from sys import *
44
from sys import *
45
from math import *
45
from math import *
46
46
47
print r"""\begin{tabular}{|c|c|c|c|c|c|}\hline
47
print(r"""\begin{tabular}{|c|c|c|c|c|c|}\hline)
48
Domain   & \multicolumn{5}{c|}{\$L_2\$}\\\ \hline
48
Domain   & \multicolumn{5}{c|}{\$L_2\$}\\\ \hline
49
         & \$L=6\$   & \$O_2\$ & \$L=7\$    & \$O_2\$ & \$L=8\$  \\\ \hline"""
49
         & \$L=6\$   & \$O_2\$ & \$L=7\$    & \$O_2\$ & \$L=8\$  \\\ \hline"""
50
50
51
def order(r,color='black'):
51
def order(r,color='black'):
52
   for i in range(0,len(r.l)-1):
52
   for i in range(0,len(r.l)-1):
53
     y0,y1 = r.l[i][1],r.l[i+1][1]
53
     y0,y1 = r.l[i][1],r.l[i+1][1]
54
     print '& {\color{%s}%.2e} & {\color{%s}%4.2f}' % (color, y0, color, log(y0/y1)/log(2.)),
54
     print('& {\color{%s}%.2e} & {\color{%s}%4.2f}' % (color, y0, color, log(y0/y1)/log(2.)),)
55
   print '& {\color{%s}%.2e}' % (color, r.l[i+1][1]), r'\\\'
55
   print('& {\color{%s}%.2e}' % (color, r.l[i+1][1]), r'\\\')
56
56
57
print 'Circle',
57
print('Circle', end=' ')
58
order(Curve('simc.err',1,2))
58
order(Curve('simc.err',1,2))
59
order(Curve('simc.err.ref',1,2), 'blue')
59
order(Curve('simc.err.ref',1,2), 'blue')
60
print 'Adaptive',
60
print('Adaptive', end=' ')
61
order(Curve('sim.err',1,2))
61
order(Curve('sim.err',1,2))
62
order(Curve('sim.err.ref',1,2), 'blue')
62
order(Curve('sim.err.ref',1,2), 'blue')
63
63
64
print r"""\hline
64
print(r"""\hline)
65
Domain   & \multicolumn{5}{c|}{\$L_\infty\$} \\\ \hline
65
Domain   & \multicolumn{5}{c|}{\$L_\infty\$} \\\ \hline
66
         &  \$L=6\$   & \$O_\infty\$ & \$L=7\$   & \$O_\infty\$ & \$L=8\$ \\\ \hline"""
66
         &  \$L=6\$   & \$O_\infty\$ & \$L=7\$   & \$O_\infty\$ & \$L=8\$ \\\ \hline"""
67
67
68
print 'Circle',
68
print('Circle', end=' ')
69
order(Curve('simc.err',1,3))
69
order(Curve('simc.err',1,3))
70
order(Curve('simc.err.ref',1,3), 'blue')
70
order(Curve('simc.err.ref',1,3), 'blue')
71
print 'Adaptive',
71
print('Adaptive', end=' ')
72
order(Curve('sim.err',1,3))
72
order(Curve('sim.err',1,3))
73
order(Curve('sim.err.ref',1,3), 'blue')
73
order(Curve('sim.err.ref',1,3), 'blue')
74
74
75
print r"\hline\end{tabular}"
75
print(r"\hline\end{tabular}")
76
EOF
76
EOF
77
else
77
else
78
    exit 1
78
    exit 1
79
fi
79
fi
80
80
81
if cat <<EOF | python ; then :
81
if cat <<EOF | python3 ; then :
82
from check import *
82
from check import *
83
from sys import *
83
from sys import *
84
if (Curve('sim.err',1,2) - Curve('sim.err.ref',1,2)).max() > 1e-6 or\
84
if (Curve('sim.err',1,2) - Curve('sim.err.ref',1,2)).max() > 1e-6 or\
(-)a/test/nonlinear.sh (-1 / +1 lines)
Line 1 Link Here
1
python -u test.py nonlinear
1
python3 -u test.py nonlinear
(-)a/test/nonlinear/nonlinear.sh (-4 / +4 lines)
Lines 31-44 EOF Link Here
31
	gfsview-batch3D end-ocean-$omega.gfs error-ocean.gfv
31
	gfsview-batch3D end-ocean-$omega.gfs error-ocean.gfv
32
done
32
done
33
33
34
python <<EOF
34
python3 <<EOF
35
from check import *
35
from check import *
36
from sys import *
36
from sys import *
37
if (Curve('error-1',3,9) - Curve('error-1.ref',3,9)).max() > 1e-7 or\
37
if (Curve('error-1',3,9) - Curve('error-1.ref',3,9)).max() > 1e-7 or\
38
   (Curve('error-river-1',3,9) - Curve('error-river-1.ref',3,9)).max() > 1e-7 or\
38
   (Curve('error-river-1',3,9) - Curve('error-river-1.ref',3,9)).max() > 1e-7 or\
39
   (Curve('error-ocean-1',3,9) - Curve('error-ocean-1.ref',3,9)).max() > 1e-7:
39
   (Curve('error-ocean-1',3,9) - Curve('error-ocean-1.ref',3,9)).max() > 1e-7:
40
    print (Curve('error-1',3,9) - Curve('error-1.ref',3,9)).max()
40
    print((Curve('error-1',3,9) - Curve('error-1.ref',3,9)).max())
41
    print (Curve('error-river-1',3,9) - Curve('error-river-1.ref',3,9)).max()
41
    print((Curve('error-river-1',3,9) - Curve('error-river-1.ref',3,9)).max())
42
    print (Curve('error-ocean-1',3,9) - Curve('error-ocean-1.ref',3,9)).max()
42
    print((Curve('error-ocean-1',3,9) - Curve('error-ocean-1.ref',3,9)).max())
43
    exit(1)
43
    exit(1)
44
EOF
44
EOF
(-)a/test/nz.sh (-1 / +1 lines)
Line 1 Link Here
1
python -u test.py nz
1
python3 -u test.py nz
(-)a/test/oscillation.sh (-1 / +1 lines)
Line 1 Link Here
1
python -u test.py oscillation
1
python3 -u test.py oscillation
(-)a/test/oscillation/oscillation.sh (-1 / +1 lines)
Lines 78-84 else Link Here
78
    exit 1
78
    exit 1
79
fi
79
fi
80
80
81
if cat <<EOF | python ; then :
81
if cat <<EOF | python3 ; then :
82
from check import *
82
from check import *
83
from sys import *
83
from sys import *
84
if (Curve('fit',1,3) - Curve('fit.ref',1,3)).max() > 1e-2 or\
84
if (Curve('fit',1,3) - Curve('fit.ref',1,3)).max() > 1e-2 or\
(-)a/test/parabola.sh (-1 / +1 lines)
Line 1 Link Here
1
python -u test.py parabola
1
python3 -u test.py parabola
(-)a/test/parabola/parabola.sh (-2 / +2 lines)
Lines 128-138 else Link Here
128
    exit 1
128
    exit 1
129
fi
129
fi
130
130
131
if cat <<EOF | python ; then :
131
if cat <<EOF | python3 ; then :
132
from check import *
132
from check import *
133
from sys import *
133
from sys import *
134
if (Curve('error',1,4) - Curve('error.ref',1,4)).max() > 1e-4:
134
if (Curve('error',1,4) - Curve('error.ref',1,4)).max() > 1e-4:
135
    print (Curve('error',1,4) - Curve('error.ref',1,4)).max()
135
    print((Curve('error',1,4) - Curve('error.ref',1,4)).max())
136
    exit(1)
136
    exit(1)
137
EOF
137
EOF
138
else
138
else
(-)a/test/periodic.sh (-1 / +1 lines)
Line 1 Link Here
1
python -u test.py periodic
1
python3 -u test.py periodic
(-)a/test/periodic/periodic.sh (-14 / +14 lines)
Lines 16-67 if test x$donotrun != xtrue; then Link Here
16
    done
16
    done
17
fi
17
fi
18
18
19
if cat <<EOF | python > minion1.tex; then :
19
if cat <<EOF | python3 > minion1.tex; then :
20
from check import *
20
from check import *
21
from sys import *
21
from sys import *
22
from math import *
22
from math import *
23
23
24
print r"""\begin{tabular}{|c|c|c|c|c|c|}\hline
24
print(r"""\begin{tabular}{|c|c|c|c|c|c|}\hline
25
        & \multicolumn{5}{c|}{\$L_2\$} \\\ \hline
25
        & \multicolumn{5}{c|}{\$L_2\$} \\\ \hline
26
        & \$L=5\$   & \$O_2\$ & \$L=6\$    & \$O_2\$ & \$L=7\$  \\\ \hline"""
26
        & \$L=5\$   & \$O_2\$ & \$L=6\$    & \$O_2\$ & \$L=7\$  \\\ \hline""")
27
27
28
def order(r,color='black'):
28
def order(r,color='black'):
29
   for i in range(0,len(r.l)-1):
29
   for i in range(0,len(r.l)-1):
30
     y0,y1 = r.l[i][1],r.l[i+1][1]
30
     y0,y1 = r.l[i][1],r.l[i+1][1]
31
     print '& {\color{%s}%.2e} & {\color{%s}%4.2f}' % (color, y0, color, log(y0/y1)/log(2.)),
31
     print('& {\color{%s}%.2e} & {\color{%s}%4.2f}' % (color, y0, color, log(y0/y1)/log(2.)),)
32
   print '& {\color{%s}%.2e}' % (color, r.l[i+1][1]), r'\\\'
32
   print('& {\color{%s}%.2e}' % (color, r.l[i+1][1]), r'\\\')
33
33
34
print 'Uniform',
34
print('Uniform', end=' ')
35
order(Curve('r0',1,2))
35
order(Curve('r0',1,2))
36
order(Curve('r0.ref',1,2),'blue')
36
order(Curve('r0.ref',1,2),'blue')
37
print '\$r=1\$',
37
print('\$r=1\$', end=' ')
38
order(Curve('r1',1,2))
38
order(Curve('r1',1,2))
39
order(Curve('r1.ref',1,2),'blue')
39
order(Curve('r1.ref',1,2),'blue')
40
print '\$r=2\$',
40
print('\$r=2\$', end=' ')
41
order(Curve('r2',1,2))
41
order(Curve('r2',1,2))
42
order(Curve('r2.ref',1,2),'blue')
42
order(Curve('r2.ref',1,2),'blue')
43
43
44
print r"""\hline
44
print(r"""\hline)
45
        & \multicolumn{5}{c|}{\$L_\infty\$} \\\ \hline
45
        & \multicolumn{5}{c|}{\$L_\infty\$} \\\ \hline
46
        & \$L=5\$   & \$O_\infty\$  & \$L=6\$   & \$O_\infty\$  & \$L=7\$ \\\ \hline"""
46
        & \$L=5\$   & \$O_\infty\$  & \$L=6\$   & \$O_\infty\$  & \$L=7\$ \\\ \hline"""
47
47
48
print 'Uniform',
48
print('Uniform', end=' ')
49
order(Curve('r0',1,3))
49
order(Curve('r0',1,3))
50
order(Curve('r0.ref',1,3),'blue')
50
order(Curve('r0.ref',1,3),'blue')
51
print '\$r=1\$',
51
print('\$r=1\$', end=' ')
52
order(Curve('r1',1,3))
52
order(Curve('r1',1,3))
53
order(Curve('r1.ref',1,3),'blue')
53
order(Curve('r1.ref',1,3),'blue')
54
print '\$r=2\$',
54
print('\$r=2\$', end=' ')
55
order(Curve('r2',1,3))
55
order(Curve('r2',1,3))
56
order(Curve('r2.ref',1,3),'blue')
56
order(Curve('r2.ref',1,3),'blue')
57
57
58
print r"\hline\end{tabular}"
58
print(r"\hline\end{tabular}")
59
EOF
59
EOF
60
else
60
else
61
    exit 1
61
    exit 1
62
fi
62
fi
63
63
64
if cat <<EOF | python ; then :
64
if cat <<EOF | python3 ; then :
65
from check import *
65
from check import *
66
from sys import *
66
from sys import *
67
for r in ['r0','r1','r2']:
67
for r in ['r0','r1','r2']:
(-)a/test/planar.sh (-1 / +1 lines)
Line 1 Link Here
1
python -u test.py planar
1
python3 -u test.py planar
(-)a/test/plate.sh (-1 / +1 lines)
Line 1 Link Here
1
python -u test.py plate
1
python3 -u test.py plate
(-)a/test/plateau.sh (-1 / +1 lines)
Line 1 Link Here
1
python -u test.py plateau
1
python3 -u test.py plateau
(-)a/test/poiseuille.sh (-1 / +1 lines)
Line 1 Link Here
1
python -u test.py poiseuille
1
python3 -u test.py poiseuille
(-)a/test/poiseuille/poiseuille.sh (-1 / +1 lines)
Lines 31-37 else Link Here
31
    exit 1
31
    exit 1
32
fi
32
fi
33
33
34
if cat <<EOF | python ; then :
34
if cat <<EOF | python3 ; then :
35
from check import *
35
from check import *
36
from sys import *
36
from sys import *
37
if (Curve('error',1,4) - Curve('error.ref',1,4)).max() > 1e-6:
37
if (Curve('error',1,4) - Curve('error.ref',1,4)).max() > 1e-6:
(-)a/test/poiseuille/river/river.sh (-1 / +1 lines)
Lines 28-34 else Link Here
28
    exit 1
28
    exit 1
29
fi
29
fi
30
30
31
if cat <<EOF | python ; then :
31
if cat <<EOF | python3 ; then :
32
from check import *
32
from check import *
33
from sys import *
33
from sys import *
34
if (Curve('error',1,2) - Curve('error.ref',1,2)).max() > 1e-6:
34
if (Curve('error',1,2) - Curve('error.ref',1,2)).max() > 1e-6:
(-)a/test/poisson.sh (-1 / +1 lines)
Line 1 Link Here
1
python -u test.py poisson
1
python3 -u test.py poisson
(-)a/test/poisson/poisson.sh (-5 / +5 lines)
Lines 97-114 else Link Here
97
    exit 1
97
    exit 1
98
fi
98
fi
99
99
100
if cat <<EOF | python ; then :
100
if cat <<EOF | python3 ; then :
101
from check import *
101
from check import *
102
from sys import *
102
from sys import *
103
if (Curve('res-7-gerris',1,3) - Curve('res-7.ref',1,3)).max() > 1e-8 or\
103
if (Curve('res-7-gerris',1,3) - Curve('res-7.ref',1,3)).max() > 1e-8 or\
104
   (Curve('error-gerris',1,4) - Curve('error.ref',1,4)).max() > 1e-6:
104
   (Curve('error-gerris',1,4) - Curve('error.ref',1,4)).max() > 1e-6:
105
    print (Curve('res-7-gerris',1,3) - Curve('res-7.ref',1,3)).max()
105
    print((Curve('res-7-gerris',1,3) - Curve('res-7.ref',1,3)).max())
106
    print (Curve('error-gerris',1,4) - Curve('error.ref',1,4)).max()
106
    print((Curve('error-gerris',1,4) - Curve('error.ref',1,4)).max())
107
    exit(1)
107
    exit(1)
108
if (Curve('res-7-hypre',1,3) - Curve('res-7.ref',1,7)).max() > 1e-8 or\
108
if (Curve('res-7-hypre',1,3) - Curve('res-7.ref',1,7)).max() > 1e-8 or\
109
   (Curve('error-hypre',1,4) - Curve('error.ref',1,4)).max() > 1e-6:
109
   (Curve('error-hypre',1,4) - Curve('error.ref',1,4)).max() > 1e-6:
110
    print (Curve('res-7-hypre',1,3) - Curve('res-7.ref',1,7)).max()
110
    print((Curve('res-7-hypre',1,3) - Curve('res-7.ref',1,7)).max())
111
    print (Curve('error-hypre',1,4) - Curve('error.ref',1,4)).max()
111
    print((Curve('error-hypre',1,4) - Curve('error.ref',1,4)).max())
112
    exit(1)
112
    exit(1)
113
EOF
113
EOF
114
else
114
else
(-)a/test/reynolds.sh (-1 / +1 lines)
Line 1 Link Here
1
python -u test.py reynolds
1
python3 -u test.py reynolds
(-)a/test/reynolds/reynolds.sh (-3 / +3 lines)
Lines 58-71 else Link Here
58
    exit 1
58
    exit 1
59
fi
59
fi
60
60
61
if cat <<EOF | python ; then :
61
if cat <<EOF | python3 ; then :
62
from check import *
62
from check import *
63
from sys import *
63
from sys import *
64
for div in ['div5','div6','div7']:
64
for div in ['div5','div6','div7']:
65
  if (Curve(div,3,9) - Curve(div+'.ref',3,9)).max() > 0.01*Curve(div+'.ref',3,9).mean() or\
65
  if (Curve(div,3,9) - Curve(div+'.ref',3,9)).max() > 0.01*Curve(div+'.ref',3,9).mean() or\
66
     (Curve(div,3,7) - Curve(div+'.ref',3,7)).max() > 0.01*Curve(div+'.ref',3,7).mean():
66
     (Curve(div,3,7) - Curve(div+'.ref',3,7)).max() > 0.01*Curve(div+'.ref',3,7).mean():
67
    print (Curve(div,3,9) - Curve(div+'.ref',3,9)).max(), 0.01*Curve(div+'.ref',3,9).mean()
67
    print((Curve(div,3,9) - Curve(div+'.ref',3,9)).max(), 0.01*Curve(div+'.ref',3,9).mean())
68
    print (Curve(div,3,7) - Curve(div+'.ref',3,7)).max(), 0.01*Curve(div+'.ref',3,7).mean()
68
    print((Curve(div,3,7) - Curve(div+'.ref',3,7)).max(), 0.01*Curve(div+'.ref',3,7).mean())
69
    exit(1)
69
    exit(1)
70
EOF
70
EOF
71
else
71
else
(-)a/test/reynolds/skew/skew.sh (-1 / +1 lines)
Lines 43-49 else Link Here
43
    exit 1
43
    exit 1
44
fi
44
fi
45
45
46
if cat <<EOF | python ; then :
46
if cat <<EOF | python3 ; then :
47
from check import *
47
from check import *
48
from sys import *
48
from sys import *
49
for div in ['div5','div6','div7']:
49
for div in ['div5','div6','div7']:
(-)a/test/reynolds/skewbox/skew.sh (-3 / +3 lines)
Lines 33-45 else Link Here
33
    exit 1
33
    exit 1
34
fi
34
fi
35
35
36
if cat <<EOF | python ; then :
36
if cat <<EOF | python3 ; then :
37
from check import *
37
from check import *
38
from sys import *
38
from sys import *
39
if (Curve('error',1,4) - Curve('error.ref',1,4)).max() > 0.01*Curve('error.ref',1,4).mean() or\
39
if (Curve('error',1,4) - Curve('error.ref',1,4)).max() > 0.01*Curve('error.ref',1,4).mean() or\
40
   (Curve('error',1,5) - Curve('error.ref',1,5)).max() > 0.01*Curve('error.ref',1,5).mean():
40
   (Curve('error',1,5) - Curve('error.ref',1,5)).max() > 0.01*Curve('error.ref',1,5).mean():
41
  print (Curve('error',1,4) - Curve('error.ref',1,4)).max(), 0.01*Curve('error.ref',1,4).mean()
41
  print((Curve('error',1,4) - Curve('error.ref',1,4)).max(), 0.01*Curve('error.ref',1,4).mean())
42
  print (Curve('error',1,5) - Curve('error.ref',1,5)).max(), 0.01*Curve('error.ref',1,5).mean()
42
  print((Curve('error',1,5) - Curve('error.ref',1,5)).max(), 0.01*Curve('error.ref',1,5).mean())
43
  exit(1)
43
  exit(1)
44
EOF
44
EOF
45
else
45
else
(-)a/test/rossby.sh (-1 / +1 lines)
Line 1 Link Here
1
python -u test.py rossby
1
python3 -u test.py rossby
(-)a/test/rossby/rossby.sh (-3 / +3 lines)
Lines 69-81 else Link Here
69
    exit 1
69
    exit 1
70
fi
70
fi
71
71
72
if python <<EOF ; then :
72
if python3 <<EOF ; then :
73
from check import *
73
from check import *
74
from sys import *
74
from sys import *
75
if (Curve('eh-4',3,9) - Curve('eh-4.ref',3,9)).max() > 1e-5 or\
75
if (Curve('eh-4',3,9) - Curve('eh-4.ref',3,9)).max() > 1e-5 or\
76
   (Curve('eh-5',3,9) - Curve('eh-5.ref',3,9)).max() > 1e-5:
76
   (Curve('eh-5',3,9) - Curve('eh-5.ref',3,9)).max() > 1e-5:
77
    print (Curve('eh-4',3,9) - Curve('eh-4.ref',3,9)).max()
77
    print((Curve('eh-4',3,9) - Curve('eh-4.ref',3,9)).max())
78
    print (Curve('eh-5',3,9) - Curve('eh-5.ref',3,9)).max()
78
    print((Curve('eh-5',3,9) - Curve('eh-5.ref',3,9)).max())
79
    exit(1)
79
    exit(1)
80
EOF
80
EOF
81
else
81
else
(-)a/test/rotate.sh (-1 / +1 lines)
Line 1 Link Here
1
python -u test.py rotate
1
python3 -u test.py rotate
(-)a/test/sessile.sh (-1 / +1 lines)
Line 1 Link Here
1
python -u test.py sessile
1
python3 -u test.py sessile
(-)a/test/sessile/sessile.sh (-2 / +2 lines)
Lines 78-88 else Link Here
78
    exit 1
78
    exit 1
79
fi
79
fi
80
80
81
if cat <<EOF | python ; then :
81
if cat <<EOF | python3 ; then :
82
from check import *
82
from check import *
83
from sys import *
83
from sys import *
84
if (Curve('error-6',1,2) - Curve('error-6.ref',1,2)).max() > 0.:
84
if (Curve('error-6',1,2) - Curve('error-6.ref',1,2)).max() > 0.:
85
    print (Curve('error-6',1,2) - Curve('error-6.ref',1,2)).max()
85
    print((Curve('error-6',1,2) - Curve('error-6.ref',1,2)).max())
86
    exit(1)
86
    exit(1)
87
EOF
87
EOF
88
else
88
else
(-)a/test/shear.sh (-1 / +1 lines)
Line 1 Link Here
1
python -u test.py shear
1
python3 -u test.py shear
(-)a/test/shear/concentration/concentration.sh (-1 / +1 lines)
Lines 38-44 else Link Here
38
fi
38
fi
39
39
40
for i in "" 1 2; do
40
for i in "" 1 2; do
41
    if python <<EOF ; then :
41
    if python3 <<EOF ; then :
42
from check import *
42
from check import *
43
from sys import *
43
from sys import *
44
if (Curve('convergence$i',1,2) - Curve('convergence$i.ref',1,2)).max() > 0. or\
44
if (Curve('convergence$i',1,2) - Curve('convergence$i.ref',1,2)).max() > 0. or\
(-)a/test/shear/shear.sh (-1 / +1 lines)
Lines 11-17 else Link Here
11
    exit 1
11
    exit 1
12
fi
12
fi
13
13
14
if cat <<EOF | python ; then :
14
if cat <<EOF | python3 ; then :
15
from check import *
15
from check import *
16
from sys import *
16
from sys import *
17
if (Curve('norms',3,5) - Curve('norms.ref',3,5)).max() > 0. or\
17
if (Curve('norms',3,5) - Curve('norms.ref',3,5)).max() > 0. or\
(-)a/test/shock.sh (-1 / +1 lines)
Line 1 Link Here
1
python -u test.py shock
1
python3 -u test.py shock
(-)a/test/shock/layered/layered.sh (-2 / +2 lines)
Lines 59-69 else Link Here
59
fi
59
fi
60
fixbb u.eps
60
fixbb u.eps
61
61
62
if python <<EOF; then :
62
if python3 <<EOF; then :
63
from check import *
63
from check import *
64
from sys import *
64
from sys import *
65
if (Curve('prof-8-15',1,2) - Curve('prof.ref',1,2)).max() > 1e-3:
65
if (Curve('prof-8-15',1,2) - Curve('prof.ref',1,2)).max() > 1e-3:
66
    print (Curve('prof-8-15',1,2) - Curve('prof.ref',1,2)).max()
66
    print((Curve('prof-8-15',1,2) - Curve('prof.ref',1,2)).max())
67
    exit(1)
67
    exit(1)
68
EOF
68
EOF
69
else
69
else
(-)a/test/shock/shock.sh (-2 / +2 lines)
Lines 39-49 else Link Here
39
    exit 1
39
    exit 1
40
fi
40
fi
41
41
42
if python <<EOF ; then :
42
if python3 <<EOF ; then :
43
from check import *
43
from check import *
44
from sys import *
44
from sys import *
45
if (Curve('error',1,3) - Curve('error.ref',1,3)).max() > 1e-5:
45
if (Curve('error',1,3) - Curve('error.ref',1,3)).max() > 1e-5:
46
    print (Curve('error',1,3) - Curve('error.ref',1,3)).max()
46
    print((Curve('error',1,3) - Curve('error.ref',1,3)).max())
47
    exit(1)
47
    exit(1)
48
EOF
48
EOF
49
else
49
else
(-)a/test/shore.sh (-1 / +1 lines)
Line 1 Link Here
1
python -u test.py shore
1
python3 -u test.py shore
(-)a/test/shore/shore.sh (-4 / +4 lines)
Lines 10-16 if test x$donotrun != xtrue; then Link Here
10
    done
10
    done
11
fi
11
fi
12
12
13
if python <<EOF > convergence; then :
13
if python3 <<EOF > convergence; then :
14
from check import *
14
from check import *
15
from sys import *
15
from sys import *
16
16
Lines 18-24 for i in range($levelmin,$levelmax + 1): Link Here
18
  ref = Curve('t220.csv',1,2)
18
  ref = Curve('t220.csv',1,2)
19
  sol = Curve('sim-' + str(i) + '-220.txt',1,8)
19
  sol = Curve('sim-' + str(i) + '-220.txt',1,8)
20
  diff = ref - sol
20
  diff = ref - sol
21
  print i,diff.norm1(),diff.normi()
21
  print(i,diff.norm1(),diff.normi())
22
22
23
EOF
23
EOF
24
else
24
else
Lines 60-66 else Link Here
60
    exit 1
60
    exit 1
61
fi
61
fi
62
62
63
if python <<EOF ; then :
63
if python3 <<EOF ; then :
64
from check import *
64
from check import *
65
from sys import *
65
from sys import *
66
if (Curve('convergence',1,2) - Curve('convergence.ref',1,2)).max() > 0. or\
66
if (Curve('convergence',1,2) - Curve('convergence.ref',1,2)).max() > 0. or\
Lines 69-72 if (Curve('convergence',1,2) - Curve('convergence.ref',1,2)).max() > 0. or\ Link Here
69
EOF
69
EOF
70
else
70
else
71
   exit 1
71
   exit 1
72
fi
72
fi
(-)a/test/source.sh (-1 / +1 lines)
Line 1 Link Here
1
python -u test.py source
1
python3 -u test.py source
(-)a/test/source/source.sh (-3 / +3 lines)
Lines 48-60 else Link Here
48
    exit 1
48
    exit 1
49
fi
49
fi
50
50
51
if python <<EOF ; then :
51
if python3 <<EOF ; then :
52
from check import *
52
from check import *
53
from sys import *
53
from sys import *
54
if (Curve('error',1,4) - Curve('error.ref',1,4)).max() > 1e-4 or\
54
if (Curve('error',1,4) - Curve('error.ref',1,4)).max() > 1e-4 or\
55
   (Curve('error',1,3) - Curve('error.ref',1,3)).max() > 1e-4:
55
   (Curve('error',1,3) - Curve('error.ref',1,3)).max() > 1e-4:
56
    print (Curve('error',1,4) - Curve('error.ref',1,4)).max()
56
    print((Curve('error',1,4) - Curve('error.ref',1,4)).max())
57
    print (Curve('error',1,3) - Curve('error.ref',1,3)).max()
57
    print((Curve('error',1,3) - Curve('error.ref',1,3)).max())
58
    exit(1)
58
    exit(1)
59
EOF
59
EOF
60
else
60
else
(-)a/test/spurious.sh (-1 / +1 lines)
Line 1 Link Here
1
python -u test.py spurious
1
python3 -u test.py spurious
(-)a/test/spurious/spurious.sh (-1 / +1 lines)
Lines 70-76 for f in La-120-5 La-1200-5 La-12000-5; do Link Here
70
    fi
70
    fi
71
done
71
done
72
72
73
if cat <<EOF | python ; then :
73
if cat <<EOF | python3 ; then :
74
from check import *
74
from check import *
75
from sys import *
75
from sys import *
76
if (Curve('convergence',1,3) - Curve('convergence.ref',1,3)).max() > 1e-6:
76
if (Curve('convergence',1,3) - Curve('convergence.ref',1,3)).max() > 1e-6:
(-)a/test/still.sh (-1 / +1 lines)
Line 1 Link Here
1
python -u test.py still
1
python3 -u test.py still
(-)a/test/strouhal.sh (-1 / +1 lines)
Line 1 Link Here
1
python -u test.py strouhal
1
python3 -u test.py strouhal
(-)a/test/strouhal/strouhal.sh (-1 / +1 lines)
Lines 46-52 else Link Here
46
   exit 1
46
   exit 1
47
fi
47
fi
48
48
49
if cat <<EOF | python ; then :
49
if cat <<EOF | python3 ; then :
50
from check import *
50
from check import *
51
from sys import *
51
from sys import *
52
if (Curve('strouhal.res',1,2) - Curve('strouhal.ref',1,2)).max() > 0.01 :
52
if (Curve('strouhal.res',1,2) - Curve('strouhal.ref',1,2)).max() > 0.01 :
(-)a/test/swirl.sh (-1 / +1 lines)
Line 1 Link Here
1
python -u test.py swirl
1
python3 -u test.py swirl
(-)a/test/swirl/swirl.gfs (-3 / +3 lines)
Lines 78-90 EOF Link Here
78
	    exit $GFS_STOP;
78
	    exit $GFS_STOP;
79
	fi
79
	fi
80
80
81
	if python <<EOF ; then :
81
	if python3 <<EOF ; then :
82
from check import *
82
from check import *
83
from sys import *
83
from sys import *
84
if (Curve('nu',1,2) - Curve('analytical',1,2)).normi() > 8e-3 or \
84
if (Curve('nu',1,2) - Curve('analytical',1,2)).normi() > 8e-3 or \
85
   (Curve('nu',1,3) - Curve('analytical',1,3)).normi() > 8e-3 :
85
   (Curve('nu',1,3) - Curve('analytical',1,3)).normi() > 8e-3 :
86
    print (Curve('nu',1,2) - Curve('analytical',1,2)).normi()
86
    print((Curve('nu',1,2) - Curve('analytical',1,2)).normi())
87
    print (Curve('nu',1,3) - Curve('analytical',1,3)).normi()
87
    print((Curve('nu',1,3) - Curve('analytical',1,3)).normi())
88
    exit(1)
88
    exit(1)
89
EOF
89
EOF
90
	else
90
	else
(-)a/test/terrain.sh (-1 / +1 lines)
Line 1 Link Here
1
python -u test.py terrain
1
python3 -u test.py terrain
(-)a/test/terrain/terrain.sh (-5 / +5 lines)
Lines 60-66 else Link Here
60
    exit 1
60
    exit 1
61
fi
61
fi
62
62
63
if python <<EOF ; then :
63
if python3 <<EOF ; then :
64
from check import *
64
from check import *
65
from sys import *
65
from sys import *
66
c = Curve()
66
c = Curve()
Lines 68-77 if (Curve('error-t',1,3) - Curve('error-t.ref',1,3)).max() > 0. or\ Link Here
68
   (Curve('error-t',1,4) - Curve('error-t.ref',1,4)).max() > 0. or\
68
   (Curve('error-t',1,4) - Curve('error-t.ref',1,4)).max() > 0. or\
69
   (Curve('error-h',1,3) - Curve('error-h.ref',1,3)).max() > 0. or\
69
   (Curve('error-h',1,3) - Curve('error-h.ref',1,3)).max() > 0. or\
70
   (Curve('error-h',1,4) - Curve('error-h.ref',1,4)).max() > 0.:
70
   (Curve('error-h',1,4) - Curve('error-h.ref',1,4)).max() > 0.:
71
    print (Curve('error-t',1,3) - Curve('error-t.ref',1,3)).max()
71
    print((Curve('error-t',1,3) - Curve('error-t.ref',1,3)).max())
72
    print (Curve('error-t',1,4) - Curve('error-t.ref',1,4)).max()
72
    print((Curve('error-t',1,4) - Curve('error-t.ref',1,4)).max())
73
    print (Curve('error-h',1,3) - Curve('error-h.ref',1,3)).max()
73
    print((Curve('error-h',1,3) - Curve('error-h.ref',1,3)).max())
74
    print (Curve('error-h',1,4) - Curve('error-h.ref',1,4)).max() 
74
    print((Curve('error-h',1,4) - Curve('error-h.ref',1,4)).max() )
75
    exit(1)
75
    exit(1)
76
EOF
76
EOF
77
else
77
else
(-)a/test/test.py (-9 / +9 lines)
Lines 1-5 Link Here
1
import sys
1
import sys
2
import commands
2
import subprocess
3
import os
3
import os
4
import os.path
4
import os.path
5
sys.path.append("../doc/examples")
5
sys.path.append("../doc/examples")
Lines 15-28 for start in sys.argv[1:]: Link Here
15
            test = gfs2tex.Example(root)
15
            test = gfs2tex.Example(root)
16
            status,msg = test.run(env)
16
            status,msg = test.run(env)
17
            if status != None:
17
            if status != None:
18
                print "FAIL:",root
18
                print("FAIL:",root)
19
                if len(msg) > 0:
19
                if len(msg) > 0:
20
                    print " ".join(msg)
20
                    print(" ".join(msg))
21
                print >>open(test.path + "/status",'w'), "{\color{Red}FAIL}:"
21
                print("{\color{Red}FAIL}:", file=open(test.path + "/status",'w'))
22
                failed += 1
22
                failed += 1
23
            else:
23
            else:
24
                print "PASS:",root
24
                print("PASS:",root)
25
                print >>open(test.path + "/status",'w'), "{\color{OliveGreen}PASS}:"
25
                print("{\color{OliveGreen}PASS}:", file=open(test.path + "/status",'w'))
26
            n += 1
26
            n += 1
27
27
28
if failed:
28
if failed:
Lines 30-38 if failed: Link Here
30
else:
30
else:
31
    msg = "All " + repr(n) + " tests passed"
31
    msg = "All " + repr(n) + " tests passed"
32
32
33
print len(msg)*"="
33
print(len(msg)*"=")
34
print msg
34
print(msg)
35
print len(msg)*"="
35
print(len(msg)*"=")
36
36
37
if failed:
37
if failed:
38
    sys.exit(1)
38
    sys.exit(1)
(-)a/test/wannier.sh (-1 / +1 lines)
Line 1 Link Here
1
python -u test.py wannier
1
python3 -u test.py wannier
(-)a/test/wannier/bipolar/bipolar.sh (-1 / +1 lines)
Lines 48-54 else Link Here
48
    exit 1
48
    exit 1
49
fi
49
fi
50
50
51
if cat <<EOF | python ; then :
51
if cat <<EOF | python3 ; then :
52
from check import *
52
from check import *
53
from sys import *
53
from sys import *
54
if (Curve('error',1,4) - Curve('error.ref',1,4)).max() > 1e-6:
54
if (Curve('error',1,4) - Curve('error.ref',1,4)).max() > 1e-6:
(-)a/test/wannier/wannier.sh (-1 / +1 lines)
Lines 34-40 else Link Here
34
    exit 1
34
    exit 1
35
fi
35
fi
36
36
37
if cat <<EOF | python ; then :
37
if cat <<EOF | python3 ; then :
38
from check import *
38
from check import *
39
from sys import *
39
from sys import *
40
if (Curve('error',1,4) - Curve('error.ref',1,4)).max() > 1e-6:
40
if (Curve('error',1,4) - Curve('error.ref',1,4)).max() > 1e-6:
(-)a/test/waves.sh (-1 / +1 lines)
Line 1 Link Here
1
python -u test.py waves
1
python3 -u test.py waves
(-)a/test/waves/waves.sh (-1 / +1 lines)
Lines 29-35 awk 'BEGIN { Link Here
29
  print "\\end{tabular}"
29
  print "\\end{tabular}"
30
}' < correlation > correlation.tex
30
}' < correlation > correlation.tex
31
31
32
if cat <<EOF | python ; then :
32
if cat <<EOF | python3 ; then :
33
from check import *
33
from check import *
34
from sys import *
34
from sys import *
35
if Curve('correlation',1,3).max() > 10.:
35
if Curve('correlation',1,3).max() > 10.:

Return to bug 49940