语法

  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"

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


初始化

相关命令: units、dimension、newton、processors、boundary atom_style、atom_modify

pair_style、bond_style、angle_style、dihedral_style、improper_style

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


系统定义

相关命令:read_data、read_restart 

lattice, region、create_box、create_atoms、read_dump

replicate

关于模拟的区域


模拟设置

力场系数(也可以写在read-in文件里):pair_coeff、bond_coeff、angle_coeff、dihedral_coeff、improper_coeff、kspace_style、dielectric、special_bonds

模拟参数:neighbor、neigh_modify、group、timestep、reset_timestep、run_style、min_style、min_modify

计算指令:compute、compute_modify、variable

输出指令: thermo、dump、restart


运行

 run、minimize、temper