24小时热门版块排行榜    

北京石油化工学院2026年研究生招生接收调剂公告
查看: 4246  |  回复: 14

Yelong_Wu

银虫 (初入文坛)

[交流] 【求助】lammps中多元化合物的晶格创建问题 已有9人参与

lattice custom 3.104 a1 0.8660254037844386 -0.5 0 a2 0 1.0 0 a3 0 0 1.602448454 &
basis 0.3333333333 0.6666666667 0.3826000000 &
basis 0.6666666667 0.3333333333 0.8826000000 &
basis 0.3333333333 0.6666666667 0.0000000000 &
basis 0.6666666667 0.3333333333 0.5000000000

region box block 0 3 0 3 0 3
create_box 2 box

create_atoms 1 box basis 1 1 basis 2 1
create_atoms 2 box basis 3 2 basis 4 2


我想创建一个二元化合物,建立了一个晶格,晶格中有四个basis,我想在第1个和第2个的basis上创建A原子,在3、4上创建B原子,我上边的代码却始终不成功,The Fuc*ing Manual 上写的create_atoms 中basis的参数是:

  basis values = M itype
    M = which basis atom
    itype = atom type (1-N) to assign to this basis atom

我不知道我是哪里错了,新人,望大家指教,谢谢!
回复此楼
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
回帖支持 ( 显示支持度最高的前 50 名 )

老虎大王

木虫 (著名写手)

★ ★
小木虫(金币+0.5):给个红包,谢谢回帖交流
ghcacj(金币+1):谢谢 2010-05-08 21:34:01
把运行后的出错信息贴出来。

另外,也可以用其它的工具生成起始构型,然后用read_data读进来。
2楼2010-05-08 21:29:48
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

老虎大王

木虫 (著名写手)

★ ★ ★ ★ ★ ★ ★ ★ ★
小木虫(金币+0.5):给个红包,谢谢回帖交流
ghcacj(金币+8):谢谢 2010-05-10 08:23:47
好的。

你搞的是GaN,建立的是一个六方的晶格,。原子位置的设置是正确的。晶格尺寸不是实验值,因为你要

研究晶格尺寸的变化,是的吧?

我对你这个script有这样几个评论:

一、 首先 create_atoms 1 box basis 1 1 basis 2 1 这样的用法是错误的。
请看Manual中create_atoms的说明:

  For the box style, the create_atoms command fills the entire simulation box with atoms on the lattice.

我测试了
create_atoms 1 box basis 1 1 basis 2 1
create_atoms 1 box
这两个语句,结果都是一样的。说明后面的basis好像不起作用。我不知道这是程序的bug还是这个地方确实不能用box。

反正,经测试,create_atoms 1 box basis 1 1 basis 2 1 这一句中,不能用box,而要用region。


二、你改了上述错误之后(即把这两句中的box 改成region box,其中后面的box是region的ID),仍然

会发现有问题。因为生成的原子个数不对。这是为什么呢?

你看你的script,其中有:
region box block 0 3 0 3 0 3
create_box 2 box
这两句。
系统执行了以后,返回的信息是:Created orthogonal box = (0 0 0) to (8.06443 13.968 14.922),
这说明你生成的是一个方盒子。实际上,你要的盒子是个什么盒子呢?你是六角晶系,当然应是一个平行

六面体(你可以照着你自己写的lattice语句,在纸上画画)。

所以,你region box block 0 3 0 3 0 3这一句当中的style用bolck也是不对的,正确的设置应该用

prism,至于如何用,请你读Manual。

以上意见供参考。若仍有问题,可以继续讨论。
5楼2010-05-09 21:33:59
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

snail594

金虫 (小有名气)

★ ★
小木虫(金币+0.5):给个红包,谢谢回帖交流
ghcacj(金币+1):谢谢 2010-05-21 09:34:45
在lattice下用basis,然后再create_atoms,试试,我用过
Inlearningwetrust
7楼2010-05-21 00:59:29
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

huanyingst

新虫 (初入文坛)


小木虫: 金币+0.5, 给个红包,谢谢回帖
引用回帖:
5楼: Originally posted by 老虎大王 at 2010-05-09 21:33:59
好的。

你搞的是GaN,建立的是一个六方的晶格,。原子位置的设置是正确的。晶格尺寸不是实验值,因为你要

研究晶格尺寸的变化,是的吧?

我对你这个script有这样几个评论:

一、 首先 create_atoms 1 b ...

你好 我按照你说的改了一下 为什么输出显示是三斜的,不是六角晶系呢?
13楼2015-06-25 14:57:59
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
普通回帖

Yelong_Wu

银虫 (初入文坛)

首先谢谢上边的回复,我的模拟是要对晶格的尺寸做变化的,其实在我正式模拟的in文件中晶格参数里面是有变量的,所以我的原子坐标没有采用read_data读入,上边贴出的代码只是我做测试用的,经过测试后发现是create_atoms命令使用不正确,下边是我测试的代码,运行时没有问题的,我的box当中原则上只有162个basis,可是由运行的结果来看两个create_atoms都创建了162个atoms,共324个atoms,第一个creat_atoms我是想让他在在第一种和第二种类型的basis上创建Ga原子上,第一种类型和第二种类型的basis加起来才162/2个,可是他却创建了162个,所以我想请问大家create_atoms带basis参数的命令应该是怎么用,谢谢!

