• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python outputs.Outcar类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中pymatgen.io.vasp.outputs.Outcar的典型用法代码示例。如果您正苦于以下问题:Python Outcar类的具体用法?Python Outcar怎么用?Python Outcar使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



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

示例1: test_single_atom

    def test_single_atom(self):
        filepath = os.path.join(test_dir, "OUTCAR.Al")
        outcar = Outcar(filepath)
        expected_mag = ({"p": 0.0, "s": 0.0, "d": 0.0, "tot": 0.0},)
        expected_chg = ({"p": 0.343, "s": 0.425, "d": 0.0, "tot": 0.768},)

        self.assertAlmostEqual(outcar.magnetization, expected_mag)
        self.assertAlmostEqual(outcar.charge, expected_chg)
        self.assertFalse(outcar.is_stopped)
        self.assertEqual(
            outcar.run_stats,
            {
                "System time (sec)": 0.592,
                "Total CPU time used (sec)": 50.194,
                "Elapsed time (sec)": 52.337,
                "Maximum memory used (kb)": 62900.0,
                "Average memory used (kb)": 0.0,
                "User time (sec)": 49.602,
                "cores": "32",
            },
        )
        self.assertAlmostEqual(outcar.efermi, 8.0942)
        self.assertAlmostEqual(outcar.nelect, 3)
        self.assertAlmostEqual(outcar.total_mag, 8.2e-06)

        self.assertIsNotNone(outcar.as_dict())
开发者ID:shyamd,项目名称:pymatgen,代码行数:26,代码来源:test_outputs.py


示例2: test_read_fermi_contact_shift

 def test_read_fermi_contact_shift(self):
     filepath = os.path.join(test_dir, "OUTCAR_fc")
     outcar = Outcar(filepath)
     outcar.read_fermi_contact_shift()
     self.assertAlmostEqual(outcar.data["fermi_contact_shift"][u'fch'][0][0], -0.002)
     self.assertAlmostEqual(outcar.data["fermi_contact_shift"][u'th'][0][0], -0.052)
     self.assertAlmostEqual(outcar.data["fermi_contact_shift"][u'dh'][0][0], 0.0)
开发者ID:setten,项目名称:pymatgen,代码行数:7,代码来源:test_outputs.py


示例3: test_read_piezo_tensor

    def test_read_piezo_tensor(self):
        filepath = os.path.join(test_dir, "OUTCAR.lepsilon.gz")
        outcar = Outcar(filepath)

        outcar.read_piezo_tensor()
        self.assertAlmostEqual(outcar.data["piezo_tensor"][0][0], 0.52799)
        self.assertAlmostEqual(outcar.data["piezo_tensor"][1][3], 0.35998)
        self.assertAlmostEqual(outcar.data["piezo_tensor"][2][5], 0.35997)
开发者ID:adozier,项目名称:pymatgen,代码行数:8,代码来源:test_outputs.py


示例4: test_cs_core_contribution

 def test_cs_core_contribution(self):
     filename = os.path.join(test_dir, "nmr", "cs", "core.diff",
                             "core.diff.chemical.shifts.OUTCAR")
     outcar = Outcar(filename)
     core_contrib = outcar.read_cs_core_contribution()
     self.assertEqual(core_contrib,
                      {'Mg': -412.8248405,
                       'C': -200.5098812,
                       'O': -271.0766979})
开发者ID:bocklund,项目名称:pymatgen,代码行数:9,代码来源:test_outputs.py


示例5: test_cs_g0_contribution

 def test_cs_g0_contribution(self):
     filename = os.path.join(test_dir, "nmr", "cs", "core.diff",
                             "core.diff.chemical.shifts.OUTCAR")
     outcar = Outcar(filename)
     g0_contrib = outcar.read_cs_g0_contribution()
     self.assertEqual(g0_contrib,
                      [[-8.773535, 9e-06, 1e-06],
                       [1.7e-05, -8.773536, -0.0792],
                       [-6e-06, -0.008328, -9.320237]])
开发者ID:bocklund,项目名称:pymatgen,代码行数:9,代码来源:test_outputs.py


示例6: test_freq_dielectric

 def test_freq_dielectric(self):
     filepath = os.path.join(test_dir, "OUTCAR.LOPTICS")
     outcar = Outcar(filepath)
     outcar.read_freq_dielectric()
     self.assertAlmostEqual(outcar.frequencies[0], 0)
     self.assertAlmostEqual(outcar.frequencies[-1], 39.826101)
     self.assertAlmostEqual(outcar.dielectric_tensor_function[0][0, 0], 8.96938800)
     self.assertAlmostEqual(outcar.dielectric_tensor_function[-1][0, 0], 7.36167000e-01 +1.53800000e-03j)
     self.assertEqual(len(outcar.frequencies), len(outcar.dielectric_tensor_function))
