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


Python structure_analyzer.RelaxationAnalyzer類代碼示例

本文整理匯總了Python中pymatgen.analysis.structure_analyzer.RelaxationAnalyzer的典型用法代碼示例。如果您正苦於以下問題:Python RelaxationAnalyzer類的具體用法?Python RelaxationAnalyzer怎麽用?Python RelaxationAnalyzer使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了RelaxationAnalyzer類的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: RelaxationAnalyzerTest

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,代碼行數:25,代碼來源:test_structure_analyzer.py

示例2: get_percentage_bond_distance_change

    def get_percentage_bond_distance_change(self, n):
        """
        Bond distance 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_bond_dist_changes()
開發者ID:zeroelement,項目名稱:pymatgen,代碼行數:11,代碼來源:point_defects.py

示例3: get_percentage_lattice_parameter_change

    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,代碼行數:11,代碼來源:point_defects.py

示例4: get_percentage_volume_change

    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,代碼行數:11,代碼來源:point_defects.py

示例5: setUp

 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)
開發者ID:setten,項目名稱:pymatgen,代碼行數:8,代碼來源:test_structure_analyzer.py


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