當前位置: 首頁>>代碼示例>>Python>>正文


Python RelaxationAnalyzer.get_percentage_volume_change方法代碼示例

本文整理匯總了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)
開發者ID:setten,項目名稱:pymatgen,代碼行數:27,代碼來源:test_structure_analyzer.py

示例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()
開發者ID:zeroelement,項目名稱:pymatgen,代碼行數:13,代碼來源:point_defects.py


注:本文中的pymatgen.analysis.structure_analyzer.RelaxationAnalyzer.get_percentage_volume_change方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。