开发者ID:zulissi,项目名称:pymatgen,代码行数:9,代码来源:test_outputs.py


示例7: test_read_elastic_tensor

    def test_read_elastic_tensor(self):
        filepath = os.path.join(test_dir, "OUTCAR.total_tensor.Li2O.gz")
        outcar = Outcar(filepath)

        outcar.read_elastic_tensor()

        self.assertAlmostEqual(outcar.data["elastic_tensor"][0][0], 1986.3391)
        self.assertAlmostEqual(outcar.data["elastic_tensor"][0][1], 187.8324)
        self.assertAlmostEqual(outcar.data["elastic_tensor"][3][3], 586.3034)
开发者ID:adozier,项目名称:pymatgen,代码行数:9,代码来源:test_outputs.py


示例8: test_freq_dielectric_vasp544

 def test_freq_dielectric_vasp544(self):
     filepath = os.path.join(test_dir, "OUTCAR.LOPTICS.vasp544")
     outcar = Outcar(filepath)
     outcar.read_freq_dielectric()
     self.assertAlmostEqual(outcar.frequencies[0], 0)
     self.assertAlmostEqual(outcar.frequencies[-1], 39.63964)
     self.assertAlmostEqual(outcar.dielectric_tensor_function[0][0, 0], 12.769435+0j)
     self.assertAlmostEqual(outcar.dielectric_tensor_function[-1][0, 0], 0.828615+0.016594j)
     self.assertEqual(len(outcar.frequencies), len(outcar.dielectric_tensor_function))
     np.testing.assert_array_equal( outcar.dielectric_tensor_function[0], outcar.dielectric_tensor_function[0].transpose())
开发者ID:bocklund,项目名称:pymatgen,代码行数:10,代码来源:test_outputs.py


示例9: test_chemical_shifts_with_different_core_contribution

 def test_chemical_shifts_with_different_core_contribution(self):
     filename = os.path.join(test_dir, "nmr", "cs", "core.diff", "core.diff.chemical.shifts.OUTCAR")
     outcar = Outcar(filename)
     outcar.read_chemical_shifts()
     c_vo = outcar.data["chemical_shifts"]["valence_only"][7].maryland_values
     for x1, x2 in zip(list(c_vo), [198.7009, 73.7484, 1.0000]):
         self.assertAlmostEqual(x1, x2)
     c_vc = outcar.data["chemical_shifts"]["valence_and_core"][7].maryland_values
     for x1, x2 in zip(list(c_vc), [-1.9406, 73.7484, 1.0000]):
         self.assertAlmostEqual(x1, x2)
开发者ID:shyamd,项目名称:pymatgen,代码行数:10,代码来源:test_outputs.py


示例10: test_cs_raw_tensors

 def test_cs_raw_tensors(self):
     filename = os.path.join(test_dir, "nmr", "cs", "core.diff",
                             "core.diff.chemical.shifts.OUTCAR")
     outcar = Outcar(filename)
     unsym_tensors = outcar.read_cs_raw_symmetrized_tensors()
     self.assertEqual(unsym_tensors[0],
                      [[-145.814605, -4.263425, 0.000301],
                       [4.263434, -145.812238, -8.7e-05],
                       [0.000136, -0.000189, -142.794068]])
     self.assertEqual(unsym_tensors[29],
                      [[287.789318, -53.799325, 30.900024],
                       [-53.799571, 225.668117, -17.839598],
                       [3.801103, -2.195218, 88.896756]])
开发者ID:bocklund,项目名称:pymatgen,代码行数:13,代码来源:test_outputs.py


