24小时热门版块排行榜    

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

老虎大王

木虫 (著名写手)

★ ★ ★ ★ ★ ★ ★ ★ ★
小木虫(金币+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的回帖
查看全部 15 个回答

老虎大王

木虫 (著名写手)

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

另外,也可以用其它的工具生成起始构型,然后用read_data读进来。
2楼2010-05-08 21:29:48
已阅   回复此楼   关注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的回帖
普通表情 高级回复 (可上传附件)
信息提示
请填处理意见