24小时热门版块排行榜    

查看: 650  |  回复: 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的回帖

wangqj1

铁杆木虫 (著名写手)

hao dong dong
2楼2008-08-18 13:26:07
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

watermall

金虫 (小有名气)

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

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的回帖
相关版块跳转 我要订阅楼主 bshliu 的主题更新
普通表情 高级回复 (可上传附件)
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[博后之家] 售SCI一区T0P文章,我:8.O.55.1.O.5.4,科目全,可+急 +3 Aj1rhIDL5ixY 2026-09-14 3/150 2026-09-15 20:26 by zNcEhTcH7ihq
[考研] 售SCI一区T0P文章,我:8.O55.1.O.54,科目全,可十急 +3 Aj1rhIDL5ixY 2026-09-14 3/150 2026-09-15 20:14 by zNcEhTcH7ihq
[博后之家] 售SCI一区T0P文章,我:8O.55.1.O.54,科目全,可伽急 +3 40ms4Wlo4umh 2026-09-14 3/150 2026-09-15 19:23 by CgyNCDVNhGVg
[硕博家园] 售SCI一区T0P文章,我:8O.55.1.O.54,科目全,可伽急 +4 23jxep3nCNZb 2026-09-14 4/200 2026-09-15 18:11 by CgyNCDVNhGVg
[考研] 售SCI文章,我:8O5.5.1.O.54,科目齐全,可+急 +4 6F5UbRU2I5hL 2026-09-14 4/200 2026-09-15 17:23 by CgyNCDVNhGVg
[考研] 售SCI-T0P文章,我:8O.5.5.1.O.54,科目齐全,可+急 +3 6F5UbRU2I5hL 2026-09-14 3/150 2026-09-15 17:15 by CgyNCDVNhGVg
[考博] 售SCI一区文章,我:8O5.5.1.O5.4,科目全,可伽急 +7 s3fFTmArrBt6 2026-09-14 7/350 2026-09-15 16:23 by CgyNCDVNhGVg
[找工作] 售SCI一区文章,我:8O5.5.1.O5.4,科目全,可伽急 +6 3n8v2C8RimXI 2026-09-13 6/300 2026-09-15 15:02 by CgyNCDVNhGVg
[博后之家] 售SCI一区T0P文章,我:8O.55.1.O.54,科目全,可伽急 +6 QUjhNVAcOSff 2026-09-13 7/350 2026-09-15 14:13 by VMDqgnlKimtZ
[教师之家] 售SCI-T0P文章,我:8O.5.5.1.O.54,科目齐全,可+急 +3 6F5UbRU2I5hL 2026-09-14 3/150 2026-09-15 08:26 by C79jjtjAKjEn
[教师之家] 售SCI文章,我:8O.5.5.1O.54,科目全,可十急 +3 6F5UbRU2I5hL 2026-09-14 3/150 2026-09-15 08:14 by C79jjtjAKjEn
[找工作] 售SCI一区T0P文章,我:8.O.55.1.O.5.4,科目全,可+急 +4 6F5UbRU2I5hL 2026-09-14 4/200 2026-09-15 08:02 by C79jjtjAKjEn
[教师之家] 售SCI一区T0P文章,我:8O.55.1.O.54,科目全,可伽急 +4 6F5UbRU2I5hL 2026-09-14 4/200 2026-09-15 07:50 by C79jjtjAKjEn
[考研] 售SCI一区T0P文章,我:8.O.55.1.O.5.4,科目全,可+急 +4 LwdutQ8HoqWP 2026-09-13 4/200 2026-09-15 06:14 by 5BDX0d0WFp7t
[找工作] 售SCI一区T0P文章,我:8.O.55.1.O54,科目全,可伽急 +3 3n8v2C8RimXI 2026-09-13 4/200 2026-09-15 06:01 by 5BDX0d0WFp7t
[博后之家] 售SCI一区T0P文章,我:8.O55.1.O.54,科目全,可十急 +6 3n8v2C8RimXI 2026-09-13 6/300 2026-09-15 05:50 by 5BDX0d0WFp7t
[硕博家园] 售SCI一区文章,我:8.O.551.O.5.4,科目全,可伽急 +3 s3fFTmArrBt6 2026-09-13 5/250 2026-09-14 23:13 by vZfe6xYu34yj
[公派出国] 售SCI-T0P文章,我:8O.5.5.1.O.54,科目齐全,可+急 +3 LwdutQ8HoqWP 2026-09-13 6/300 2026-09-14 22:37 by vZfe6xYu34yj
[找工作] 浙江师范大学是怎么坑我的 +6 recruit123 2026-09-09 6/300 2026-09-14 12:00 by 萨仁其其格
[考博] 27秋季材料博士申请求助 10+3 Cahal1 2026-09-11 4/200 2026-09-14 08:50 by 北京莱茵编辑
信息提示
请填处理意见