示例11: test_nmr_efg

 def test_nmr_efg(self):
     filename = os.path.join(test_dir, "nmr", "efg", "AlPO4", "OUTCAR")
     outcar = Outcar(filename)
     outcar.read_nmr_efg()
     expected_efg = [{'eta': 0.465, 'nuclear_quadrupole_moment': 146.6, 'cq': -5.573},
                     {'eta': 0.465, 'nuclear_quadrupole_moment': 146.6, 'cq': -5.573},
                     {'eta': 0.137, 'nuclear_quadrupole_moment': 146.6, 'cq': 6.327},
                     {'eta': 0.137, 'nuclear_quadrupole_moment': 146.6, 'cq': 6.327},
                     {'eta': 0.112, 'nuclear_quadrupole_moment': 146.6, 'cq': -7.453},
                     {'eta': 0.112, 'nuclear_quadrupole_moment': 146.6, 'cq': -7.453},
                     {'eta': 0.42, 'nuclear_quadrupole_moment': 146.6, 'cq': -5.58},
                     {'eta': 0.42, 'nuclear_quadrupole_moment': 146.6, 'cq': -5.58}]
     self.assertEqual(len(outcar.data["efg"][2:10]), len(expected_efg))
     for e1, e2 in zip(outcar.data["efg"][2:10], expected_efg):
         for k in e1.keys():
             self.assertAlmostEqual(e1[k], e2[k], places=5)
开发者ID:adozier,项目名称:pymatgen,代码行数:16,代码来源:test_outputs.py


示例12: test_chemical_shifts

 def test_chemical_shifts(self):
     filename = os.path.join(test_dir, "nmr_chemical_shift", "hydromagnesite", "OUTCAR")
     outcar = Outcar(filename)
     expected_chemical_shifts = [[191.9974, 69.5232, 0.6342],
                                 [195.0808, 68.183, 0.833],
                                 [192.0389, 69.5762, 0.6329],
                                 [195.0844, 68.1756, 0.8336],
                                 [192.005, 69.5289, 0.6339],
                                 [195.0913, 68.1859, 0.833],
                                 [192.0237, 69.565, 0.6333],
                                 [195.0788, 68.1733, 0.8337]]
     self.assertAlmostEqual(len(outcar.chemical_shifts[20: 28]), len(expected_chemical_shifts))
     for c1, c2 in zip(outcar.chemical_shifts[20: 28], expected_chemical_shifts):
         for x1, x2 in zip(list(c1.maryland_values), c2):
             self.assertAlmostEqual(x1, x2, places=5)
     d1 = outcar.as_dict()
     self.assertIn("chemical_shifts", d1)
开发者ID:Rongpeng,项目名称:pymatgen,代码行数:17,代码来源:test_outputs.py


示例13: forces_from_outcar

def forces_from_outcar( filename='OUTCAR' ):
    """Finds and returns forces from the OUTCAR file.
      
    Args:
        filename (:obj:'str', optional): the name of the ``OUTCAR`` file to be read. Default is `OUTCAR`.

    Returns:
        (np.array): The force as found in the ``OUTCAR`` file, as a NSTEPS x NIONS x 3 numpy array.

    """
    outcar = Outcar("OUTCAR")
    forces = outcar.read_table_pattern(
        header_pattern=r"\sPOSITION\s+TOTAL-FORCE \(eV/Angst\)\n\s-+",
        row_pattern=r"\s+[+-]?\d+\.\d+\s+[+-]?\d+\.\d+\s+[+-]?\d+\.\d+\s+([+-]?\d+\.\d+)\s+([+-]?\d+\.\d+)\s+([+-]?\d+\.\d+)",
        footer_pattern=r"\s--+",
        postprocess=lambda x: float(x),
        last_one_only=False
    )
    return np.array( forces )
开发者ID:bjmorgan,项目名称:vasppy,代码行数:19,代码来源:outcar.py


示例14: test_single_atom

    def test_single_atom(self):
        filepath = os.path.join(test_dir, "OUTCAR.Al")
        outcar = Outcar(filepath)
        expected_mag = ({u'p': 0.0, u's': 0.0, u'd': 0.0, u'tot': 0.0},)
        expected_chg = ({u'p': 0.343, u's': 0.425, u'd': 0.0, u'tot': 0.768},)

        self.assertAlmostEqual(outcar.magnetization, expected_mag)
        self.assertAlmostEqual(outcar.charge, expected_chg)
        self.assertFalse(outcar.is_stopped)
        self.assertEqual(outcar.run_stats, {'System time (sec)': 0.592,
                                            'Total CPU time used (sec)': 50.194,
                                            'Elapsed time (sec)': 52.337,
                                            'Maximum memory used (kb)': 62900.0,
                                            'Average memory used (kb)': 0.0,
                                            'User time (sec)': 49.602,
                                            'cores': '32'})
        self.assertAlmostEqual(outcar.efermi, 8.0942)
        self.assertAlmostEqual(outcar.nelect, 3)
        self.assertAlmostEqual(outcar.total_mag, 8.2e-06)

        self.assertIsNotNone(outcar.as_dict())
