24小时热门版块排行榜    

北京石油化工学院2026年研究生招生接收调剂公告
查看: 4224  |  回复: 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 的主题更新
普通表情 高级回复 (可上传附件)
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[考研] 085600,专业课化工原理,321分求调剂 +5 大馋小子 2026-03-28 5/250 2026-03-29 08:56 by qingfeng258
[考研] 291求调剂 +4 Y-cap 2026-03-29 5/250 2026-03-29 08:08 by 无际的草原
[考研] 数一英一271专硕(085401)求调剂,可跨 +7 前行必有光 2026-03-28 8/400 2026-03-28 23:22 by 小木虫tim
[考研] 学硕274求调剂 +9 Li李鱼 2026-03-26 9/450 2026-03-28 21:42 by bymhappy
[考研] 一志愿南昌大学324求调剂 +7 hanamiko 2026-03-27 7/350 2026-03-28 09:56 by 李上岸0921
[考研] 材料求调剂一志愿哈工大324 +7 闫旭东 2026-03-28 9/450 2026-03-28 08:51 by Xu de nuo
[考研] 315分求调剂 +7 26考研上岸版26 2026-03-26 7/350 2026-03-28 04:05 by fmesaito
[考研] 295求调剂 +5 1428151015 2026-03-27 6/300 2026-03-28 04:04 by fmesaito
[考研] 291求调剂 +7 孅華 2026-03-22 7/350 2026-03-28 04:02 by fmesaito
[考研] 070300化学求调剂 +4 起个名咋这么难 2026-03-27 4/200 2026-03-27 21:39 by 83503孙老师
[考研] 材料与化工085600,总分304,本科有两篇sci参与,求调剂 +10 幸运的酱酱 2026-03-22 12/600 2026-03-27 16:08 by muchong357
[考研] 复试调剂,一志愿南农083200食品科学与工程 +5 XQTJZ 2026-03-26 5/250 2026-03-27 14:49 by 狂炫麦当当
[考研] 求调剂323材料与化工 +7 1124361 2026-03-24 7/350 2026-03-27 10:22 by wangjy2002
[考研] 求调剂 +6 林之夕 2026-03-24 6/300 2026-03-27 08:38 by hypershenger
[考研] 342求调剂 +3 加油a李zs 2026-03-26 3/150 2026-03-27 00:29 by wxiongid
[考研] 329求调剂 +5 1() 2026-03-22 5/250 2026-03-26 20:40 by fmesaito
[考研] 【双一流院校新能源、环境材料,材料加工与模拟招收大量调剂】 +4 Higraduate 2026-03-22 8/400 2026-03-26 20:34 by Higraduate
[考研] 材料考研求调剂 +3 Dendel 2026-03-23 6/300 2026-03-26 17:51 by fmesaito
[考研] 机械学硕310分,数一英一,一志愿211本科双非找调剂信息 +3 @357 2026-03-25 3/150 2026-03-26 16:34 by by.MENG
[考研] 化学调剂一志愿上海交通大学336分-本科上海211 +4 小鱼爱有机 2026-03-25 4/200 2026-03-26 10:19 by aa331100
信息提示
请填处理意见