计算化学公社

 找回密码 Forget password
 注册 Register
Views: 306|回复 Reply: 0
打印 Print 上一主题 Last thread 下一主题 Next thread

[程序/脚本开发] 关于MDAnalysis里计算原子位置时的周期性处理

[复制链接 Copy URL]

49

帖子

0

威望

760

eV
积分
809

Level 4 (黑子)


请问一下各位老师,我看文献里有这样的描述: αij is the position of particle α relative to the center-ofmass position of the entire system
所以我在用MDAnalysis里提取原子的位置时候想这样处理
time = 0
anion_positions = np.zeros((len(times)+1, len(anions), 3))
cation_positions = np.zeros((len(times)+1, len(cations), 3))
for ts in run.trajectory[int(run_start/dt_collection):]:
    anion_positions[time, :, :] = anions.positions - run.atoms.center_of_mass(wrap = True, compound = 'group')
    cation_positions[time, :, :] = cations.positions - run.atoms.center_of_mass(wrap = True, compound = 'group')
    time += 1
结果发现当我计算质心的时候如果选择unwrap = True 就会出现AtomGroup was not contiguous from bonds, process failed的错误,选择wrap = True就能编译通过,是不是说明我在处理轨迹的时候PBC没有处理好,导致我分子是碎裂了,所以只能通过wrap的方式

202412101427376294..png (24.18 KB, 下载次数 Times of downloads: 19)

202412101427376294..png

本版积分规则 Credits rule

手机版 Mobile version|北京科音自然科学研究中心 Beijing Kein Research Center for Natural Sciences|京公网安备 11010502035419号|计算化学公社 — 北京科音旗下高水平计算化学交流论坛 ( 京ICP备14038949号-1 )|网站地图

GMT+8, 2025-8-13 05:48 , Processed in 0.162926 second(s), 24 queries , Gzip On.

快速回复 返回顶部 返回列表 Return to list