开发者ID:adozier,项目名称:pymatgen,代码行数:21,代码来源:test_outputs.py


示例15: test_dielectric

 def test_dielectric(self):
     filepath = os.path.join(test_dir, "OUTCAR.dielectric")
     outcar = Outcar(filepath)
     outcar.read_corrections()
     self.assertAlmostEqual(outcar.data["dipol_quadrupol_correction"], 0.03565)
     self.assertAlmostEqual(outcar.final_energy, -797.46760559)
开发者ID:adozier,项目名称:pymatgen,代码行数:6,代码来源:test_outputs.py


示例16: test_init

    def test_init(self):
        for f in ['OUTCAR', 'OUTCAR.gz']:
            filepath = os.path.join(test_dir, f)
            outcar = Outcar(filepath)
            expected_mag = ({'d': 0.0, 'p': 0.003, 's': 0.002, 'tot': 0.005},
                             {'d': 0.798, 'p': 0.008, 's': 0.007, 'tot': 0.813},
                             {'d': 0.798, 'p': 0.008, 's': 0.007, 'tot': 0.813},
                             {'d': 0.0, 'p':-0.117, 's': 0.005, 'tot':-0.112},
                             {'d': 0.0, 'p':-0.165, 's': 0.004, 'tot':-0.162},
                             {'d': 0.0, 'p':-0.117, 's': 0.005, 'tot':-0.112},
                             {'d': 0.0, 'p':-0.165, 's': 0.004, 'tot':-0.162})
            expected_chg = ({'p': 0.154, 's': 0.078, 'd': 0.0, 'tot': 0.232},
                            {'p': 0.707, 's': 0.463, 'd': 8.316, 'tot': 9.486},
                            {'p': 0.707, 's': 0.463, 'd': 8.316, 'tot': 9.486},
                            {'p': 3.388, 's': 1.576, 'd': 0.0, 'tot': 4.964},
                            {'p': 3.365, 's': 1.582, 'd': 0.0, 'tot': 4.947},
                            {'p': 3.388, 's': 1.576, 'd': 0.0, 'tot': 4.964},
                            {'p': 3.365, 's': 1.582, 'd': 0.0, 'tot': 4.947})

            self.assertAlmostEqual(outcar.magnetization, expected_mag, 5,
                                   "Wrong magnetization read from Outcar")
            self.assertAlmostEqual(outcar.charge, expected_chg, 5,
                                   "Wrong charge read from Outcar")
            self.assertFalse(outcar.is_stopped)
            self.assertEqual(outcar.run_stats, {'System time (sec)': 0.938,
                                                'Total CPU time used (sec)': 545.142,
                                                'Elapsed time (sec)': 546.709,
                                                'Maximum memory used (kb)': 0.0,
                                                'Average memory used (kb)': 0.0,
                                                'User time (sec)': 544.204,
                                                'cores': '8'})
            self.assertAlmostEqual(outcar.efermi, 2.0112)
            self.assertAlmostEqual(outcar.nelect, 44.9999991)
            self.assertAlmostEqual(outcar.total_mag, 0.9999998)

            self.assertIsNotNone(outcar.as_dict())

            self.assertFalse(outcar.lepsilon)

        filepath = os.path.join(test_dir, 'OUTCAR.stopped')
        outcar = Outcar(filepath)
        self.assertTrue(outcar.is_stopped)

        for f in ['OUTCAR.lepsilon', 'OUTCAR.lepsilon.gz']:
            filepath = os.path.join(test_dir, f)
            outcar = Outcar(filepath)

            self.assertTrue(outcar.lepsilon)
            self.assertAlmostEqual(outcar.dielectric_tensor[0][0], 3.716432)
            self.assertAlmostEqual(outcar.dielectric_tensor[0][1], -0.20464)
            self.assertAlmostEqual(outcar.dielectric_tensor[1][2], -0.20464)
            self.assertAlmostEqual(outcar.dielectric_ionic_tensor[0][0], 0.001419)
            self.assertAlmostEqual(outcar.dielectric_ionic_tensor[0][2], 0.001419)
            self.assertAlmostEqual(outcar.dielectric_ionic_tensor[2][2], 0.001419)
            self.assertAlmostEqual(outcar.piezo_tensor[0][0], 0.52799)
            self.assertAlmostEqual(outcar.piezo_tensor[1][3], 0.35998)
            self.assertAlmostEqual(outcar.piezo_tensor[2][5], 0.35997)
            self.assertAlmostEqual(outcar.piezo_ionic_tensor[0][0], 0.05868)
            self.assertAlmostEqual(outcar.piezo_ionic_tensor[1][3], 0.06241)
            self.assertAlmostEqual(outcar.piezo_ionic_tensor[2][5], 0.06242)
            self.assertAlmostEqual(outcar.born[0][1][2], -0.385)
            self.assertAlmostEqual(outcar.born[1][2][0], 0.36465)
