Generate POSCAR for Dimer method to calculation transition states

2016-10-20

#!/usr/bin/env bash
#get line number of the geometry
lnum=`head -n 7 POSCAR |tail -1 | tr " " "\n" | awk '{ sum+=$1} END {print sum}'`
#get half part of the geometry
head -n 8  POSCAR > poscar-1
echo 'Cartesian' >> poscar-1
#get the freq line numer
fnum=`grep -in f/i OUTCAR  |tail -1 |awk {'print $1'} |sed 's/://g'`
#get the Cartesian coordination
sed -n "$fnum,$(($fnum+$lnum+1))p" OUTCAR  |tail -n $lnum |awk {'print $1 "  " $2 "  "  $3 " T T T " '} >> poscar-1
echo ""  >> poscar-1
#initial dimer direction
sed -n "$fnum,$(($fnum+$lnum+1))p" OUTCAR  |tail -n $lnum |awk {'print $4 "  " $5 "  "  $6 "  " '} >> poscar-1
# Metal numbers
mnum=`head -n 7 POSCAR |tail -1 | awk {'print $1'}`
sed "10,$(($mnum+9))s/T/F/g" poscar-1 > POSCAR-dimer

本网站由阿里云提供云计算及安全服务