本文整理汇总了Python中pymatgen.analysis.local_env.CrystalNN.get_bonded_structure方法的典型用法代码示例。如果您正苦于以下问题:Python CrystalNN.get_bonded_structure方法的具体用法?Python CrystalNN.get_bonded_structure怎么用?Python CrystalNN.get_bonded_structure使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pymatgen.analysis.local_env.CrystalNN
的用法示例。
在下文中一共展示了CrystalNN.get_bonded_structure方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_shifted_sites
# 需要导入模块: from pymatgen.analysis.local_env import CrystalNN [as 别名]
# 或者: from pymatgen.analysis.local_env.CrystalNN import get_bonded_structure [as 别名]
def test_shifted_sites(self):
cnn = CrystalNN()
sites = [[0., 0.2, 0.2], [0, 0, 0]]
struct = Structure([7, 0, 0, 0, 7, 0, 0, 0, 7], ['I'] * len(sites), sites)
bonded_struct = cnn.get_bonded_structure(struct)
sites_shifted = [[1., 0.2, 0.2], [0, 0, 0]]
struct_shifted = Structure([7, 0, 0, 0, 7, 0, 0, 0, 7], ['I'] * len(sites_shifted),
sites_shifted)
bonded_struct_shifted = cnn.get_bonded_structure(struct_shifted)
self.assertEqual(len(bonded_struct.get_connected_sites(0)),
len(bonded_struct_shifted.get_connected_sites(0)))
示例2: setUp
# 需要导入模块: from pymatgen.analysis.local_env import CrystalNN [as 别名]
# 或者: from pymatgen.analysis.local_env.CrystalNN import get_bonded_structure [as 别名]
def setUp(self):
cnn = CrystalNN()
self.lifepo = cnn.get_bonded_structure(self.get_structure('LiFePO4'))
self.graphite = cnn.get_bonded_structure(self.get_structure('Graphite'))
self.cscl = cnn.get_bonded_structure(self.get_structure('CsCl'))
tricky_structure = Structure(
[5.79, 0., 0., 0, 5.79, 0., 0., 0., 5.79],
['B', 'C', 'C', 'C', 'C', 'N', 'N', 'N', 'N', 'Ag'],
[[0.0, 0.0, 0.0], [0.842, 0.842, 0.842], [0.158, 0.842, 0.158],
[0.158, 0.158, 0.842], [0.842, 0.158, 0.158],
[0.726, 0.726, 0.726], [0.274, 0.726, 0.274],
[0.274, 0.274, 0.726], [0.726, 0.274, 0.274], [0.5, 0.5, 0.5]])
self.tricky_structure = cnn.get_bonded_structure(tricky_structure)
mol_structure = Structure(
[[-2.316, 2.316, 2.160], [2.316, -2.316, 2.160],
[2.316, 2.316, -2.160]],
['H', 'C', 'N'],
[[0.752, 0.752, 0.000], [0.004, 0.004, 0.], [0.272, 0.272, 0.]])
self.mol_structure = cnn.get_bonded_structure(mol_structure)