12 while [ $count -lt $steps ]; do
14 cnt=`printf "%02d" $count`
18 echo "run simulation $cnt ..."
20 echo " c atom at: `sed -n 226p CONTCAR`"
23 ../vasp.4.6-gamma-ct/vasp
25 cp POSCAR POSCAR.${cnt}
26 cp CONTCAR CONTCAR.${cnt}
27 cp OUTCAR OUTCAR.${cnt}
29 ltm="`sed -n 226p CONTCAR`"
30 val1=`echo $ltm | awk '{ print $1 }'`
31 val2=`echo $ltm | awk '{ print $2 }'`
32 val3=`echo $ltm | awk '{ print $3 }'`
33 val4=`echo $ltm | awk '{ print $4 }'`
34 val5=`echo $ltm | awk '{ print $5 }'`
35 val6=`echo $ltm | awk '{ print $6 }'`
39 nx=`echo $val1 $fx $rest | awk '{ print $1+($2-$1)/$3 }'`
40 ny=`echo $val2 $fy $rest | awk '{ print $1+($2-$1)/$3 }'`
41 nz=`echo $val3 $fz $rest | awk '{ print $1+($2-$1)/$3 }'`
43 sed "s%$ltm% $nx $ny $nz $val4 $val5 $val6%" CONTCAR > POSCAR
46 echo "simulation $cnt end"
47 echo " c atom now at: `sed -n 226p CONTCAR`"
48 echo " dis x: `echo $val1 $fx $rest | awk '{ print ($2-$1)/$3 }'`"
49 echo " dis y: `echo $val2 $fy $rest | awk '{ print ($2-$1)/$3 }'`"
50 echo " dis z: `echo $val3 $fz $rest | awk '{ print ($2-$1)/$3 }'`"
53 newline="`echo $val1 $fx $val2 $fy $val3 $fz | awk '\
55 zrot=0; xrot=0; xyd=0; x=0; y=0; z=0;
58 x=$2-$1; y=$4-$3; z=$6-$5;
59 zrot=180.0*atan2(x,y)/3.14159265;
61 xrot=-180.0*atan2(z,xyd)/3.14159265;
65 ltm="`sed -n 8p POSCAR`"
70 sed -i "s%$ltm%$newline%" POSCAR