in.lmp参数

lammps读取设置的方式与vasp不同,vasp是计算之前全部读取,而lammps是逐行读取,在读取每一行后都会进行相应的操作,输入文件读取完毕,lammps结束

一个完整的lammps in.data文件应该包括 系统设置、模拟晶格/建模、相互作用势设置、计算设置/模拟条件、热力学输出与数据处理几个部分

运行lammps使用 -in -in.file

lammps的命令行区分大小写

#号不要乱用


1.系统设置

newton:控制通信; 在read_data 或者create_box后,不能修改 ,默认为on

package 对不同的机器进行加速? 需要设置在顶部

processors 多进程的命令

suffix

units(重要) 指定文件中的单位 ,设置为metal符合常规理解的单位。

需要在设置建模之前设置,默认为lj 。需要修改为metal,默认的模拟时间步长为 1 fs

image-20230721165151960

2.建模

boundary(重要) boundary x y z

可设置在不同方向上的边界条件 ,默认为 p p p ;p是周期性边界条件 可以设置为两个字母,分别对上下两个表面设置。设置p只能为一个字母。

4.模拟的设置

temp控温器频率的设置

image-20240518095627682

既不能太大(会导致升温出问题)也不能太小(控制太严格,没法跑)

对于大胞应该减小频率的值

路径/public/home/liz/workspace/5_bigmodel_md/test/tdamp

111胞

0.001

image-20240518095021575

0.01

image-20240518095036784

0.1

image-20240518095049830

1

image-20240518095059449

10

image-20240518095111902

100

image-20240518095121218

1000

image-20240518095132036

333胞

0.001

image-20240518092249192

0.01

image-20240518092302969

0.1

image-20240518092315834

1

image-20240518092328843

10

image-20240518092340008

100

image-20240518092425126

1000

image-20240518092437206

666胞

0.001

image-20240518092537274

0.01

image-20240518092549991

0.1

image-20240518092602604

1

image-20240518092624982

10

image-20240518092642026

100

image-20240518092701605

1000

image-20240518092716921

路径 /home/jildxwlxyljlstdui/cccs-share02/lijx/liz/2-Na-X-Si-O/2_NaXSiO_big_model/3_md_for_single_element/13_Sm/1000_444

0.5

10

image-20240311171144437

50

image-20240311171217694

100

image-20240311171243284

1000

image-20240311171312642

velocity 和fix nvt temp tstart tstop

nvt应该先跑升温过程,再跑平衡过程

测试路径:/public/home/liz/workspace/5_bigmodel_md/test/velocity-fix

1_ve_300_fix10001000

image-20240518100917920

2_ve1000_fix10001000

image-20240518100947730

3_ve300_fix3001000

image-20240518101023972

4_ve300_fix6001000

image-20240518101045018

5_without_ve_fix3001000

image-20240518101107354

6_withoutve_fix10001000

image-20240518101134414

5. 输出

1. 输出方式与形式

lammps四种输出类型

  • thermodynamic output(热力学输出) : 每隔一定时间步 向log或屏幕输出的量,由thermo_style控制

  • dump files: 按照固定频率输出到文件中的系统的按原子划分的性质,包括坐标和可计算的物理量,如msd等

  • 特定的fix命令也可以用于输出用户定义的量,包括 fix ave/time用于时间平均,fix ave/chunk 空间平均,fix print 用于单行变量的输出

  • restart files

lammps四种数据类型

  • global 全局的数据,如温度

  • per-atom 分原子的数据,如每原子的动能

  • local 原子组成的部分的性质,如键长

  • per-grid

lammps数据形式

  • scalar (标量) vector array(2维)

  • global scalar/vector/array

  • per-atom vector/aray

  • local vector/array

  • per-grid vector/array

  • 只有global是标量,因为其他的都通过多个划分组合成整体,因此不会是单独某个小区域量

lammps中comuput和fix和variable输出数据的形式

不同种类的组合

lammps中数据引用

image-20240415095229408

不同输出方式可输出的数据类型

thermodynamic output , thermo_style设定预输出数据,也可以输出c_ID f_ID v_name得到的global data

既输出扩展数据也输出归一数据(总能随着体系增大而增加),可以通过thermo_modify norm 来决定是否输出归一化数据


