added free energies of Si and C for 650 eV cut-off energy
[physik/posic.git] / vasp_tools / e_coh
1 #!/bin/bash
2
3 free_si_250=-0.70036911
4 free_si_650=-0.70021403
5 free_c_650=-1.3535731
6
7 file=$1
8
9 [ -d $1 ] && file=$1/OUTCAR
10
11 sicnt=`grep 'ions per' $file | awk '{ print $5 }'`
12 ccnt=`grep 'ions per' $file | awk '{ print $6 }'`
13
14 ((total=sicnt+ccnt))
15
16 echo "parsing file $file ..."
17 echo "  Si: $sicnt, C: $ccnt, total: $total"
18
19 cnt=0
20 tcnt=0
21
22 energy=`grep energy\ without $file | tail -1 | awk '{ print $8 }'`
23
24 echo $energy $total | \
25         awk '{ print "  total e: " $1 " eV, per atom: " $1/$2 " eV"}'
26 echo "$energy $total $free_si_250" | \
27         awk '{ print "  cohesive energy (Si only 250): " ($1-$2*$3)/$2 " eV" }'
28 echo "$energy $sicnt $ccnt $free_si_650 $free_c_650" | \
29         awk '{ print "  cohesive energy (Si and C 650): " ($1-$2*$4-$3*$5)/($2+$3) " eV" }'
30 #echo "$energy $total" | \
31 #       awk '{ print "  Si:C -> cohesive energy: "$1/$2 " eV" }'
32
33 echo
34