X-Git-Url: https://hackdaworld.org/gitweb/?p=physik%2Fposic.git;a=blobdiff_plain;f=vasp_tools%2Fe_coh;fp=vasp_tools%2Fe_coh;h=f32283fd9f31c21b02422bd671dd12e495371882;hp=0000000000000000000000000000000000000000;hb=6e6d7126ea9a845f11637d8e1b8eb2b570ac4dc9;hpb=97dc63eb6a519b8e1f4fbfaa9760dd94539436b0 diff --git a/vasp_tools/e_coh b/vasp_tools/e_coh new file mode 100755 index 0000000..f32283f --- /dev/null +++ b/vasp_tools/e_coh @@ -0,0 +1,81 @@ +#!/bin/bash + +file=$1 + +[ -d $1 ] && file=$1/OUTCAR + +echo "parsing file $file ..." + +sicnt=`grep 'ions per' $file | awk '{ print $5 }'` +ccnt=`grep 'ions per' $file | awk '{ print $6 }'` +[ -z $ccnt ] && ccnt=0 +((total=sicnt+ccnt)) +echo " Si: $sicnt, C: $ccnt, total: $total" + +cutoff=`grep ENCUT $file | awk '{ print $3 }' | awk -F. '{ print $1 }'` +echo " cutoff: $cutoff eV" + +pawpp=`grep POTCAR $file | tail -1 | awk '{ print $2 }'` +if [ "$pawpp" = "PAW_GGA" ]; then + ext=_paw_gga + echo " GGA and PAW" +fi +if [ "$pawpp" = "PAW" ]; then + ext=_paw + echo " LDA and PAW" +fi +if [ "$pawpp" = "US" ]; then + help=`grep GGA $file | grep eV | tail -1 | awk '{ print $1i }'` + if [ -z $help ]; then + ext=_gga + echo " GGA and PP" + else + ext="" + echo " LDA and PP" + fi +fi + +cnt=0 +tcnt=0 + +energy=`grep energy\ without $file | tail -1 | awk '{ print $8 }'` + +sifile=free_atoms/si_free_${cutoff}${ext}/OUTCAR +cfile=free_atoms/c_free_${cutoff}${ext}/OUTCAR + +if [ ! -f $sifile ]; then + echo + echo "$sifile not found ..." + echo + exit +fi + +if [ ! -f $cfile ]; then + echo + echo "$cfile not found ..." + echo + exit +fi + +free_si=`grep energy\ without $sifile | tail -1 | awk '{ print $8 }'` +free_c=`grep energy\ without $cfile | tail -1 | awk '{ print $8 }'` +echo " Si correction: $free_si eV, C correction: $free_c eV" + +#echo "-> $energy | $total | $sicnt | $ccnt | $free_si | $free_c <-" +echo $energy $total | \ + awk '{ print " total e: " $1 " eV, per atom: " $1/$2 " eV"}' +echo "$energy $sicnt $ccnt $free_si $free_c" | \ + awk '{ print " cohesive energy (Si and C): " ($1-$2*$4-$3*$5)/($2+$3) " eV, " $1-$2*$4-$3*$5 " eV" }' +echo "$energy $sicnt $free_c" | \ + awk '{ print " cohesive energy (C only): " ($1-$2*$3)/$2 " eV, " $1-$2*$3 " eV" }' +#echo "$energy $total $free_si_250" | \ +# awk '{ print " cohesive energy (Si only 250): " ($1-$2*$3)/$2 " eV" }' +#echo "$energy $sicnt $free_c_650" | \ +# awk '{ print " cohesive energy (C only 650): " ($1-$2*$3)/($2) " eV" }' +#echo "$energy $sicnt $ccnt $free_si_650 $free_c_650" | \ +# awk '{ print " cohesive energy (Si and C 650): " ($1-$2*$4-$3*$5)/($2+$3) " eV" }' +#echo "$energy $total" | \ +# awk '{ print " Si:C -> cohesive energy: "$1/$2 " eV" }' + +echo +