24小时热门版块排行榜    

Znn3bq.jpeg
查看: 490  |  回复: 4
当前主题已经存档。
当前只显示满足指定条件的回帖,点击这里查看本话题的所有回帖

bshliu

铁虫 (小有名气)

[交流] 传一个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
回复此楼

» 猜你喜欢

已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

watermall

金虫 (小有名气)

不错,支持自给自足
3楼2008-08-19 17:55:04
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
查看全部 5 个回答

haiw201

木虫 (正式写手)

不会用?
可否建个BaTiO3的Supercell演示下????
4楼2008-08-19 20:31:26
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

bshliu

铁虫 (小有名气)

回复

你首先自己要知道一个BaTiO3晶胞的院子坐标,然后输入处理
我给出TiO2金红石 2*2*2的supercell的构造过程
首先知道TiO2金红石的六个院子坐标  -这个可用ms求出
  Ti      0.000000000     0.000000000    0.000000000  
   Ti      0.500000000     0.50000000     0.322500000  
   O       0.304800000     0.304800000    0.000000000
   O       0.695200000     0.695200000    0.000000000
   O       0.195200000     0.804800000    0.322500000
   O       0.804800000     0.195200000    0.322500000
然后执行shell
establish a supercell from a unit cell
Please input the number of the atomslease input the types of the atomslease in put the lattice paremeters
a   b  c  cos(ab)  cos(bc) cos(ac)
please input the rule for supercell
x1  y2  z3
exist
please input the 0 atom x, y, z coordinates...
atom type   x     y  z
0.000000000  0.000000000  0.000000000

0.00000000   0.00000000   0.00000000
0.00000000   0.00000000   0.32244009
0.00000000   0.50000000   0.00000000
0.00000000   0.50000000   0.32244009
0.50000000   0.00000000   0.00000000
0.50000000   0.00000000   0.32244009
0.50000000   0.50000000   0.00000000
0.50000000   0.50000000   0.32244009
please input the 1 atom x, y, z coordinates...
atom type   x     y  z
0.500000000  0.50000000  0.322500000

0.25000000   0.25000000   0.16125000
0.25000000   0.25000000   0.48369009
0.25000000   0.75000000   0.16125000
0.25000000   0.75000000   0.48369009
0.75000000   0.25000000   0.16125000
0.75000000   0.25000000   0.48369009
0.75000000   0.75000000   0.16125000
0.75000000   0.75000000   0.48369009
please input the 2 atom x, y, z coordinates...
atom type   x     y  z
0.304800000  0.304800000  0.000000000

0.15240000   0.15240000   0.00000000
0.15240000   0.15240000   0.32244009
0.15240000   0.65240000   0.00000000
0.15240000   0.65240000   0.32244009
0.65240000   0.15240000   0.00000000
0.65240000   0.15240000   0.32244009
0.65240000   0.65240000   0.00000000
0.65240000   0.65240000   0.32244009
please input the 3 atom x, y, z coordinates...
atom type   x     y  z
0.695200000  0.695200000  0.000000000

0.34760000   0.34760000   0.00000000
0.34760000   0.34760000   0.32244009
0.34760000   0.84760000   0.00000000
0.34760000   0.84760000   0.32244009
0.84760000   0.34760000   0.00000000
0.84760000   0.34760000   0.32244009
0.84760000   0.84760000   0.00000000
0.84760000   0.84760000   0.32244009
please input the 4 atom x, y, z coordinates...
atom type   x     y  z
0.195200000  0.804800000  0.322500000

0.09760000   0.40240000   0.16125000
0.09760000   0.40240000   0.48369009
0.09760000   0.90240000   0.16125000
0.09760000   0.90240000   0.48369009
0.59760000   0.40240000   0.16125000
0.59760000   0.40240000   0.48369009
0.59760000   0.90240000   0.16125000
0.59760000   0.90240000   0.48369009
please input the 5 atom x, y, z coordinates...
atom type   x     y  z
0.804800000  0.195200000  0.322500000

0.40240000   0.09760000   0.16125000
0.40240000   0.09760000   0.48369009
0.40240000   0.59760000   0.16125000
0.40240000   0.59760000   0.48369009
0.90240000   0.09760000   0.16125000
0.90240000   0.09760000   0.48369009
0.90240000   0.59760000   0.16125000
0.90240000   0.59760000   0.48369009
输出坐标文件在input.txt
希望对你有用
5楼2008-08-19 22:12:20
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
普通表情 高级回复 (可上传附件)
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[考研] 284求调剂 +3 让我上岸吧阿西 2026-04-09 3/150 2026-04-09 11:32 by yongzhesheng
[考研] 一志愿鲁东大学071000生物学学硕初试分数276求调剂 +15 慕绝cc 2026-04-09 19/950 2026-04-09 10:40 by zhjsh86521
[考研] 考研调剂 +12 冰冰,,, 2026-04-07 12/600 2026-04-09 09:04 by 5268321
[考研] 085501机械英二77总分294求调剂,接受跨专业学习 +5 守法公民亓纪 2026-04-08 5/250 2026-04-08 21:19 by bljnqdcc
[考研] 本科211,293分请求调剂 +12 莲菜就是藕吧 2026-04-03 13/650 2026-04-08 20:30 by 背对大海出发
[考研] 22408 266求调剂 +11 masss11222 2026-04-07 14/700 2026-04-08 11:06 by yulian1987
[考研] 274求调剂 +4 山阿蔓 2026-04-07 4/200 2026-04-08 09:49 by eyeliyang
[考研] 283分求调剂 +14 试试看呗 2026-04-04 14/700 2026-04-08 07:03 by lijunpoly
[考研] 22408 318分求调剂 +4 勤奋的小笼包 2026-04-06 6/300 2026-04-07 15:05 by 纸鹤555
[考研] 考研调剂 +7 15615482637 2026-04-04 7/350 2026-04-06 22:56 by chenzhimin
[考研] 285求调剂 +5 mapmath 2026-04-06 6/300 2026-04-06 17:18 by 蓝云思雨
[考研] 081200-11408-276学硕求调剂 +5 崔wj 2026-04-05 5/250 2026-04-06 15:40 by lin-da
[考研] 一志愿河北工业大学材料工程,初试344求专硕调剂 +6 15933906766 2026-04-05 6/300 2026-04-06 13:21 by 无际的草原
[考研] 296求调剂 +3 汪!?! 2026-04-05 4/200 2026-04-05 20:13 by 啵啵啵0119
[考研] 298分 070300求调剂 +15 zwen03 2026-04-02 15/750 2026-04-05 12:52 by Hdyxbekcb
[考研] 数一英一274机械调剂 +5 星陨流霞 2026-04-04 6/300 2026-04-05 11:38 by arrow8852
[考研] 298求调剂 +7 manman511 2026-04-05 7/350 2026-04-05 10:29 by 唐沐儿
[考研] 一志愿中国石油大学化学工程323分求调剂 +4 化工专硕323分 2026-04-03 6/300 2026-04-03 22:12 by dongzh2009
[考研] 考研调剂 +8 不爱喝饮料 2026-04-03 8/400 2026-04-03 16:40 by Mistake-J
[考研] 346求调剂 +5 郑诚乐 2026-04-02 5/250 2026-04-02 16:38 by SZW_UJN
信息提示
请填处理意见