LAMMPS 专题

LAMMPS 反馈、蒙特卡洛与非仿射量

用实际完成的 LAMMPS 输入展示参数、提交和结果文件,附各条件的操作记录。

更新于 2026-11-18约 4 分钟阅读按任务与环境选择适用配置
阅读本篇目录

下载输入、Slurm 作业与实际结果。本例使用 LAMMPS 30 Sep 2026 的 P100 构建。附件保存 3 个已完成条件,按输入保留相互作用与操作参数。

选择条件#

解压并进入 lammps-feedback-mc-nonaffine-operations。CASES 每行对应一个作业数组索引,inputs 保存条件输入,reference 保存实际输出。gpu 条件使用 GPU 构建,其中普通 CPU 样式按输入直接运行;kokkos 条件启用 Kokkos。

条件目录 主要样式 运行模式
langevin-numeric-stop-p100-PID-Langevin-temperature pair_style lj/cut, fix nve, fix langevin, fix controller, fix ave/time, dump custom gpu
p100-TFMC-LJ-solid pair_style lj/cut, compute displace/atom, compute pe/atom, fix tfmc, dump custom gpu
p100-nonaffine-shear-and-local-kick pair_style lj/cut, fix nve, fix deform, fix nonaffine/displacement, compute reduce, fix ave/time, dump custom gpu

输入与提交#

第一组的输入如下。单位、边界条件和参数以对应 in.lammps 为准。

units lj
boundary p p p
atom_style atomic
newton off
lattice fcc .8442
region box block 0 5 0 5 0 5
create_box 1 box
create_atoms 1 box
mass 1 1.0
pair_style lj/cut 2.5
pair_coeff * * 1.0 1.0 2.5
neighbor .3 bin
neigh_modify every 1 delay 0 check yes
thermo 20
thermo_style custom step atoms temp pe etotal press
thermo_modify norm no
timestep .005
velocity all create .6 238971 mom yes rot yes dist gaussian
variable tcontrol internal .6
fix nve all nve
fix bath all langevin v_tcontrol 1.2 1.0 238973 tally yes
fix pid all controller 20 .5 1.0 .1 0.0 c_thermo_temp 1.2 tcontrol
variable target equal v_tcontrol
fix hist all ave/time 20 1 20 c_thermo_temp v_target f_pid[1] f_pid[2] f_pid[3] file feedback-history.dat
dump coords all custom 100 trajectory.lammpstrj id type x y z vx vy vz
dump_modify coords sort id
thermo_style custom step atoms temp pe etotal v_target f_pid[1] f_pid[2] f_pid[3]
run 4000
write_data final.data nocoeff

在附件根目录提交第一组或所选条件。

sbatch --array=0 run.slurm
# 按 CASES 的完整列表提交
sbatch run.slurm

脚本申请一个 MPI 任务、一个 CPU 核和一张 P100,根据 MODES 加载对应模块。实际调用保存在 cases.json,例如第一组的命令参数为:

lmp -k off -pk omp 1 -echo both -in in.lammps > native.out

查看输出#

结果写入 work-new/条件名。先查看日志中的实际热力学表与结束信息。

cd work-new/langevin-numeric-stop-p100-PID-Langevin-temperature
tail -n 35 native.out

本次第一组的原生日志片段如下。

Loop time of 1.31308 on 1 procs for 4000 steps with 500 atoms
Total wall time: 0:00:01

原始输入若包含 dump、数据表或其他导出命令,相应文件会保存在该条件目录。附件提供的参考数据文件为 feedback-history.dat, final.data。按自己的体系修改输入时,保留对应势函数文件、单位和原子样式设置。

再次运行前,将已有的同名 work-new 条件目录改名保存。

本次输出示例#

第一组原生热力学输出的开头如下,列名由该组输入的 thermo_style 设置。

   Step        Atoms         Temp          PotEng         TotEng        v_target       f_pid[1]       f_pid[2]       f_pid[3]   
         0         500   0.6           -6.7733682     -5.8751682      0.6           -0             -0             -0            
        20         500   0.24219395    -6.250627      -5.8880626      0.64836921     0.047890303    0.00047890303 -0            
        40         500   0.34195277    -6.2971951     -5.7852918      0.69217949     0.042902362    0.00090792664 -0            
需要根据你的体系选择资源?联系讨论计算需求。实际可用软件与权限,以当前账户和运行环境为准。

查看配图

放大后可滚动查看细节,按 Esc 关闭。

100%查看原图 ↗