本文整理匯總了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)