vasp slow growth的后数据处理一直都是自己写的代码进行后数据处理,例如J. Am.Chem. Soc.2020, 142, 5773-5777.“we have home-made codes/scripts to post-process the output data”。我看网上也有一部分人问怎么进行后处理。这里我给出我的代码(之前我也是自己琢磨了很久的代码,最终全部整合在一起并缩短才得到这一串看似简单的代码),计算完之后怎么进行数据后处理:
#!/bin/sh
grep cc REPORT | awk '{print $3}' > cc.dat
grep b_m REPORT | awk '{print $2}' > bm.dat
read -p "ICONST设置的键数: " period
read -p "需要查看的键的排名: " index
sed -n "${index}~${period}p" bm.dat > bm.txt
sed -n "${index}~${period}p" cc.dat > cc.txt
first=$(head -n1 cc.txt)
last=$(tail -n1 cc.txt)
echo -e "\n"
echo "积分完成,结果已保存到 integral.dat"
echo "从 $first Å 迭代到 $last Å"
paste cc.txt bm.txt | awk 'NR==1 {x_prev=$1;y_prev=$2;sum=0;max=0;max_x=$1;print $1,$2,0;next} {dx=$1-x_prev;sum+=dx*($2+y_prev)/2;if(NR==2||sum>max){max=sum;max_x=$1} print $1,$2,sum;x_prev=$1;y_prev=$2} END {printf "Max Integral: %.6f eV at x = %.6f Å\n",max,max_x>"/dev/stderr"}' > integral.dat