开发者ID:adozier,项目名称:pymatgen,代码行数:62,代码来源:test_outputs.py


示例17: assimilate

    def assimilate(self, path, launches_coll=None):
        """
        Parses vasp runs. Then insert the result into the db. and return the
        task_id or doc of the insertion.

        Returns:
            If in simulate_mode, the entire doc is returned for debugging
            purposes. Else, only the task_id of the inserted doc is returned.
        """

        d = self.get_task_doc(path)
        if self.additional_fields:
            d.update(self.additional_fields)  # always add additional fields, even for failed jobs

        try:
            d["dir_name_full"] = d["dir_name"].split(":")[1]
            d["dir_name"] = get_block_part(d["dir_name_full"])
            d["stored_data"] = {}
        except:
            print 'COULD NOT GET DIR NAME'
            pprint.pprint(d)
            print traceback.format_exc()
            raise ValueError('IMPROPER PARSING OF {}'.format(path))

        if not self.simulate:
            # Perform actual insertion into db. Because db connections cannot
            # be pickled, every insertion needs to create a new connection
            # to the db.
            conn = MongoClient(self.host, self.port)
            db = conn[self.database]
            if self.user:
                db.authenticate(self.user, self.password)
            coll = db[self.collection]

            # Insert dos data into gridfs and then remove it from the dict.
            # DOS data tends to be above the 4Mb limit for mongo docs. A ref
            # to the dos file is in the dos_fs_id.
            result = coll.find_one({"dir_name": d["dir_name"]})

            if result is None or self.update_duplicates:
                if self.parse_dos and "calculations" in d:
                    for calc in d["calculations"]:
                        if "dos" in calc:
                            dos = json.dumps(calc["dos"], cls=MontyEncoder)
                            fs = gridfs.GridFS(db, "dos_fs")
                            dosid = fs.put(dos)
                            calc["dos_fs_id"] = dosid
                            del calc["dos"]

                d["last_updated"] = datetime.datetime.today()
                if result is None:
                    if ("task_id" not in d) or (not d["task_id"]):
                        d["task_id"] = "mp-{}".format(
                            db.counter.find_one_and_update(
                                {"_id": "taskid"}, {"$inc": {"c": 1}}
			    )["c"])
                    logger.info("Inserting {} with taskid = {}"
                    .format(d["dir_name"], d["task_id"]))
                elif self.update_duplicates:
                    d["task_id"] = result["task_id"]
                    logger.info("Updating {} with taskid = {}"
                    .format(d["dir_name"], d["task_id"]))

                #Fireworks processing

                self.process_fw(path, d)

                try:
                    #Add oxide_type
                    struct=Structure.from_dict(d["output"]["crystal"])
                    d["oxide_type"]=oxide_type(struct)
                except:
                    logger.error("can't get oxide_type for {}".format(d["task_id"]))
                    d["oxide_type"] = None

                #Override incorrect outcar subdocs for two step relaxations
                if "optimize structure" in d['task_type'] and \
                    os.path.exists(os.path.join(path, "relax2")):
                    try:
                        run_stats = {}
                        for i in [1,2]:
                            o_path = os.path.join(path,"relax"+str(i),"OUTCAR")
                            o_path = o_path if os.path.exists(o_path) else o_path+".gz"
                            outcar = Outcar(o_path)
                            d["calculations"][i-1]["output"]["outcar"] = outcar.as_dict()
                            run_stats["relax"+str(i)] = outcar.run_stats
                    except:
                        logger.error("Bad OUTCAR for {}.".format(path))

                    try:
                        overall_run_stats = {}
                        for key in ["Total CPU time used (sec)", "User time (sec)",
                                    "System time (sec)", "Elapsed time (sec)"]:
                            overall_run_stats[key] = sum([v[key]
                                              for v in run_stats.values()])
                        run_stats["overall"] = overall_run_stats
                    except:
                        logger.error("Bad run stats for {}.".format(path))

                    d["run_stats"] = run_stats
#.........这里部分代码省略.........
开发者ID:xhqu1981,项目名称:MPWorks,代码行数:101,代码来源:mp_vaspdrone.py


