6 [ ! -z $1 ] && images=$1
8 echo "doing interpolation for $images images"
13 nsi=`sed -n 6p 00/POSCAR | awk '{ print $1 }'`
14 nc=`sed -n 6p 00/POSCAR | awk '{ print $2 }'`
17 echo "$tot atoms found"
19 x1=`sed -n 3p 00/POSCAR | awk '{ print $1 }'`
20 x2=`sed -n 3p 00/POSCAR | awk '{ print $2 }'`
21 x3=`sed -n 3p 00/POSCAR | awk '{ print $3 }'`
23 y1=`sed -n 4p 00/POSCAR | awk '{ print $1 }'`
24 y2=`sed -n 4p 00/POSCAR | awk '{ print $2 }'`
25 y3=`sed -n 4p 00/POSCAR | awk '{ print $3 }'`
27 z1=`sed -n 5p 00/POSCAR | awk '{ print $1 }'`
28 z2=`sed -n 5p 00/POSCAR | awk '{ print $2 }'`
29 z3=`sed -n 5p 00/POSCAR | awk '{ print $3 }'`
33 dir=`printf "%02d" $fin`
35 X1=`sed -n 3p $dir/POSCAR | awk '{ print $1 }'`
36 X2=`sed -n 3p $dir/POSCAR | awk '{ print $2 }'`
37 X3=`sed -n 3p $dir/POSCAR | awk '{ print $3 }'`
39 Y1=`sed -n 4p $dir/POSCAR | awk '{ print $1 }'`
40 Y2=`sed -n 4p $dir/POSCAR | awk '{ print $2 }'`
41 Y3=`sed -n 4p $dir/POSCAR | awk '{ print $3 }'`
43 Z1=`sed -n 5p $dir/POSCAR | awk '{ print $1 }'`
44 Z2=`sed -n 5p $dir/POSCAR | awk '{ print $2 }'`
45 Z3=`sed -n 5p $dir/POSCAR | awk '{ print $3 }'`
50 while [ $cnt -lt $fin ]; do
51 dir=`printf "%02d" $cnt`
52 if [ ! -d $dir ]; then
53 echo "creating dir $dir ..."
56 sed -n 1p 00/POSCAR > $dir/POSCAR
57 sed -n 2p 00/POSCAR >> $dir/POSCAR
58 echo $x1 $X1 $x2 $X2 $x3 $X3 $cnt $fin| awk '{
60 print " " $1+($2-$1)*ratio " " $3+($4-$3)*ratio " " $5+($6-$5)*ratio
62 echo $y1 $Y1 $y2 $Y2 $y3 $Y3 $cnt $fin| awk '{
64 print " " $1+($2-$1)*ratio " " $3+($4-$3)*ratio " " $5+($6-$5)*ratio
66 echo $z1 $Z1 $z2 $Z2 $z3 $Z3 $cnt $fin| awk '{
68 print " " $1+($2-$1)*ratio " " $3+($4-$3)*ratio " " $5+($6-$5)*ratio
70 sed -n 6p 00/POSCAR >> $dir/POSCAR
71 sed -n 7p 00/POSCAR >> $dir/POSCAR
72 sed -n 8p 00/POSCAR >> $dir/POSCAR
78 while [ $acnt -le $tot ]; do
81 x=`sed -n ${ltg}p 00/POSCAR | awk '{ print $1 }'`
82 X=`sed -n ${ltg}p $fdir/POSCAR | awk '{ print $1 }'`
83 y=`sed -n ${ltg}p 00/POSCAR | awk '{ print $2 }'`
84 Y=`sed -n ${ltg}p $fdir/POSCAR | awk '{ print $2 }'`
85 z=`sed -n ${ltg}p 00/POSCAR | awk '{ print $3 }'`
86 Z=`sed -n ${ltg}p $fdir/POSCAR | awk '{ print $3 }'`
87 while [ $cnt -lt $fin ]; do
88 dir=`printf "%02d" $cnt`
89 echo $x $X $y $Y $z $Z $cnt $fin| awk '{
91 print " " $1+($2-$1)*ratio " " $3+($4-$3)*ratio " " $5+($6-$5)*ratio " T T T"