| 查看: 425 | 回复: 4 | |||||||
| 当前主题已经存档。 | |||||||
[交流]
传一个PWscf构建超晶胞到脚本程序
|
|||||||
|
#!/bin/bash echo -e "establish a supercell from a unit cell" echo -e "Please input the number of the atoms:\c" read atomnumber echo -e "Please input the types of the atoms:\c" read atomtypes echo -e "Please in put the lattice paremeters\na b c cos(ab) cos(bc) cos(ac)" read a b c Calpha Cbeta Cgamma echo -e "please input the rule for supercell\n x1 y2 z3 " read x1 y2 z3 if [ -f input.txt ];then echo "exist" rm -f input.txt fi let kcount=0 let increase=1 while [ $kcount -ne $atomnumber ]; do echo -e "please input the $kcount atom x, y, z coordinates...\n atom type x y z" read atomtype x y z echo -e "$x $y $z\n" xx=$x; yy=$y; zz=$z kcountx=0 while [ $kcountx -lt $x1 ]; do kcounty=0 while [ $kcounty -lt $y2 ]; do kcountz=0 while [ $kcountz -lt $z3 ]; do x=`echo $x1 $kcountx $xx|awk '{printf "%0.8f\n", 1/$1*$2+$3/$1}'` y=`echo $y2 $kcounty $a $b $yy|awk '{printf "%0.8f\n", 1/$1*$2*$4/$3+$5/$1}'` z=`echo $z3 $kcountz $a $c $zz|awk '{printf "%0.8f\n", 1/$1*$2*$4/$3+$5/$1}'` echo "$x $y $z" kcountz=$((kcountz+1)); echo $atomtype $x $y $z >>input.txt done kcounty=$((kcounty+1)); done kcountx=$((kcountx+1)); done let kcount=kcount+1 done 直接cp在成.sh文件,按赵提示运行就可以构造任意大小到超晶报 有喜欢PWscf计算的虫子可以 交流交流 本人的 E-mail: liubaoshun@126.com |
» 猜你喜欢
EST投稿状态问题
已经有6人回复
职称评审没过,求安慰
已经有15人回复
垃圾破二本职称评审标准
已经有11人回复
投稿Elsevier的Neoplasia杂志,到最后选publishing options时页面空白,不能完成投稿
已经有16人回复
谈谈两天一夜的“延安行”
已经有14人回复
毕业后当辅导员了,天天各种学生超烦
已经有4人回复
聘U V热熔胶研究人员
已经有10人回复
求助文献
已经有3人回复
投稿返修后收到这样的回复,还有希望吗
已经有8人回复
三无产品还有机会吗
已经有6人回复
wangqj1
铁杆木虫 (著名写手)
- 应助: 3 (幼儿园)
- 金币: 7724.5
- 帖子: 2164
- 在线: 485.7小时
- 虫号: 485098
- 注册: 2007-12-27
- 专业: 凝聚态物性 II :电子结构
haiw201
木虫 (正式写手)
- 应助: 0 (幼儿园)
- 贵宾: 0.2
- 金币: 2860.3
- 散金: 1
- 红花: 1
- 帖子: 635
- 在线: 36.6小时
- 虫号: 147102
- 注册: 2005-12-27
- 性别: GG
- 专业: 凝聚态物性 II :电子结构













回复此楼