avc.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:order 作者: ipudu 项目源码 文件源码
def asphericity(self, freq = 1):
        """compute asphericity of the Voronoi cell"""
        #progress bar
        frames = int(self.traj.n_frames / freq)
        bar = ChargingBar('Processing', max=frames, 
        suffix='%(percent).1f%% - %(eta)ds')

        for i in range(0, self.traj.n_frames, freq):
            for j in range(self.traj.n_atoms):
                if self.traj.atom_names[i][j] == self.center:
                    #center coordinate
                    c = self.traj.coords[i][j]

                    #coordinates
                    cs = self.traj.coords[i]

                    #box_size
                    L = self.traj.box_size[i]

                    #new coordinates after wrapping
                    nc = self.wrap_box(c, cs, L)
                    points = self.polyhedron(nc, j, L)
                    e = self.compute_vc(points)
                    self.raw.append(e)
            bar.next()
        bar.finish()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号