示例18: test_init

    def test_init(self):
        for f in ["OUTCAR", "OUTCAR.gz"]:
            filepath = os.path.join(test_dir, f)
            outcar = Outcar(filepath)
            expected_mag = (
                {"d": 0.0, "p": 0.003, "s": 0.002, "tot": 0.005},
                {"d": 0.798, "p": 0.008, "s": 0.007, "tot": 0.813},
                {"d": 0.798, "p": 0.008, "s": 0.007, "tot": 0.813},
                {"d": 0.0, "p": -0.117, "s": 0.005, "tot": -0.112},
                {"d": 0.0, "p": -0.165, "s": 0.004, "tot": -0.162},
                {"d": 0.0, "p": -0.117, "s": 0.005, "tot": -0.112},
                {"d": 0.0, "p": -0.165, "s": 0.004, "tot": -0.162},
            )
            expected_chg = (
                {"p": 0.154, "s": 0.078, "d": 0.0, "tot": 0.232},
                {"p": 0.707, "s": 0.463, "d": 8.316, "tot": 9.486},
                {"p": 0.707, "s": 0.463, "d": 8.316, "tot": 9.486},
                {"p": 3.388, "s": 1.576, "d": 0.0, "tot": 4.964},
                {"p": 3.365, "s": 1.582, "d": 0.0, "tot": 4.947},
                {"p": 3.388, "s": 1.576, "d": 0.0, "tot": 4.964},
                {"p": 3.365, "s": 1.582, "d": 0.0, "tot": 4.947},
            )

            self.assertAlmostEqual(outcar.magnetization, expected_mag, 5, "Wrong magnetization read from Outcar")
            self.assertAlmostEqual(outcar.charge, expected_chg, 5, "Wrong charge read from Outcar")
            self.assertFalse(outcar.is_stopped)
            self.assertEqual(
                outcar.run_stats,
                {
                    "System time (sec)": 0.938,
                    "Total CPU time used (sec)": 545.142,
                    "Elapsed time (sec)": 546.709,
                    "Maximum memory used (kb)": 0.0,
                    "Average memory used (kb)": 0.0,
                    "User time (sec)": 544.204,
                    "cores": "8",
                },
            )
            self.assertAlmostEqual(outcar.efermi, 2.0112)
            self.assertAlmostEqual(outcar.nelect, 44.9999991)
            self.assertAlmostEqual(outcar.total_mag, 0.9999998)

            self.assertIsNotNone(outcar.as_dict())

            self.assertFalse(outcar.lepsilon)

        filepath = os.path.join(test_dir, "OUTCAR.stopped")
        outcar = Outcar(filepath)
        self.assertTrue(outcar.is_stopped)

        for f in ["OUTCAR.lepsilon", "OUTCAR.lepsilon.gz"]:
            filepath = os.path.join(test_dir, f)
            outcar = Outcar(filepath)

            self.assertTrue(outcar.lepsilon)
            self.assertAlmostEqual(outcar.dielectric_tensor[0][0], 3.716432)
            self.assertAlmostEqual(outcar.dielectric_tensor[0][1], -0.20464)
            self.assertAlmostEqual(outcar.dielectric_tensor[1][2], -0.20464)
            self.assertAlmostEqual(outcar.dielectric_ionic_tensor[0][0], 0.001419)
            self.assertAlmostEqual(outcar.dielectric_ionic_tensor[0][2], 0.001419)
            self.assertAlmostEqual(outcar.dielectric_ionic_tensor[2][2], 0.001419)
            self.assertAlmostEqual(outcar.piezo_tensor[0][0], 0.52799)
            self.assertAlmostEqual(outcar.piezo_tensor[1][3], 0.35998)
            self.assertAlmostEqual(outcar.piezo_tensor[2][5], 0.35997)
            self.assertAlmostEqual(outcar.piezo_ionic_tensor[0][0], 0.05868)
            self.assertAlmostEqual(outcar.piezo_ionic_tensor[1][3], 0.06241)
            self.assertAlmostEqual(outcar.piezo_ionic_tensor[2][5], 0.06242)
            self.assertAlmostEqual(outcar.born[0][1][2], -0.385)
            self.assertAlmostEqual(outcar.born[1][2][0], 0.36465)
开发者ID:shyamd,项目名称:pymatgen,代码行数:69,代码来源:test_outputs.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python outputs.Vasprun类代码示例发布时间:2022-05-27
下一篇:
Python inputs.VaspInput类代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap