c_ID[] per?atom scalar from a per?atom compute c_ID[][M] per?atom vector component from a per?atom compute 对于变量的引用说明如下表。 v_ID scalar value of a non atom?style variable v_ID[N] single atom's scalar value from an atom?style variable v_ID[] per?atom value from an atom?style variable
next variables
next x
next a t x myTemp
给变量指派下一个值,如果后面接多个变量,这几个变量必须是同一类型的变量。 如果next后面的变量用尽了,将导致跳过下一个jump命令。 variable d index run1 run2 run3 run4 run5 run6 run7 run8 shell cd $d read_data data.polymer run 10000 shell cd .. clear next d jump in.polymer
jump file label
转到别的输入文件,如果含label就会跳转到文件的label中。如果label不存在,将终止计算。 注意和include不同,跳过去后,不回返回到原来文件处继续执行。
对于loop变量,当变量值通过next都使用完了,会跳过下一个jump命令。
label string
定义某行为一个标签。用于jump命令。 variable a loop 10 label loop dump 1 all atom 100 file.$a run 10000 undump 1 next a jump in loop 双重循环: label loopa variable a loop 5 label loopb variable b loop 5 print \run 10000 if $b > 2 then \next b jump in loopb label break variable b delete next a jump in loopa
if value1 operator value2 then command1 else command2
if ${steps} > 1000 then exit
if $x <= $y then \if ${eng} > 0.0 then \
26
if ${eng} > ${eng_previous} then \value1 = 1st value
operator = \\ value2 = 2nd value then = required word
command1 = command to execute if condition is met else = optional word
command2 = command to execute if condition is not met (optional argument) 如果命令不是有效的lammps命令,将会导致程序终止。比如exit。
include filename
插入别的输入文件,类似于Fortran。
文件名可以是变量,这样可以 用于不同处理器计算不同任务。可以设计用于循环。
shell cd/mkdir/mv/rm/rmdir
shell cd sub1 shell cd ..
shell mkdir tmp1 tmp2 tmp3 shell rmdir tmp1
shell mv log.lammps hold/log.1 shell rm TMP/file1 TMP/file2
Linux shell,执行基本的linux命令。
lammps不会检测是否执行成功,以及错误信息。
10. 模拟方法论
缺陷的生成
# vacancy
region 1 sphere 0 0 0 0.01 delete_atoms region 1 # interstitial
create_atoms 2 single 0 0 0 # substitutional set atom 1 type 2
或者: vacancy + interstitial
晶格常数
variable i loop 100
variable latcont equal 4.0+$i*0.001 lattice fcc ${latcont} minimize 1e-8 1e-8 100 1000
关键原理:做一个循环,计算不同晶格常数下体系的能量,最低的就是稳定结构。
迁移
方法一:fix ID group?ID setforce fx fy fz,设置原子在迁移方向的力为0 1. 间隙原子从四面体间隙途径八面体间隙迁移至四面体间隙 lattice bcc 3.1650
create_atoms 2 single $x 0.5 0.0
27
fix 2 diffusion setforce 0.0 NULL NULL
关键原理:设置迁移原子X方向的力为0,让其只能在yz平面移动。 2. 间隙原子从四面体间迁移至四面体间隙
lattice bcc 3.165 orient x 1 1 0 orient y -1 1 0 orient z 0 0 1 create_atoms 2 single $x 0.5 0.0
fix 2 diffusion setforce 0.0 NULL NULL
关键原理:变换点阵的基矢,逆顺时针转45度,这样可以保证迁移方向为x方向。再设置x方向力为0。 方法二:fix ID group?ID planeforce x y z,设置原子只能在某个平面内移动。
表面
(100)表面
boundary p p fm lattice bcc 3.165 (110)表面
lattice bcc 3.165 orient x -1 1 0 orient y 0 0 1 orient z 1 1 0 (112)表面
lattice bcc 3.165 orient x -1 1 0 orient y -1 -1 1 orient z 1 1 2
关键原理:设置Z方向为非周期性边界条件。变换点阵的基矢,使Z轴垂直于表面。
28
百度搜索“70edu”或“70教育网”即可找到本站免费阅读全部范文。收藏本站方便下次阅读,70教育网,提供经典综合文库lammp中文手册(6)在线全文阅读。
相关推荐: