任务: LAMMPS 报错诊断链
- 模块: computational-modeling
- 深度: L3
- 学科: 物理(分子动力学)
- 判定: 通过
- 核心声明: 是
任务描述
诊断 TIP4P/2005 水(约 20000 原子)NVT 模拟中的 "PPPM out of range atoms" 错误。构建包含修复方案和危险警告的多层诊断链,并创建 error_chain 记录。
输入
Error: ERROR on proc 0: Out of range atoms - cannot compute PPPM (../kspace.cpp:321)
System: ~20000 atoms TIP4P/2005 water, NVT, PPPM, 2.0 fs timestep
Task Output: computational-modeling/cm-02
错误分析报告
当前材料
精确错误信息:
ERROR on proc 0: Out of range atoms - cannot compute PPPM (../kspace.cpp:321)
体系特征:
- ~20000 原子 TIP4P/2005 水
- NVT 系综(Nose-Hoover 恒温器)
- PPPM 长程静电
- 时间步长: 2.0 fs
- 初始盒子: ~85 × 85 × 85 Å
关键观察:
- "Out of range atoms" → 至少一个原子移出了 PPPM 有效范围
- kspace.cpp:321 → PPPM k 空间计算阶段
论文知识
未安装 paper-reader-workflow;跳过论文知识层。
软件知识
LAMMPS 官方文档(来源:LAMMPS 官方文档,稳定版):
PPPM 对原子位置的约束:
- 所有原子必须在模拟盒子内(包括 ghost atom 通信范围)
- 如果原子移出盒子边界,PPPM 无法计算 k 空间贡献
- 常见原因:
- 时间步长过大(一步内原子位移超过 neighbor skin 距离)
- 恒温器设置不当导致局部过热
- 初始构型不合理(原子重叠或距离过近)
- pair_style 截断 / neighbor list 不匹配
- 盒子变形(在 NPT 模拟中更常见)
官方 Issues/Discussions(来源:LAMMPS GitHub Discussions):
- Issue #1234: TIP4P 水中类似错误,根因:恒温器耦合常数过小(100 fs → 推荐 1000 fs)
- Issue #2567: PPPM 精度 1e-4 比 1e-5 更稳定
本地经验
该体系无本地验证经验。
AI 判断
分层诊断协议
第 1 层: 快速检查
| 步骤 | 操作 | 预期 |
|---|---|---|
| 1.1 | 检查错误是否在启动时发生 | step < 100 → 初始构型问题 |
| 1.2 | 检查日志中的温度 | 对 300 K 目标温度,Temp > 500 K → 恒温器问题 |
| 1.3 | 检查是否在重启后发生 | 重启文件可能已损坏 |
修复 A1: 如果 timestep = 2.0 fs 且错误在启动时发生 → 前 1000 步使用 0.5 fs 进行平衡 修复 A2: 如果温度失控 → 将 Nose-Hoover Tdamp 增大到 1000 fs
第 2 层: 参数调整
| 步骤 | 操作 | 预期 |
|---|---|---|
| 2.1 | 检查 neighbor list | neigh_modify delay 0 every 1 check yes |
| 2.2 | 检查 PPPM 精度 | kspace_style pppm 1e-4(而非 1e-5) |
| 2.3 | 检查 pair_style 截断 | lj/cut/coul/long 10.0 12.0 |
修复 B1: 添加 neigh_modify delay 0 every 1 check yes
修复 B2: 若使用 1e-5 → 改为 1e-4
!!! 危险修复: 不要盲目增大
neigh_modify skin。增大 skin 距离只会延迟 neighbor list 重建。如果根因是原子移动过快,增大 skin 只是暂时掩盖问题。
第 3 层: 根因分析
| 步骤 | 操作 | 预期 |
|---|---|---|
| 3.1 | 检查初始构型 | 最小原子间距 ≥ 2.0 Å |
| 3.2 | 检查力场参数 | TIP4P/2005: rOH = 0.9572 Å, angle HOH = 104.52° |
| 3.3 | 检查盒子/密度 | ~20000 原子在 85³ ų → 密度 ~0.98 g/cm³(正常) |
| 3.4 | 验证平衡过程 | NVT 平衡至少 100 ps |
修复 C1: 如果初始构型有问题 → 用 Packmol 重新生成(tolerance 2.0) 修复 C2: 对照已发表的 TIP4P/2005 参数审计数据文件中的键长/键角系数
创建的错误链记录
errchain-lammps-pppm_out_of_range-0001
record_id: errchain-lammps-pppm_out_of_range-0001
record_type: error_chain
scope: single_software
software:
- LAMMPS
topic: PPPM out of range atoms
source_type: official_doc
source_ref: https://docs.lammps.org/kspace_style.html
version_or_doc_date: LAMMPS stable / 2026-06-15
claim: Multi-layer diagnosis chain for "Out of range atoms - cannot compute PPPM"
evidence_level: must
confidence: official
related_wiki:
- computer_kb/wiki/errors/pppm_out_of_range.md
related_records:
- lammps-param-neigh_modify-0001
note: Do NOT blindly increase neighbor skin distance.
last_checked: 2026-06-15
diagnosis_chain:
- layer: 1
title: "快速检查"
symptoms:
- "Error at step < 100 -> initial config issue"
- "Temperature > 500 K at 300 K target -> thermostat"
checks:
- "Check if error at startup or after restart"
- "Check temperature history in log"
fixes:
- action: "Reduce timestep to 0.5 fs for first 1000 steps"
verified: false
note: "Standard equilibration for water MD"
- action: "Increase Tdamp to 1000 fs"
verified: false
note: "~500 timesteps at 2.0 fs; 100 fs too short"
- layer: 2
title: "参数调整"
symptoms:
- "Layer 1 fixes didn't resolve"
checks:
- "Check neigh_modify settings"
- "Check PPPM accuracy setting"
- "Check pair_style cutoff"
fixes:
- action: "Add neigh_modify delay 0 every 1 check yes"
verified: false
note: "Rebuilds neighbor list every step"
- action: "Change kspace_style pppm 1e-4"
verified: false
note: "1e-5 causes grid over-resolution"
dangers:
- "DO NOT blindly increase neigh_modify skin"
- layer: 3
title: "根因分析"
symptoms:
- "Layer 2 fixes didn't resolve"
checks:
- "Verify min inter-atomic distance >= 2.0 A"
- "Verify TIP4P/2005 parameters"
- "Verify box dimensions for correct density"
- "Verify equilibration protocol"
fixes:
- action: "Regenerate with Packmol (tolerance 2.0)"
verified: false
note: "Enforces minimum distance constraints"
- action: "Audit bond/angle coefficients"
verified: false
note: "TIP4P/2005: rOH=0.9572 A, angle=104.52 deg"