当前位置: 首页>>代码示例>>Python>>正文


Python RelaxationAnalyzer.get_percentage_lattice_parameter_changes方法代码示例

本文整理汇总了Python中pymatgen.analysis.structure_analyzer.RelaxationAnalyzer.get_percentage_lattice_parameter_changes方法的典型用法代码示例。如果您正苦于以下问题:Python RelaxationAnalyzer.get_percentage_lattice_parameter_changes方法的具体用法?Python RelaxationAnalyzer.get_percentage_lattice_parameter_changes怎么用?Python RelaxationAnalyzer.get_percentage_lattice_parameter_changes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pymatgen.analysis.structure_analyzer.RelaxationAnalyzer的用法示例。


在下文中一共展示了RelaxationAnalyzer.get_percentage_lattice_parameter_changes方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: RelaxationAnalyzerTest

# 需要导入模块: from pymatgen.analysis.structure_analyzer import RelaxationAnalyzer [as 别名]
# 或者: from pymatgen.analysis.structure_analyzer.RelaxationAnalyzer import get_percentage_lattice_parameter_changes [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)
开发者ID:setten,项目名称:pymatgen,代码行数:27,代码来源:test_structure_analyzer.py

示例2: get_percentage_lattice_parameter_change

# 需要导入模块: from pymatgen.analysis.structure_analyzer import RelaxationAnalyzer [as 别名]
# 或者: from pymatgen.analysis.structure_analyzer.RelaxationAnalyzer import get_percentage_lattice_parameter_changes [as 别名]
    def get_percentage_lattice_parameter_change(self, n):
        """
        Lattice parameter change after the introduction of interstitial

        Args:
            n: index of interstitials
        """
        def_struct = self._structs[n:n + 1][0]  # copy
        def_struct.remove(-1)
        rv = RelaxationAnalyzer(self._blk_struct, def_struct)
        return rv.get_percentage_lattice_parameter_changes()
开发者ID:zeroelement,项目名称:pymatgen,代码行数:13,代码来源:point_defects.py


注:本文中的pymatgen.analysis.structure_analyzer.RelaxationAnalyzer.get_percentage_lattice_parameter_changes方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。