本文整理汇总了Python中pymatgen.analysis.structure_analyzer.RelaxationAnalyzer.get_percentage_volume_change方法的典型用法代码示例。如果您正苦于以下问题:Python RelaxationAnalyzer.get_percentage_volume_change方法的具体用法?Python RelaxationAnalyzer.get_percentage_volume_change怎么用?Python RelaxationAnalyzer.get_percentage_volume_change使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pymatgen.analysis.structure_analyzer.RelaxationAnalyzer
的用法示例。
在下文中一共展示了RelaxationAnalyzer.get_percentage_volume_change方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: RelaxationAnalyzerTest
# 需要导入模块: from pymatgen.analysis.structure_analyzer import RelaxationAnalyzer [as 别名]
# 或者: from pymatgen.analysis.structure_analyzer.RelaxationAnalyzer import get_percentage_volume_change [as 别名]
class RelaxationAnalyzerTest(unittest.TestCase):
def setUp(self):
p = Poscar.from_file(os.path.join(test_dir, 'POSCAR.Li2O'),
check_for_POTCAR=False)
s1 = p.structure
p = Poscar.from_file(os.path.join(test_dir, 'CONTCAR.Li2O'),
check_for_POTCAR=False)
s2 = p.structure
self.analyzer = RelaxationAnalyzer(s1, s2)
def test_vol_and_para_changes(self):
for k, v in self.analyzer.get_percentage_lattice_parameter_changes().items():
self.assertAlmostEqual(-0.0092040921155279731, v)
latt_change = v
vol_change = self.analyzer.get_percentage_volume_change()
self.assertAlmostEqual(-0.0273589101391,
vol_change)
# This is a simple cubic cell, so the latt and vol change are simply
# Related. So let's test that.
self.assertAlmostEqual((1 + latt_change) ** 3 - 1, vol_change)
def test_get_percentage_bond_dist_changes(self):
for k, v in self.analyzer.get_percentage_bond_dist_changes().items():
for k2, v2 in v.items():
self.assertAlmostEqual(-0.009204092115527862, v2)
示例2: get_percentage_volume_change
# 需要导入模块: from pymatgen.analysis.structure_analyzer import RelaxationAnalyzer [as 别名]
# 或者: from pymatgen.analysis.structure_analyzer.RelaxationAnalyzer import get_percentage_volume_change [as 别名]
def get_percentage_volume_change(self, n):
"""
Volume change after the introduction of interstitial
Args:
n: index of interstitials
"""
def_struct = self._structs[n:n + 1][0]
def_struct.remove(-1)
rv = RelaxationAnalyzer(self._blk_struct, def_struct)
return rv.get_percentage_volume_change()