语法

  1. LAMMPS按照顺序逐条执行命令,而不是全部读完文件后再执行

  1. 命令末尾出现&表示换行

    在写命令中途可以使用:

dump        2 all image 100 image.*.jpg type type &
            zoom 1.6 adiam 1.5

​ 和

dump        2 all image 100 image.*.jpg type type zoom 1.6 adiam 1.5

​ 两段代码是一个意思,不过第二种写法要写在一行。


​ &在字符串内部使用,也表示换行:

variable a string "red green blue &
                purple orange cyan"

​ 如果用的三个引号,那么不需要&就可以换行:

print """
System volume = $v
System temperature = $t
"""

  1. #表示注释,不过在引号里的#不算

  1. $:用variable 定义的变量,在下面引用变量的值时就要使用${}

    ${变量名},如果变量名是单个字母,大括号可以省略。例如:

    variable X equal (xlo+xhi)/2+sqrt(v_area)
    region 1 block $X 2 INF INF EDGE EDGE
    variable X delete

    $(表达式),表达式视为临时变量,一般是个公式。例:

region 1 block $((xlo+xhi)/2+sqrt(v_area)) 2 INF INF EDGE EDGE

​ 又例:

print "Final energy per atom: $(pe/atoms:%10.3f) eV/atom"

==注意:$不能嵌套。==


初始化

相关命令: unitsdimensionnewtonprocessorsboundary atom_styleatom_modify

pair_stylebond_styleangle_styledihedral_styleimproper_style

都是粒子或粒子间相互作用有关的信息


系统定义

相关命令:read_dataread_restart 

latticeregioncreate_boxcreate_atomsread_dump

replicate

关于模拟的区域


模拟设置

力场系数(也可以写在read-in文件里):pair_coeffbond_coeffangle_coeffdihedral_coeffimproper_coeffkspace_styledielectricspecial_bonds

模拟参数:neighborneigh_modifygrouptimestepreset_timesteprun_stylemin_stylemin_modify

计算指令:computecompute_modifyvariable

输出指令: thermodumprestart


运行

 runminimizetemper

大佬论坛