Packmol几何约束:盒体、空腔与薄层
18组实际装箱输入,逐原子检查几何范围、刚性分子与最短距离。
阅读本篇目录
下载18组完整输入、输出、检查和绘图脚本。解压后进入packmol-constraints子目录。
先运行,再看坐标#
本组使用Packmol 21.2.3,GFortran 13.3串行构建;ASE 3.29.0生成水/甲醇模板并独立检查输出。在分配的一个CPU核上可运行:
bash run.sh
只运行其中一个例子时,进入该目录后执行:
module purge
module load packmol/21.2.3
packmol < packmol.inp > packmol.log
head -n 8 packed.xyz
Packmol只摆放已有刚性分子,不生成力场、拓扑或平衡态。完成装箱后还需要为MD准备参数、能量最小化和适当平衡,参见接GROMACS的完整水盒流程。
下面的输入均已实际运行。tolerance 2.0约束不同分子之间的原子距离,不会把同一水分子内部O–H键拉成2 Å。几何约束通常作用于所有被选择原子,不仅是分子质心。语法分类可查Packmol官方指南,本页数值和图来自配套算例。
立方体内部#
目录:inside-cube。原子数60,实测不同分子最短距离2.202278 Å。
tolerance 2.0
filetype xyz
output packed.xyz
seed 27129
nloop 300
precision 0.000001
structure water.xyz
number 20
inside cube -8 -8 -8 16
end structure
排除立方体空腔#
目录:outside-cube。原子数60,实测不同分子最短距离2.026511 Å。
tolerance 2.0
filetype xyz
output packed.xyz
seed 27129
nloop 300
precision 0.000001
structure water.xyz
number 20
inside box -10 -10 -10 10 10 10
outside cube -3 -3 -3 6
end structure
外部约束本身不提供有限边界,因此本例同时给定外层盒子。不要只写排除区域后期待得到有限大小的装箱。
长方体内部#
目录:inside-box。原子数60,实测不同分子最短距离2.202128 Å。
tolerance 2.0
filetype xyz
output packed.xyz
seed 27129
nloop 300
precision 0.000001
structure water.xyz
number 20
inside box -8 -6 -4 8 6 4
end structure
排除长方体空腔#
目录:outside-box。原子数60,实测不同分子最短距离2.276927 Å。
tolerance 2.0
filetype xyz
output packed.xyz
seed 27129
nloop 300
precision 0.000001
structure water.xyz
number 20
inside box -10 -10 -10 10 10 10
outside box -3 -4 -5 3 4 5
end structure
外部约束本身不提供有限边界,因此本例同时给定外层盒子。不要只写排除区域后期待得到有限大小的装箱。
球内装箱#
目录:inside-sphere。原子数60,实测不同分子最短距离2.233418 Å。
tolerance 2.0
filetype xyz
output packed.xyz
seed 27129
nloop 300
precision 0.000001
structure water.xyz
number 20
inside sphere 0 0 0 8
end structure
排除球形空腔#
目录:outside-sphere。原子数60,实测不同分子最短距离2.203127 Å。
tolerance 2.0
filetype xyz
output packed.xyz
seed 27129
nloop 300
precision 0.000001
structure water.xyz
number 20
inside box -10 -10 -10 10 10 10
outside sphere 0 0 0 4
end structure
外部约束本身不提供有限边界,因此本例同时给定外层盒子。不要只写排除区域后期待得到有限大小的装箱。
椭球内装箱#
目录:inside-ellipsoid。原子数60,实测不同分子最短距离2.000001 Å。
tolerance 2.0
filetype xyz
output packed.xyz
seed 27129
nloop 300
precision 0.000001
structure water.xyz
number 20
inside ellipsoid 0 0 0 8 6 5 1
end structure
本例三个半轴为8、6、5 Å,最后的尺度参数为1;检查的是(x/8)²+(y/6)²+(z/5)²≤1。
排除椭球空腔#
目录:outside-ellipsoid。原子数60,实测不同分子最短距离2.201893 Å。
tolerance 2.0
filetype xyz
output packed.xyz
seed 27129
nloop 300
precision 0.000001
structure water.xyz
number 20
inside box -10 -10 -10 10 10 10
outside ellipsoid 0 0 0 3 4 5 1
end structure
外部约束本身不提供有限边界,因此本例同时给定外层盒子。不要只写排除区域后期待得到有限大小的装箱。
两平面之间的水薄层#
目录:plane-film。原子数60,实测不同分子最短距离2.200037 Å。
tolerance 2.0
filetype xyz
output packed.xyz
seed 27129
nloop 300
precision 0.000001
structure water.xyz
number 20
inside box -8 -8 -10 8 8 10
above plane 0 0 1 2
below plane 0 0 1 5
end structure
所有水原子被放在2≤z≤5 Å的薄层;这是初始水膜几何,不是已平衡界面或脂质膜模型。
实际结构投影#

图是x–z投影,隐藏的y坐标仍参与所有距离和约束检查;不能仅凭投影中两点接近就认定原子重叠。单例高清图、完整XYZ和原始日志均在下载包内。
检查自己的结果#
脚本在每个例子后检查分子数量、分子内部距离、分子间最短距离和相应几何不等式。重复运行会覆盖该例输出,请把自己修改的输入保存在另一个目录。Success!有参考价值,但仍应检查坐标和实际几何;增加分子数后可能因空间不足而无法满足要求。