LAMMPS 专题

LAMMPS 旋转积分器操作

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

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

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

选择条件#

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

条件目录 主要样式 运行模式
corrected-tri-p100-tri-independent-particle-CPU pair_style tri/lj, fix nve/tri, compute erotate/asphere, compute property/atom, dump custom gpu
corrected-tri-v100-tri-independent-particle-OMP pair_style tri/lj/omp, fix nve/tri, compute erotate/asphere, compute property/atom, dump custom gpu
v100-line-independent-particle-OMP pair_style line/lj/omp, fix nve/line, fix enforce2d, compute erotate/asphere, compute property/atom, dump custom gpu
p100-DNA-DOTC-Langevin bond_style oxdna/fene, pair_style hybrid/overlay, fix nve/dotc/langevin, fix balance, compute property/atom, compute erotate/asphere, compute ke, compute pe, fix print, dump custom gpu
p100-DNA-DOT-Hamiltonian bond_style oxdna/fene, pair_style hybrid/overlay, fix nve/dot, fix balance, compute property/atom, compute erotate/asphere, compute ke, compute pe, fix print, dump custom gpu
p100-line-independent-particle-CPU pair_style line/lj, fix nve/line, fix enforce2d, compute erotate/asphere, compute property/atom, dump custom gpu

输入与提交#

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

units lj
dimension 3
atom_style tri
read_data particles.data
pair_style tri/lj 3.5
pair_coeff * * .1 1.0
neighbor .3 bin
neigh_modify delay 0 every 1 check yes
velocity all create .1 543876 mom yes rot yes dist gaussian
fix int all nve/tri
compute rotation all erotate/asphere
compute vertices all property/atom corner1x corner1y corner1z corner2x corner2y corner2z corner3x corner3y corner3z
variable total equal pe+ke+c_rotation
thermo 100
thermo_style custom step atoms temp pe ke c_rotation v_total
thermo_modify norm no format float %.16e
dump history all custom 100 shape-history.dump id type x y z vx vy vz c_vertices[*]
dump_modify history sort id first yes format float %.16e
timestep .001
run 1000
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/corrected-tri-p100-tri-independent-particle-CPU
tail -n 35 native.out

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

Loop time of 0.0544699 on 1 procs for 1000 steps with 27 atoms
Total wall time: 0:00:00

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

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

本次输出示例#

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

   Step        Atoms         Temp          PotEng         KinEng       c_rotation      v_total    
         0          27  9.9999999999999992e-02 -1.5046418424687716e-01 3.8999999999999995e+00 3.8649968517249680e+00 7.6145326674780902e+00
       100          27  1.0003137458550998e-01 -1.5147469474938136e-01 3.9012236088348891e+00 3.8647550755759843e+00 7.6145039896614914e+00
       200          27  1.0013287855103817e-01 -1.5566185251811415e-01 3.9051822634904885e+00 3.8644143769046972e+00 7.6139347878770716e+00
需要根据你的体系选择资源?联系讨论计算需求。实际可用软件与权限,以当前账户和运行环境为准。

查看配图

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

100%查看原图 ↗