dump file 使用dump + dump modify输出 只能输出per_atom数据

dump local用于输出局部数据

dump grid 用于输出pre_grid data


fix 只有特定几个命令可用于输出

fix ave/time 时间平均,需要输入global data,

fix ave/chunk 空间平均 例如特定的分子,可以是每原子的物理量,如原子贡献 ,

fix ave/histo, 输出全局或每原子或局部的直方图数据

fix ave/correlate,输出时间关联量

fix print 可以输出到log文件也可以输出到特定文件


2. ITEM中xy xz yz的含义

dump command — LAMMPS documentation

image-20231125162429505

用一个正交的格子把三斜格子包围起来,

0870f414f31f528da4ab64315010825

前两列是正交格子的边界,第三列应该是投影值

a67102ceb8e3dee5e1fa995e14cde3a

6. 跑完后补充新计算的 rerun方法

lammps已跑完,不想重跑,如何补充新的计算? (qq.com)

用于计算snapshot的新的性质

rerun file1 file2 ... keyword args ...

7. 两个in.lmp输入文件

variable        x index 1
variable        y index 1
variable        z index 1
variable        ss equal 0.001
variable        tdamp equal "v_ss*100"

variable        dmsdx  equal   c_1[1]
variable        dmsdy  equal   c_1[2]
variable        dmsdz  equal   c_1[3]
variable        dmsd   equal   c_1[4]
variable        istep  equal   step
variable        msdx   format  dmsdx  %16.8e
variable        msdy   format  dmsdy  %16.8e
variable        msdz   format  dmsdz  %16.8e
variable        msd    format  dmsd   %16.8e
variable        sstep  format  istep  %-10g

units           metal
atom_style      atomic
boundary        p p p

read_data       ./data.nso
mass            1 6.941    #important
mass            2 88.91
mass            3 28.084
mass            4 15.999
replicate       $x $y $z

pair_style      acnn model-5000
pair_coeff      * * Li   Y   Si   O   #important

thermo          1
thermo_style    custom step time temp press pe lx ly lz ke
thermo_modify   format 4 %20.15g

compute         1 all msd com yes

dump            out  all custom 100 A.lammpstrj id element xu yu zu fx fy fz
dump_modify     out  element 1   2   3   4
dump_modify     out  format 1 %4d
dump_modify     out  format 2 %4s
dump_modify     out  format float %16.8f

velocity        all create 600.0 8728
timestep        ${ss}
fix             1 all nvt temp 1000 1000 ${tdamp}
fix             2 all print 1 "${sstep} ${msdx} ${msdy} ${msdz} ${msd}" screen no file msd.dat

run             1000000

#variable
variable        x equal 1
variable        y equal 1
variable        z equal 1
variable        step_time equal 0.001
variable        tdamp equal "v_step_time*100"


# initialize simulation settings
units           metal
boundary        p p p
atom_style      atomic

# define the simulation cell
read_data       data.nyso
group           na  type 1
mass            1 22.99
mass            2 88.91
mass            3 28.084
mass            4 15.999
replicate       $x $y $z

# set force field
pair_style      nnp SingleModel ./inv2 emap "1:Na,2:Y,3:Si,4:O"
pair_coeff      * *

# nvt simulation  
velocity        all create 800 3
fix             1 all nvt temp 800 800 ${tdamp}
timestep        ${step_time}

# rdf calculation 
#compute         rdf all rdf 100 1 1 1 2 2 2
#fix             2 all ave/time 100 1 100 c_rdf[*] file licl.rdf mode vector

# msd calculation
compute         msd1 na msd com yes
fix             2 all ave/time 1 1 1 c_msd1[4] file Na_yes_MSD.dat
compute         msd2 na msd com no
fix             3 all ave/time 1 1 1 c_msd2[4] file Na_no_MSD.dat
compute         msd3 all msd com yes
fix             4 all ave/time 1 1 1 c_msd3[4] file all_yes_MSD.dat
compute         msd4 all msd com no
fix             5 all ave/time 1 1 1 c_msd4[4] file all_no_MSD.dat

# output
thermo_style    custom step temp pe ke etotal press lx ly lz
thermo          1
dump            1 all custom 100 lammps.trj id type x y z 

log             ./log.lammps
run             10000

转载请注明来源 有问题可通过github提交issue