sec checkin since accidentally deleted (and recovered!) fir the second time now
[physik/posic.git] / vasp_tools / stdvis
1 #!/bin/bash
2
3 if [ -z "$1" ]; then
4         echo "specify a directory ..."
5         exit
6 fi
7
8 if [ -z "$2" ]; then
9         type="default"
10 else
11         type=$2
12 fi
13
14 if [ -z "$3" ]; then
15         trg="video"
16 else
17         trg="video.*"
18 fi
19
20 if [ "$type" != "disp" ]; then
21
22 for i in $1/$trg; do
23
24         if [ -f $i/stdvis ]; then
25                 echo "$i already visualized ..."
26                 continue
27         else
28                 touch $i/stdvis
29         fi
30
31 # first unit cell in each direction without rotation
32 if [ "$type" = "default" -o "$type" = "1" ]; then
33 echo "type: 1 no rotation"
34 ./visualize -w 640 -h 480 -d $i \
35         -nll -0.20 -0.20 -0.50 -fur 1.20 1.20 1.20 \
36         -b 0.0 0.0 0.0 1.0 1.0 1.0 \
37         -c 0.8 -1.7 0.9 -L 0.5 -1.0 0.5 \
38         -r 0.6 -A 1 217 1.9
39 fi
40
41 # first unit cell in each direction without rotation displaying mirrored atoms
42 if [ "$type" = "1m" ]; then
43 echo "type: 1 no rotation, mirrored"
44 ./visualize -w 640 -h 480 -d $i \
45         -nll -0.20 -0.20 -0.20 -fur 1.20 1.20 1.20 \
46         -b 0.0 0.0 0.0 1.0 1.0 1.0 \
47         -c 0.3 -1.7 0.9 -L 0.5 -1.0 0.5 \
48         -r 0.6 -m 3.0 0.0 0.0 0.0 3.0 0.0 0.0 0.0 3.0 \
49         -A 1 216 2.6
50         #-A 1 217 2.6
51         #-c 0.8 -1.7 0.9 -L 0.5 -1.0 0.5 \
52 fi
53
54 # defect combination view 1
55 if [ "$type" = "dc1" ]; then
56 echo "type: defect combination 1, mirrored"
57 ./visualize -w 640 -h 480 -d $i \
58         -nll -0.20 -0.20 -0.80 -fur 1.20 1.20 1.20 \
59         -b 0.0 0.0 0.0 1.0 1.0 1.0 \
60         -c 0.3 -1.7 0.9 -L 0.5 -1.0 0.5 \
61         -r 0.6 -m 3.0 0.0 0.0 0.0 3.0 0.0 0.0 0.0 3.0 \
62         -A 2 217 218 2.6
63 fi
64
65 # first unit cell in each direction without rotation displaying mirrored atoms
66 if [ "$type" = "x1y1z13" ]; then
67 echo "type: x1y1z13, mirrored"
68 ./visualize -w 640 -h 480 -d $i \
69         -nll -0.20 -0.20 -1.20 -fur 1.20 1.20 1.20 \
70         -b 0.0 0.0 0.0 1.0 1.0 1.0 \
71         -c 0.3 -1.7 0.4 -L 0.5 -1.0 0 \
72         -r 0.6 -m 3.0 0.0 0.0 0.0 3.0 0.0 0.0 0.0 3.0 \
73         -A 1 217 2.6
74         #-A 2 109 217 2.6
75 fi
76
77 # first unit cell in each direction without rotation displaying mirrored atoms
78 if [ "$type" = "1m2" ]; then
79 echo "type: 1 no rotation, mirrored, displaying bonds of the 2 C atoms"
80 ./visualize -w 640 -h 480 -d $i \
81         -nll -0.20 -0.20 -0.20 -fur 1.20 1.20 1.20 \
82         -b 0.0 0.0 0.0 1.0 1.0 1.0 \
83         -c 0.8 -1.7 0.9 -L 0.5 -1.0 0.5 \
84         -r 0.6 -m 3.0 0.0 0.0 0.0 3.0 0.0 0.0 0.0 3.0 \
85         -A 2 217 218 2.6
86 fi
87
88 if [ "$type" = "1m2dv" ]; then
89 echo "type: 1 no rotation, mirrored, displaying bonds of db and vac"
90 ./visualize -w 640 -h 480 -d $i \
91         -nll -0.20 -0.20 -0.20 -fur 1.20 1.20 1.20 \
92         -b 0.0 0.0 0.0 1.0 1.0 1.0 \
93         -c 0.8 -1.7 0.9 -L 0.5 -1.0 0.5 \
94         -r 0.6 -m 3.0 0.0 0.0 0.0 3.0 0.0 0.0 0.0 3.0 \
95         -A 2 215 216 2.6
96 fi
97
98 # three unit cells in each direction without rotation
99 if [ "$type" = "3" ]; then
100 echo "type: 3 no rotation"
101 ./visualize -w 640 -h 480 -d $i \
102         -nll -0.20 -0.20 -0.20 -fur 3.20 3.20 3.20 \
103         -b 0.0 0.0 0.0 3.0 3.0 3.0 \
104         -c 2.3 -3.7 2.4 -L 1.5 -1.0 1.5 \
105         -r 0.6 -A 1 217 2.6
106 fi
107
108 # unti cell 3,0,2
109 if [ "$type" = "3x2z" ]; then
110 echo "type: 3x2z no rotation"
111 ./visualize -w 640 -h 480 -d $i \
112         -nll 1.8 -0.2 0.8 -fur 3.20 1.20 2.20 \
113         -b 2.0 0.0 1.0 3.0 1.0 2.0 \
114         -c 2.3 -3.7 2.4 -L 1.5 -1.0 1.5 \
115         -r 0.6
116 fi
117
118 # first unit cell rotated by 45 degrees about z-axis
119 if [ "$type" = "1r" ]; then
120 echo "type: 1 rotated"
121 ./visualize -w 640 -h 480 -d $i \
122         -nll -0.20 -0.70 -0.20 -fur 2.00 0.70 1.20 \
123         -c -0.5 -1.5 0.9 -L 1.0 0.0 0.5 \
124         -r 0.6
125         #-b 0.0 0.0 0.0 0.0 0.0 1.0 \
126 fi
127
128 # first unit cell rotated by 45 degrees displaying mirrored atoms
129 if [ "$type" = "1rm" ]; then
130 echo "type: 1 rotated, mirrored"
131 ./visualize -w 640 -h 480 -d $i \
132         -nll -0.20 -0.20 -0.50 -fur 1.20 1.20 1.20 \
133         -b 0.0 0.0 0.0 1.0 1.0 1.0 \
134         -c 0.8 -1.7 0.9 -L 0.5 -1.0 0.5 \
135         -r 0.6 -m 2.0 -2.0 0.0 2.0 2.0 0.0 0.0 0.0 3.0 \
136         -A 1 193 1.9
137 fi
138
139 # three unit cells (rotated) in each direction displaying mirrored atoms
140 if [ "$type" = "3rm" ]; then
141 echo "type: 3 roted, mirrored"
142 ./visualize -w 640 -h 480 -d $i \
143         -nll -0.20 -0.20 -0.20 -fur 3.20 3.20 3.20 \
144         -b 0.0 0.0 0.0 3.0 3.0 3.0 \
145         -c 1.3 -3.7 2.4 -L 1.5 -1.0 1.5 \
146         -r 0.6 -m 2.0 -2.0 0.0 2.0 2.0 0.0 0.0 0.0 3.0
147 fi
148
149 # x: 2,3 y 3 z 1,2
150 if [ "$type" = "x123y3z123" ]; then
151 echo "type: x: 1,2,3 y 3 z 1,2,3"
152 ./visualize -w 640 -h 480 -d $i \
153         -nll -0.20 1.80 -0.20 -fur 3.20 3.20 3.20 \
154         -b 1.0 2.0 1.0 2.0 3.0 2.0 \
155         -c 1.8 -1.7 2.2 -L 1.6 2.5 1.7 \
156         -r 0.6 -A 1 217 2.6 \
157         -m 3.0 0.0 0.0 0.0 3.0 0.0 0.0 0.0 3.0
158 fi
159
160 ./ppm2avi $i
161
162 done
163
164 else
165
166 # 100 db in type 1 sc (insdide sc)
167 for i in $1/video/atomic_conf_*.xyz; do
168         displace=`echo $i | awk -F_ '{ print $7 }' | sed 's/\.xyz//'`
169         echo "$i $displace ..."
170 ./visualize -w 640 -h 480 -d $i \
171         -nll -0.20 -0.20 -0.50 -fur 1.20 1.20 1.20 \
172         -b 0.0 0.0 0.0 1.0 1.0 1.0 \
173         -c 0.8 -1.7 0.9 -L 0.5 -1.0 0.5 \
174         -r 0.6 -B 0.1 -D $displace -m 2.0 -2.0 0.0 2.0 2.0 0.0 0.0 0.0 3.0
175 done
176
177 fi
178
179 #mplayer $1/video/md.avi
180