示例#1
0
    def eos_fit(self, eos_name="murnaghan"):
        """
        Fit E(V)
        For the list of available models, see EOS.MODELS

        TODO: which default? all should return a list of fits
        """
        # Read volumes and energies from the GSR files.
        energies, volumes = [], []
        for label, gsr in self:
            energies.append(gsr.energy)
            volumes.append(gsr.structure.volume)

        # Note that eos.fit expects lengths in Angstrom, and energies in eV.
        if eos_name != "all":
            return EOS(eos_name=eos_name).fit(volumes, energies)
        else:
            # Use all the available models.
            fits, rows = [], []
            for eos_name in EOS.MODELS:
                fit = EOS(eos_name=eos_name).fit(volumes, energies)
                fits.append(fit)
                rows.append(fit.results)

            frame = pd.DataFrame(rows,
                                 index=EOS.MODELS,
                                 columns=rows[0].keys())
            return fits, frame
示例#2
0
文件: eos.py 项目: srirampr/abipy
    def OnFitButton(self, event):
        model = self.model_choice.GetStringSelection()

        try:
            eos = EOS(eos_name=model)
            fit = eos.fit(self.volumes, self.energies, vol_unit=self.vol_unit, ene_unit=self.ene_unit)
            print(fit)
            fit.plot()

        except:
            awx.showErrorMessage(self)
示例#3
0
文件: eos.py 项目: gmrigna/abipy
    def OnFitButton(self, event):
        model = self.model_choice.GetStringSelection()

        try:
            eos = EOS(eos_name=model)
            fit = eos.fit(self.volumes, self.energies, vol_unit=self.vol_unit, ene_unit=self.ene_unit)
            print(fit)
            fit.plot()

        except:
            awx.showErrorMessage(self)
示例#4
0
 def analyze_eos_flow(flow, **kwargs):
     work = flow[0]
     etotals = work.read_etotals(unit="eV")
     eos_fit = EOS.Birch_Murnaghan().fit(flow.volumes, etotals)
     return eos_fit.plot(**kwargs)
示例#5
0
 def test_fit(self):
     """Test EOS fit"""
     for eos_name in EOS.MODELS:
         eos = EOS(eos_name=eos_name)
         fit = eos.fit(self.volumes, self.energies)
         print(fit)
示例#6
0
 def test_fit(self):
     "Test EOS fit"
     for eos_name in EOS.functions:
         eos = EOS(eos_name=eos_name)
         fit = eos.fit(self.volumes, self.energies)
         print(fit)
示例#7
0
 def test_fit(self):
     """Test EOS fit"""
     for eos_name in EOS.MODELS:
         eos = EOS(eos_name=eos_name)
         fit = eos.fit(self.volumes, self.energies)
         print(fit)
示例#8
0
 def test_fit(self):
     "Test EOS fit"
     for eos_name in EOS.functions:
         eos = EOS(eos_name=eos_name)
         fit = eos.fit(self.volumes, self.energies)
         print(fit)