]> hackdaworld.org Git - physik/posic.git/commitdiff
security checkin: save fullct mig script
authorhackbard <hackbard@sage.physik.uni-augsburg.de>
Tue, 10 Nov 2009 15:19:48 +0000 (16:19 +0100)
committerhackbard <hackbard@sage.physik.uni-augsburg.de>
Tue, 10 Nov 2009 15:19:48 +0000 (16:19 +0100)
vasp_tools/mig_fullct.sh [new file with mode: 0755]

diff --git a/vasp_tools/mig_fullct.sh b/vasp_tools/mig_fullct.sh
new file mode 100755 (executable)
index 0000000..43f2e82
--- /dev/null
@@ -0,0 +1,101 @@
+#!/bin/bash
+
+# migration
+
+if [ ! -f POSCAR.init ]; then
+       echo "no initial configuration file, aborting ..."
+       exit
+fi
+
+if [ ! -f POSCAR.final ]; then
+       echo "no final configuration file, aborting ..."
+       exit
+fi
+
+echo "Info:"
+echo $LANG
+bash --version
+echo
+echo
+
+((steps=10))
+((count=1))
+((offset=8))
+
+while [ $count -le $steps ]; do
+
+       cnt=`printf "%02d" $count`
+
+       # create the POSCAR file
+       if [ $count -eq 1 ]; then
+               cp -v POSCAR.init CONTCAR
+       fi
+
+       srcfile=CONTCAR
+       sed -n 1,6p $srcfile > POSCAR
+       echo "Transformed selective dynamics" >> POSCAR
+       echo "Direct" >> POSCAR
+       sicnt=`sed -n 6p $srcfile | awk '{ print $1 }'`
+       ccnt=`sed -n 6p $srcfile | awk '{ print $2 }'`
+       ((tot=sicnt+ccnt))
+
+       ((acnt=1))
+       while [ $acnt -le $tot ]; do
+               ((lcnt=acnt+offset))
+               line="`sed -n ${lcnt}p $srcfile`"
+               xo=`echo $line | awk '{ print $1 }'`
+               yo=`echo $line | awk '{ print $2 }'`
+               zo=`echo $line | awk '{ print $3 }'`
+               line="`sed -n ${lcnt}p POSCAR.final`"
+               xn=`echo $line | awk '{ print $1 }'`
+               yn=`echo $line | awk '{ print $2 }'`
+               zn=`echo $line | awk '{ print $3 }'`
+
+               echo "$xo $yo $zo $xn $yn $zn $count $steps" | awk '{
+                       if($1<0) xo=$1+1.0
+                       else xo=$1
+                       if($2<0) yo=$2+1.0
+                       else yo=$2
+                       if($3<0) zo=$3+1.0
+                       else zo=$3
+                       if($4<0) xn=$4+1.0
+                       else xn=$4
+                       if($5<0) yn=$5+1.0
+                       else yn=$5
+                       if($6<0) zn=$6+1.0
+                       else zn=$6
+                       dx=xn-xo
+                       if(dx>0.5) dx-=1.0;
+                       if(dx<-0.5) dx+=1.0;
+                       dy=yn-yo
+                       if(dy>0.5) dy-=1.0;
+                       if(dy<-0.5) dy+=1.0;
+                       dz=zn-zo
+                       if(dz>0.5) dz-=1.0;
+                       if(dz<-0.5) dz+=1.0;
+                       zrot=180.0*atan2(dx,dy)/3.14159265
+                       xrot=-180.0*atan2(dz,sqrt(dx^2+dy^2))/3.14159265
+                       frac=1.0/($8-$7+1)
+                       x=xo+dx*frac
+                       y=yo+dy*frac
+                       z=zo+dz*frac
+                       print " " x " " y " " z " T F T " zrot " " xrot
+               }' >> POSCAR
+
+               ((acnt+=1))
+       done
+
+       echo
+       echo
+       echo "run simulation $cnt ..."
+       echo
+       echo
+       ../vasp.4.6-gamma-fullct/vasp
+
+       cp -v POSCAR POSCAR.${cnt}
+       cp -v CONTCAR CONTCAR.${cnt}
+       cp -v OUTCAR OUTCAR.${cnt}
+
+       ((count+=1))
+done
+