liuyuje714 发表于 2020-11-15 23:13
dr自己设定,比如gmx默认用的0.002 nm。其实我觉得楼主如果考虑自己写程序,单单看公式不一定能明白其含义 ...
少年爱吃地三鲜 发表于 2020-11-16 08:05
好的,感谢您的建议! 请问gromacs的源代码在哪里能看呢?MDAnalysis的我能找到 gromacs的手册里有吗?谢 ...
liuyuje714 发表于 2020-11-16 09:18
github上都有相关的源,直接就可以找到。看手册那是给用软件的人,而你写程序,当然必须看源代码,gromac ...
if periodic:
p_vectors = list()
for xmulti in (0, -1, 1):
for ymulti in (0, -1, 1):
for zmulti in (0, -1, 1):
p_vector = np.array([xmulti * self.xlength, ymulti * self.ylength, zmulti * self.zlength])
p_vectors.append(p_vector)
for ref in self.atomtypedict[str(refatomtype)]:
for target in self.atomtypedict[str(targetatomtype)]:
r_ref = np.array(self.atomdict[ref][3:6])
r_target = np.array(self.atomdict[target][3:6])
for p_vector in p_vectors:
dist = np.linalg.norm(r_ref - r_target - p_vector)
for r in self.pcf.keys():
if dist > r and dist < r + dr:
self.pcf[r] += 1
Graphite 发表于 2020-11-16 11:45
可以算每个原子对距离的同时进行计数。
我写的RDF代码(python)的其中一段,self.pcf是个字典,键是距离r ...
| 欢迎光临 计算化学公社 (http://bbs.keinsci.com/) | Powered by Discuz! X3.3 |