def setUpClass(cls): cls.canonical = StructureStorage() cls.grandcanonical = StructureStorage() bulk = StructureFactory().bulk("Fe") for n in range(3): bulk.positions += np.random.normal(scale=.1, size=bulk.positions.shape) cls.canonical.add_structure(bulk) cls.grandcanonical.add_structure(bulk.repeat((n + 1, 1, 1)))
def test_tessellations(self): bulk = StructureFactory().ase.bulk('Fe', cubic=True) a_0 = bulk.cell[0, 0] structure = bulk.repeat(3) self.assertAlmostEqual( np.linalg.norm(structure.find_mic( np.diff(structure.positions[ structure.analyse.get_delaunay_neighbors()], axis=-2)), axis=-1).flatten().max(), a_0) self.assertAlmostEqual( np.linalg.norm(structure.find_mic( np.diff(structure.positions[ structure.analyse.get_voronoi_neighbors()], axis=-2)), axis=-1).flatten().max(), a_0)