-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpolys-3.gp
66 lines (66 loc) · 2.47 KB
/
polys-3.gp
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
60
61
62
63
64
65
66
set terminal epslatex
set output 'polys-3.tex'
stats 'run-latest/ndim.data' using 1 name 'stats_d'
d = stats_d_mean
if (d < 3) {exit}
stats 'run-latest/periodic.data' using 1 name 'stats_periodic'
periodic = stats_periodic_mean
stats 'run-latest/length.data' using 1 name 'stats_L'
L = stats_L_mean
set xlabel '$x$'
set ylabel '$y$'
set zlabel '$z$'
unset key
set xyplane relative 0.1
p(q) = q > L / 2.0 ? q - L : q < -L / 2.0 ? q + L : q
fx(i, x, y, z) = i == 0 ? \
(x2 = NaN, y2 = NaN, z2 = NaN, x1 = x, y1 = y, z1 = z, x2) : \
(x2 = x1, y2 = y1, z2 = z1, x1 = x, y1 = y, z1 = z, x2)
fy(i, x, y, z) = y2
fz(i, x, y, z) = z2
if (periodic) {
dfx(i, x, y, z) = p(x1 - x2)
dfy(i, x, y, z) = p(y1 - y2)
dfz(i, x, y, z) = p(z1 - z2)
set xrange [-L / 2.0 : L + L / 2.0]
set yrange [-L / 2.0 : L + L / 2.0]
set zrange [-L / 2.0 : L + L / 2.0]
set object 1 polygon from 0, 0, 0 to L, 0, 0 to L, L, 0 to 0, L, 0 to 0, 0, 0
set object 2 polygon from 0, 0, L to L, 0, L to L, L, L to 0, L, L to 0, 0, L
set object 3 polygon from 0, 0, 0 to L, 0, 0 to L, 0, L to 0, 0, L to 0, 0, 0
set object 4 polygon from 0, L, 0 to L, L, 0 to L, L, L to 0, L, L to 0, L, 0
set object 5 polygon from 0, 0, 0 to 0, 0, L to 0, L, L to 0, L, 0 to 0, 0, 0
set object 6 polygon from L, 0, 0 to L, 0, L to L, L, L to L, L, 0 to L, 0, 0
splot for [dx = -L : L : L] for [dy = -L : L : L] for [dz = -L : L : L] \
'run-latest/polys.data' using \
($2 + dx) : ($3 + dy) : ($4 + dz) every ::0::0 \
with points linetype 1 pointtype 7, \
for [dx = -L : L : L] for [dy = -L : L : L] for [dz = -L : L : L] \
'' using \
(fx($1, $2 + dx, $3 + dy, $4 + dz)) : \
(fy($1, $2 + dx, $3 + dy, $4 + dz)) : \
(fz($1, $2 + dx, $3 + dy, $4 + dz)) : \
(dfx($1, $2 + dx, $3 + dy, $4 + dz)) : \
(dfy($1, $2 + dx, $3 + dy, $4 + dz)) : \
(dfz($1, $2 + dx, $3 + dy, $4 + dz)) \
with vectors linetype 1 filled
} else {
dfx(i, x, y, z) = x1 - x2
dfy(i, x, y, z) = y1 - y2
dfz(i, x, y, z) = z1 - z2
set xrange [-L / 2.0 : L / 2.0]
set yrange [-L / 2.0 : L / 2.0]
set zrange [-L / 2.0 : L / 2.0]
unset object 1
unset object 2
unset object 3
unset object 4
unset object 5
unset object 6
splot 'run-latest/polys.data' using 2 : 3 : 4 every ::0::0 \
with points linetype 1 pointtype 7, \
'' using \
(fx($1, $2, $3, $4)) : (fy($1, $2, $3, $4)) : (fz($1, $2, $3, $4)) : \
(dfx($1, $2, $3, $4)) : (dfy($1, $2, $3, $4)) : (dfz($1, $2, $3, $4)) \
with vectors linetype 1 filled
}