| 查看: 3556 | 回复: 18 | |||
fly_elephan银虫 (小有名气)
|
[交流]
vasp计算结果处理态密度要用到的程序已有7人参与
|
|
在材料电学特性的研究中,能带和态密度是我们最关心的,下面的这个程序可以用于vasp计算结果的处理,可以分离出总态密度和分态密度,这个程序是我们研究所用了很久的,绝对没问题,有资源大家共享,欢迎下载。 #! /bin/ksh # Script to break the VASP DOSCAR file into segments for # each atomic site. # JMS NRL 5/0/02 # Modified to also align the Fermi level from the ground state # to E=0.0 # JMS NRL 6/19/02 # Executables reside here BIN=~/tzyy/AlP/swnt10 if [ $# -ne 0 ]; then echo "Usage: split_dos" exit 2 fi # Script to split the DOSCAR file into the atomic # projections labeled by atom number dosfile=DOSCAR outfile=OUTCAR infile=INCAR # Token for splitting the files token=$(sed -n '6 p' $dosfile | awk '{print $1}') # Number of points nl=$(sed -n '6 p' $dosfile | awk '{print $3}') # Number of atoms natom=$(sed -n '1 p' $dosfile | awk '{print $1}') # Get the Fermi level if the OUTCAR file is present, # else we set it to zero. if [ -a $outfile ]; then echo "The" $outfile "exists, we use it to get the Fermi level," echo "the RWIGS tag and the number of spins." efermi=$(grep "E-fermi" $outfile | tail -1 | awk '{print $3}') echo "Fermi level:" $efermi nspin=$(grep "ISPIN" $outfile | tail -1 | awk '{print $3}') if [ $nspin -eq 2 ]; then echo "Spin polarized calculation" else echo "Unpolarized calculation" fi # 2.a # JMS 2/3/03 Modified to accept specification by LORBIT token. # lorbit=$(grep "LORBIT" $outfile | tail -1 | awk '{print $3}') if [ $lorbit -ge 10 ]; then echo "LORBIT > 10" echo "WARNING: not completely test for vasp.4.*" echo "Use at your own risk. Please check results for consistency." form=1 else # 2.a rwigs=$(grep "RWIGS" $outfile | tail -1 | awk '{print $3}' | sed 's/\.//g') if [ $rwigs -eq -100 ]; then echo "RWIGS token not set" form=0 else echo "RWIGS token set" form=1 fi # 2.a fi # 2.a else echo "The" $outfile "does not exist, we set the Fermi level to 0" echo "assume an unpolarized calculation, and RWIGS not set" form=0 nspin=1 efermi=0.0 fi # If the outcar file is not present and you wish to set something by hand # you should do it here. Uncomment the tokens below and set them by hand. #efermi=2.255 #form= #nspin= # Get the atomic coordinates $BIN/vp >| tmp.dat tail -$natom tmp.dat | awk '{printf "%s %12.8f %12.8f %12.8f \n", "#", $2, $3, $4}' >| tmp.dat2 # Total is first DOS if [ $form -eq 0 ]; then i=0 else i=0 fi start=7 end=$((start+nl-1)) #echo $start $end #exit 0 rm -f DOS0 if [ $form -eq 1 ]; then while [ $i -le $natom ]; do #echo $i $start $end if [ $i -gt 0 ]; then sed -n ''$i' p' tmp.dat2 >| DOS$i fi if [ $i -gt 0 ]; then # Atomic projected DOS if [ $nspin -eq 2 ]; then sed -n ''$start','$end' p' $dosfile | awk '{printf "%12.8f %12.8f %12.8f %12.8f %12.8f %12.8f %12.8f \n", $1+(-1)*'$efermi', $2, -1*$3, $4, -1*$5, $6, -1*$7}' >> DOS$i else sed -n ''$start','$end' p' $dosfile | awk '{printf "%12.8f %12.8f %12.8f %12.8f \n", $1+(-1)*'$efermi', $2, $3, $4 }' >> DOS$i fi else # Total DOS if [ $nspin -eq 2 ]; then sed -n ''$start','$end' p' $dosfile | awk '{printf "%12.8f %12.8f %12.8f %12.8f %12.8f \n", $1+(-1)*'$efermi', $2, -1*$3, $4, -1*$5 }' >> DOS$i else sed -n ''$start','$end' p' $dosfile | awk '{printf "%12.8f %12.8f %12.8f \n", $1+(-1)*'$efermi', $2, $3 }' >> DOS$i fi fi start=$((end+2)) end=$((start+nl-1)) i=$((i+1)) done else while [ $i -le 0 ]; do #echo $i $start $end if [ $i -gt 0 ]; then sed -n ''$i' p' tmp.dat2 >| DOS$i fi if [ $i -gt 0 ]; then # Atomic projected DOS if [ $nspin -eq 2 ]; then sed -n ''$start','$end' p' $dosfile | awk '{printf "%12.8f %12.8f %12.8f %12.8f %12.8f %12.8f %12.8f \n", $1+(-1)*'$efermi', $2, -1*$3, $4, -1*$5, $6, -1*$7}' >> DOS$i else sed -n ''$start','$end' p' $dosfile | awk '{printf "%12.8f %12.8f %12.8f %12.8f \n", $1+(-1)*'$efermi', $2, $3, $4 }' >> DOS$i fi else # Total DOS if [ $nspin -eq 2 ]; then sed -n ''$start','$end' p' $dosfile | awk '{printf "%12.8f %12.8f %12.8f %12.8f %12.8f \n", $1+(-1)*'$efermi', $2, -1*$3, $4, -1*$5 }' >> DOS$i else sed -n ''$start','$end' p' $dosfile | awk '{printf "%12.8f %12.8f %12.8f \n", $1+(-1)*'$efermi', $2, $3 }' >> DOS$i fi fi start=$((end+2)) end=$((start+nl-1)) i=$((i+1)) done fi exit 0 |
» 猜你喜欢
读博
已经有5人回复
到新单位后,换了新的研究方向,没有团队,持续积累2区以上论文,能申请到面上吗
已经有13人回复
博士申请都是内定的吗?
已经有6人回复
之前让一硕士生水了7个发明专利,现在这7个获批发明专利的维护费可从哪儿支出哈?
已经有5人回复
博士读完未来一定会好吗
已经有29人回复
投稿精细化工
已经有4人回复
高职单位投计算机相关的北核或SCI四区期刊推荐,求支招!
已经有4人回复
导师想让我从独立一作变成了共一第一
已经有9人回复
心脉受损
已经有5人回复
Springer期刊投稿求助
已经有4人回复
» 本主题相关商家推荐: (我也要在这里推广)
» 本主题相关价值贴推荐,对您同样有帮助:
用vasp如何计算能带图和态密度图呢?
已经有11人回复
用vasp计算态密度
已经有5人回复
VASP计算态密度出现问题
已经有12人回复
【求助】VASP计算电子态密度时提示错误WAVECAR
已经有4人回复
【求助】求VASP计算ZnO能带和态密度的详细输入设置
已经有15人回复
【求助】VASP怎样精确计算出费米能级处的态密度值?
已经有22人回复
【求助】关于vasp态密度计算
已经有10人回复
【求助】VASP计算电子态密度
已经有34人回复
【求助】关于锂原子vasp计算后的1s2s2p分波态密度处理
已经有12人回复
cenwanglai
荣誉版主 (知名作家)
老和山猥琐派九段
- 1ST强帖: 5
- 应助: 46 (小学生)
- 贵宾: 8.842
- 金币: 7440.4
- 散金: 9654
- 红花: 118
- 沙发: 23
- 帖子: 5306
- 在线: 1961.4小时
- 虫号: 537452
- 注册: 2008-04-01
- 性别: GG
- 专业: 理论和计算化学
- 管辖: 仿真模拟
2楼2011-05-30 11:01:16
★
小木虫(金币+0.5):给个红包,谢谢回帖
小木虫(金币+0.5):给个红包,谢谢回帖
|
本帖内容被屏蔽 |
3楼2011-11-14 11:21:03
cenwanglai
荣誉版主 (知名作家)
老和山猥琐派九段
- 1ST强帖: 5
- 应助: 46 (小学生)
- 贵宾: 8.842
- 金币: 7440.4
- 散金: 9654
- 红花: 118
- 沙发: 23
- 帖子: 5306
- 在线: 1961.4小时
- 虫号: 537452
- 注册: 2008-04-01
- 性别: GG
- 专业: 理论和计算化学
- 管辖: 仿真模拟
4楼2011-11-14 13:21:54
★
小木虫(金币+0.5):给个红包,谢谢回帖
小木虫(金币+0.5):给个红包,谢谢回帖
|
本帖内容被屏蔽 |
5楼2011-11-14 14:05:43
cenwanglai
荣誉版主 (知名作家)
老和山猥琐派九段
- 1ST强帖: 5
- 应助: 46 (小学生)
- 贵宾: 8.842
- 金币: 7440.4
- 散金: 9654
- 红花: 118
- 沙发: 23
- 帖子: 5306
- 在线: 1961.4小时
- 虫号: 537452
- 注册: 2008-04-01
- 性别: GG
- 专业: 理论和计算化学
- 管辖: 仿真模拟
6楼2011-11-14 14:06:49
★
小木虫(金币+0.5):给个红包,谢谢回帖
小木虫(金币+0.5):给个红包,谢谢回帖
|
本帖内容被屏蔽 |
7楼2011-11-14 14:09:06
cenwanglai
荣誉版主 (知名作家)
老和山猥琐派九段
- 1ST强帖: 5
- 应助: 46 (小学生)
- 贵宾: 8.842
- 金币: 7440.4
- 散金: 9654
- 红花: 118
- 沙发: 23
- 帖子: 5306
- 在线: 1961.4小时
- 虫号: 537452
- 注册: 2008-04-01
- 性别: GG
- 专业: 理论和计算化学
- 管辖: 仿真模拟
8楼2011-11-14 14:11:09
★
小木虫(金币+0.5):给个红包,谢谢回帖
小木虫(金币+0.5):给个红包,谢谢回帖
|
本帖内容被屏蔽 |
9楼2011-11-14 16:40:10
cenwanglai
荣誉版主 (知名作家)
老和山猥琐派九段
- 1ST强帖: 5
- 应助: 46 (小学生)
- 贵宾: 8.842
- 金币: 7440.4
- 散金: 9654
- 红花: 118
- 沙发: 23
- 帖子: 5306
- 在线: 1961.4小时
- 虫号: 537452
- 注册: 2008-04-01
- 性别: GG
- 专业: 理论和计算化学
- 管辖: 仿真模拟
10楼2011-11-14 16:50:58













回复此楼
哥是传说