本帖最后由 SherryLiu 于 2019-11-5 06:59 编辑
最近刚开始学习LAMMPS,遇到 Out of range atoms - cannot compute PPPM 问题时,不知道是什么原因,在网上也找不到有效的解决办法。一般的经验之谈是减小步长,和导师交流了一下,我导师也告诉我减小步长去算,结果就是治标不治本。 经过一天的试验摸索后,我得出结论:Out of range atoms 的错误根本在于分子在趋近平衡的运动过程中有分子重叠了,减小步长的结果就是在计算足够时间后还是会重叠,只不过步数变长了。 我尝试的解决办法是重新定义box size,具体看报错之前的box size或者Lx,y,z是多少,然后将体系的box size设置大概在那个范围内,然后重新run,就可以了。
以下是我的Debug过程:Lx,y,z设置为40时,减小步长还是会报错,大致报错前输出的Lx为25~左右,然后我设置Lx为20或30后,就没再报错。
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
补更,最近随着慢慢深入了解 LAMMPS 中的 Force Field 以及 LAMMPS in.file 的书写规则,发现其实出现上述问题是因为在 in.file 中设置 kspace_style pppm 这一项 (当然,其实错误提示中已经告诉了是这一项,但当时自己对 LAMMPS 的理解尚浅,不知道到底是哪错了)。
在 LAMMPS 手册中有写明 pair_style lj/cut/coul/long (既计算L-J势能又计算库仑力)跟 kspace_style ewald or pppm 配对使用,效果等同于 pair_style lj/cut/coul/cut,具体如下所述:Styles lj/cut/coul/long and lj/cut/coul/msm compute the same Coulombic interactions as style lj/cut/coul/cut except that an additional damping factor is applied to the Coulombic term so it can be used in conjunction with the kspace_style command and its ewald or pppmoption. The Coulombic cutoff specified for this style means that pairwise interactions within this distance are computed directly; interactions outside that distance are computed in reciprocal space.
所以在 Equilibrate stage 的 in.file 中 pair_style 设置为 lj/cut/coul/cut,而在 Production Run 阶段改为 pair_style lj/cut/coul/long + kspace_style pppm 0.0001。
附上我在 LAMMPS 中使用 OPLS-AA 力场的 in.file 脚本 (计算的力场参数来源于LigGenPar):
units real
boundary p p p
atom_style full
# interaction styles
bond_style harmonic
angle_style harmonic
dihedral_style opls
# improper_style cvff
pair_style lj/cut/coul/cut 15.0
pair_modify mix geometric tail yes
# OPLS considers 1-4 interactions with 50%.
special_bonds lj/coul 0.0 0.0 0.5
neighbor 2.0 bin
neigh_modify every 5 delay 0 check yes
# kspace_style pppm 0.0001
|