Beispiel #1
0
 def test_cog(self):
     """
     Test if reduced r & weights calculates centre of geometry accurately.
     """
     r = Gyration._get_reduced_r(cluster, None)
     weights = Gyration._get_weights(cluster, None)
     assert np.abs(np.sum(r * weights)) < 1e-7
Beispiel #2
0
 def test_com(self):
     """
     Test if reduced r & weights calculates centre of mass accurately.
     """
     weights = cluster.atoms.masses
     r = Gyration._get_reduced_r(cluster, weights)
     weights = Gyration._get_weights(cluster, weights)
     assert np.abs(np.sum(r * weights)) < 1e-7