units                   metal
boundary                p p p

atom_style              atomic

lattice custom 3.104 a1 0.8660254037844386 -0.5 0 a2 0 1.0 0 a3 0 0 1.602448454 basis 0.3333333333 0.6666666667 0.3826000000 basis 0.66666666
67 0.3333333333 0.8826000000 basis 0.3333333333 0.6666666667 0.0000000000 basis 0.6666666667 0.3333333333 0.5000000000
Lattice spacing in x,y,z = 2.68814 4.656 4.974

region box block 0 3 0 3 0 3
create_box 2 box
Created orthogonal box = (0 0 0) to (8.06443 13.968 14.922)
  1 by 1 by 1 processor grid

create_atoms 1 box basis 1 1 basis 2 1
Created 162 atoms
create_atoms 2 box basis 3 2 basis 4 2
Created 162 atoms

pair_style              tersoff
pair_coeff              * * GaN.tersoff Ga N

mass                    1 69.723
mass                    2 14.0067

neighbor                1.0 bin
neigh_modify            every 1 delay 5 check yes

dump                    1 all cfg 1 a*.cfg id type xs ys zs
#dump_modify            1 element Al N

run                     0
Memory usage per processor = 1.831 Mbytes
Step Temp E_pair E_mol TotEng Press
       0            0          nan            0          nan          nan
Loop time of 0 on 1 procs for 0 steps with 324 atoms

Pair  time (%) = 0 (0)
Neigh time (%) = 0 (0)
Comm  time (%) = 0 (0)
Outpt time (%) = 0 (0)
Other time (%) = 0 (0)

Nlocal:    324 ave 324 max 324 min
Histogram: 1 0 0 0 0 0 0 0 0 0
Nghost:    1188 ave 1188 max 1188 min
Histogram: 1 0 0 0 0 0 0 0 0 0
Neighs:    0 ave 0 max 0 min
Histogram: 1 0 0 0 0 0 0 0 0 0
FullNghs: 17364 ave 17364 max 17364 min
Histogram: 1 0 0 0 0 0 0 0 0 0

Total # of neighbors = 17364
Ave neighs/atom = 53.5926
Neighbor list builds = 0
Dangerous builds = 0
3楼2010-05-09 12:47:27
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

老虎大王

木虫 (著名写手)

★ ★
小木虫(金币+0.5):给个红包,谢谢回帖交流
lei0736(金币+1):谢谢 2010-05-21 10:57:04
不好意思,我刚写的有误,我删了重新来。

为什么你的体系中有162个原子?这个是从什么地方算来的?

[ Last edited by 老虎大王 on 2010-5-9 at 21:34 ]
4楼2010-05-09 21:13:29
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

Yelong_Wu

银虫 (初入文坛)

非常感谢老虎大王!

[ Last edited by Yelong_Wu on 2010-5-9 at 22:33 ]
6楼2010-05-09 22:06:19
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

tianlu2222

新虫 (初入文坛)


小木虫: 金币+0.5, 给个红包,谢谢回帖
学习了前面的帖子。
region命令格式:region ID prism xlo xhi ylo yhi zlo zhi xy xz yz
如region 1 prism 0 10 0 10 0 10 2 0 0
表示平行六面体原点位于(0 0 0),晶包三轴分别为a1=(10 0 0),a2=(2 10 0),a3=(0 0 10)
8楼2012-06-16 23:24:06
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

tianlu2222

新虫 (初入文坛)


小木虫: 金币+0.5, 给个红包,谢谢回帖
我刚刚把lz的lammps输入文件按照老虎大王的建议修改了一下,贴出来如下。

units                   metal
boundary                p p p

atom_style              atomic

lattice custom 3.104 a1 0.8660254037844386 -0.5 0 a2 0 1.0 0 a3 0 0 1.602448454 basis 0.3333333333 0.6666666667 0.3826000000 basis 0.6666666667 0.3333333333 0.8826000000 basis 0.3333333333 0.6666666667 0.0000000000 basis 0.6666666667 0.3333333333 0.5000000000

region box prism 0 3 0 3 0 3 1 0 0
create_box 2 box

create_atoms 1 region box basis 1 1 basis 2 1
create_atoms 2 region box basis 3 2 basis 4 2

pair_style              tersoff
pair_coeff              * * ../../potentials/GaN.tersoff Ga N

mass                    1 69.723
mass                    2 14.0067

neighbor                1.0 bin
neigh_modify            every 1 delay 5 check yes

dump                    1 all cfg 1 a*.cfg id type xs ys zs
#dump_modify            1 element Al N

run                     1

运行结果如下:

LAMMPS (5 Mar 2012)
Lattice spacing in x,y,z = 2.68814 4.656 4.974
Created triclinic box = (0 0 0) to (8.06443 13.968 14.922) with tilt (2.68814 0 0)
  1 by 1 by 1 MPI processor grid
Created 150 atoms
Created 150 atoms
WARNING: No fixes defined, atoms won't move (verlet.cpp:52)
Setting up run ...
Memory usage per processor = 2.08799 Mbytes
Step Temp E_pair E_mol TotEng Press
       0            0          nan            0          nan          nan
       1            0          nan            0          nan          nan
Loop time of 0.013598 on 1 procs for 1 steps with 300 atoms

Pair  time (%) = 0.0132082 (97.1333)
Neigh time (%) = 0 (0)
Comm  time (%) = 1.00136e-05 (0.0736403)
Outpt time (%) = 0.000373125 (2.74398)
Other time (%) = 6.67572e-06 (0.0490935)

Nlocal:    300 ave 300 max 300 min
Histogram: 1 0 0 0 0 0 0 0 0 0
Nghost:    1068 ave 1068 max 1068 min
Histogram: 1 0 0 0 0 0 0 0 0 0
Neighs:    0 ave 0 max 0 min
Histogram: 1 0 0 0 0 0 0 0 0 0
FullNghs:  15132 ave 15132 max 15132 min
Histogram: 1 0 0 0 0 0 0 0 0 0

Total # of neighbors = 15132
Ave neighs/atom = 50.44
Neighbor list builds = 0
Dangerous builds = 0

这个结果里面有300个原子,不是lz所说的162*2个原子。而且貌似没有在一个晶胞中定义成功2个原子。
谁给看看!
谢谢
9楼2012-06-16 23:55:26
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

xinmaoqin

银虫 (小有名气)


小木虫: 金币+0.5, 给个红包,谢谢回帖
引用回帖:
1062567楼: Originally posted by snail594 at 2010-05-21 00:59:29
在lattice下用basis,然后再create_atoms,试试,我用过

你好,我是先在lattice下定义basis,然后create_atoms在basis处创建原子:create_atoms  4 region target basis 4 4,结果跟上边老虎大王说的那中情况一样即create_atoms  4 region target 结果一样,你能帮忙指导下吗?谢谢
10楼2012-11-21 20:06:45
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
相关版块跳转 我要订阅楼主 Yelong_Wu 的主题更新
普通表情 高级回复 (可上传附件)
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[考研] 一志愿211生物学280分 求调剂 +3 李rien 2026-04-05 3/150 2026-04-05 17:17 by Ecowxq666!
[考研] 专硕310求调剂 +5 捞捞我…. 2026-04-04 6/300 2026-04-04 23:33 by barlinike
[考研] 材料与化工306分找调剂 +23 沧海轻舟e 2026-04-02 27/1350 2026-04-04 21:52 by laoshidan
[考研] 309分085801求调剂 +11 MY_angel 2026-03-31 11/550 2026-04-04 19:11 by 蓝云思雨
[考研] 309求调剂 +4 快乐的小白鸽 2026-04-04 5/250 2026-04-04 15:55 by cql1109
[考研] 283分材料与化工求调剂 +29 罗KAKA 2026-04-02 29/1450 2026-04-03 23:56 by userper
[考研] 322求调剂 +6 FZAC123 2026-04-03 6/300 2026-04-03 22:23 by 科研小专家
[考研] 070300一志愿211,312分求调剂院校 +16 小黄鸭宝 2026-03-30 16/800 2026-04-03 19:53 by lijunpoly
[考研] 320求调剂 +5 振—TZ 2026-04-02 5/250 2026-04-03 14:42 by fxue1114
[考研] 专硕085601求调剂 +7 suyifei 2026-04-03 8/400 2026-04-03 14:00 by 欣喜777
[考研] 求调剂22408 288分 +5 new382 2026-04-02 5/250 2026-04-03 09:13 by 醉在风里
[考研] 362求调剂 +14 西南交材料专硕3 2026-03-31 14/700 2026-04-02 17:50 by yunlongyang
[考研] 0710生物学求调剂 +9 manman511 2026-04-01 9/450 2026-04-02 10:00 by zxl830724
[考研] 279求调剂 +6 学而思兮知 2026-04-01 6/300 2026-04-02 09:16 by vgtyfty
[考研] 化学工程专硕324分,一志愿中国矿业大学求调剂 +7 耿耿1314 2026-04-01 7/350 2026-04-02 07:40 by 尚水阁主
[考研] 一志愿 南京航空航天大学 ,080500材料科学与工程学硕 +10 @taotao 2026-03-31 11/550 2026-04-01 09:43 by xiayizhi
[考研] 085601英二数二求调剂 总分325 +4 余航航 2026-03-31 4/200 2026-03-31 17:38 by 唐沐儿
[考研] 318求调剂 +10 陈晨79 2026-03-30 10/500 2026-03-31 17:37 by 544594351
[考研] 哈尔滨工业大学材料与化工专硕378求调剂 +3 塔比乌斯 2026-03-30 3/150 2026-03-30 22:55 by 无际的草原
[考研] 抱歉 +3 田洪有 2026-03-30 3/150 2026-03-30 19:11 by 迷糊CCPs
信息提示
请填处理意见