|
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\ |