| 查看: 3710 | 回復(fù): 18 | |||
fly_elephan銀蟲 (小有名氣)
|
[交流]
vasp計(jì)算結(jié)果處理態(tài)密度要用到的程序 已有7人參與
|
|
在材料電學(xué)特性的研究中,能帶和態(tài)密度是我們最關(guān)心的,下面的這個(gè)程序可以用于vasp計(jì)算結(jié)果的處理,可以分離出總態(tài)密度和分態(tài)密度,這個(gè)程序是我們研究所用了很久的,絕對(duì)沒問題,有資源大家共享,歡迎下載。 #! /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 |
榮譽(yù)版主 (知名作家)
老和山猥瑣派九段
|
本帖內(nèi)容被屏蔽 |
榮譽(yù)版主 (知名作家)
老和山猥瑣派九段
|
本帖內(nèi)容被屏蔽 |
榮譽(yù)版主 (知名作家)
老和山猥瑣派九段
|
本帖內(nèi)容被屏蔽 |
榮譽(yù)版主 (知名作家)
老和山猥瑣派九段
|
本帖內(nèi)容被屏蔽 |
榮譽(yù)版主 (知名作家)
老和山猥瑣派九段
| 最具人氣熱帖推薦 [查看全部] | 作者 | 回/看 | 最后發(fā)表 | |
|---|---|---|---|---|
|
[考研] 總分293求調(diào)劑 +8 | 加一一九 2026-03-25 | 11/550 |
|
|---|---|---|---|---|
|
[考研] 一志愿雙一流機(jī)械285分求調(diào)劑 +4 | 幸運(yùn)的三木 2026-03-29 | 5/250 |
|
|
[考研] 309求調(diào)劑 +7 | 誰不是少年 2026-03-29 | 7/350 |
|
|
[考研] 本科雙非材料,跨考一志愿華電085801電氣,283求調(diào)劑,任何專業(yè)都可以 +6 | 芝士雪baoo 2026-03-28 | 8/400 |
|
|
[考研] 調(diào)劑考研 +3 | 王杰一 2026-03-29 | 3/150 |
|
|
[考研] 一志愿太原理工安全工程300分,求調(diào)劑 +5 | 0857求調(diào)劑. 2026-03-24 | 6/300 |
|
|
[考研] 071000生物學(xué)求調(diào)劑,初試成績(jī)343 +7 | 小小甜面團(tuán) 2026-03-25 | 7/350 |
|
|
[考研] 材料求調(diào)劑一志愿哈工大324 +7 | 閆旭東 2026-03-28 | 9/450 |
|
|
[材料工程] 一志愿C9材料與化工專業(yè)總分300求調(diào)劑 +8 | 曼111 2026-03-24 | 9/450 |
|
|
[考研] 08開頭275求調(diào)劑 +4 | 拉誰不重要 2026-03-26 | 4/200 |
|
|
[考研] 314求調(diào)劑 +3 | 溪云珂 2026-03-26 | 3/150 |
|
|
[考研] 一志愿鄭大085600,310分求調(diào)劑 +5 | 李瀟可 2026-03-26 | 5/250 |
|
|
[考研] 286求調(diào)劑 +4 | lim0922 2026-03-26 | 4/200 |
|
|
[考研] 327求調(diào)劑 +7 | prayer13 2026-03-23 | 7/350 |
|
|
[考研] 081200-11408-276學(xué)碩求調(diào)劑 +3 | 崔wj 2026-03-26 | 3/150 |
|
|
[考研] 340求調(diào)劑 +5 | 話梅糖111 2026-03-24 | 5/250 |
|
|
[考研] 300分,材料,求調(diào)劑,英一數(shù)二 +5 | 超贊的 2026-03-24 | 5/250 |
|
|
[考研] 材料專碩找調(diào)劑 +5 | 哈哈哈吼吼吼哈 2026-03-23 | 5/250 |
|
|
[考研] 344求調(diào)劑 +3 | desto 2026-03-24 | 3/150 |
|
|
[考研] 一志愿重慶大學(xué)085700資源與環(huán)境,總分308求調(diào)劑 +7 | 墨墨漠 2026-03-23 | 8/400 |
|