]> hackdaworld.org Git - physik/posic.git/blob - runmd
Merge branch 'leadoff'
[physik/posic.git] / runmd
1 if [ -z "$1" ]; then
2         echo "specify a directory for logging and save files"
3         exit
4 fi
5
6 if [ ! -f ./config ]; then
7         echo "no config file found"
8         exit
9 fi
10
11 [ ! -d $1 ] && mkdir -p $1
12
13 ./clean $1
14
15 cp -v config $1/config
16
17 mkdir -p logs
18 logfile=logs/run_`basename $1`.log
19 time ./mdrun -c ./config -s $1 | tee $logfile
20
21 if [ "$?" == "0" ]; then
22         #./perms
23         if [ "$1" ] ; then
24                 # whole simulation cell
25                 #./visualize -w 640 -h 480 -d $1
26
27                 # crt
28                 mkdir -p $1/crt
29                 check=`grep crt\ init $logfile`
30                 if [ "$check" = "  crt init" ]; then
31                         grep crt\ energy $logfile | \
32                                 awk -F: '{ print $2 }' | \
33                                 awk -F\ -\  '{ print $1 " " $2 }' > \
34                                 $1/crt/energy
35                         for i in $1/s-crt_*.save; do
36                                 nr=`basename $i | awk -F_ '{ print $2 }' | \
37                                         awk -F. '{ print $1 }'`
38                                 ./s2xyz $i > $1/crt/atomic_conf_${nr}.xyz
39                         done
40                         ./visualize -w 640 -h 480 -d $1/crt \
41                                     -nll -0.56 -0.56 -0.76 -fur 0.56 0.56 0.56 \
42                                     -b -0.5 -0.5 -0.5 0.5 0.5 0.5 \
43                                     -c -0.2 -2.0 0.6 -L 0 0 -0.1 \
44                                     -r 0.6 -B 0.1
45                 fi
46
47                 ./visualize -w 640 -h 480 -d $1 \
48                             -nll -0.56 -0.56 -0.76 -fur 0.56 0.56 0.56 \
49                             -b -0.5 -0.5 -0.5 0.5 0.5 0.5 \
50                             -c -0.2 -2.0 0.6 -L 0 0 -0.1 \
51                             -r 0.6 -B 0.1
52
53                 # old rasmol
54                 #rasmol -32 -nodisplay < $1/visualize.scr > /dev/null 2>&1
55                 ./ppm2avi $1
56
57         fi
58 fi
59