Example #1
0
def input_handling(args):
    comp1 = Composition(args.composition_1)
    comp2 = Composition(args.composition_2)
    entry1 = VirtualEntry.from_composition(comp1)
    entry2 = VirtualEntry.from_composition(comp2)
    entry1.stabilize()
    entry2.stabilize()
    entry1.energy_correction(args.e1)
    entry2.energy_correction(args.e2)
    return entry1, entry2
Example #2
0
def get_phase_equilibria_from_composition(args):
    """
    Provides the phase equilibria of a phase with given composition
    """
    comp = Composition(args.composition)
    entry = VirtualEntry.from_composition(comp)
    print(entry.get_printable_PE_data_in_pd())
    return 0
 def get_gppd_entries(self, open_el):
     if open_el in (self.entry1.composition +
                    self.entry2.composition).keys():
         gppd_entries = self.PDEntries
     else:
         comp = self.entry1.composition + self.entry2.composition + Composition(
             open_el.symbol)
         gppd_entries = VirtualEntry.from_composition(
             comp).get_GPPD_entries(open_el)
     return gppd_entries
Example #4
0
def get_phase_evolution_profile(args):
    """
    Provides the phase equilibria and decomposition energy evolution process of a phase when open to a specific element
    Chemical potential is referenced to pure phase of open element.
    """
    comp = Composition(args.composition)
    entry = VirtualEntry.from_composition(comp)
    oe = args.open_element
    entry.stabilize()
    print(entry.get_printable_evolution_profile(oe, allowpmu=args.posmu))
    return 0
    def __init__(self, entry1, entry2, entries=None, sup_el=None):
        comp1 = entry1.composition
        comp2 = entry2.composition
        norm1 = 1.0 / entry1.composition.num_atoms
        norm2 = 1.0 / entry2.composition.num_atoms

        self.entry1 = VirtualEntry.from_composition(entry1.composition * norm1,
                                                    energy=entry1.energy *
                                                    norm1,
                                                    name=comp1.reduced_formula)
        self.entry2 = VirtualEntry.from_composition(entry2.composition * norm2,
                                                    energy=entry2.energy *
                                                    norm2,
                                                    name=comp2.reduced_formula)

        if not entries:
            entry_mix = VirtualEntry.from_composition(comp1 + comp2)
            entries = entry_mix.get_PD_entries(sup_el=sup_el)
        entries += [entry1, entry2]
        self.PDEntries = entries
        self.PD = PhaseDiagram(entries)
Example #6
0
def get_phase_equilibria_and_decomposition_energy_under_mu_from_composition(
        args):
    """
    Provide the phase equilibria and decomposition energy when open to one element with given miu
    Chemical potential is referenced to pure phase of open element.
    """
    comp = Composition(args.composition)
    chempot = {args.open_element: args.chemical_potential}
    entry = VirtualEntry.from_composition(comp)
    entry.stabilize()
    print(
        entry.get_printable_PE_and_decomposition_in_gppd(chempot,
                                                         entries=None))
    return 0
Example #7
0
def plot_vc(args):
    """
    Get the plot data of voltage profile.
    """
    comp = Composition(args.composition)
    entry = VirtualEntry.from_composition(comp)
    oe = args.open_element
    entry.stabilize()
    common_working_ions = dict(Li=1, Na=1, K=1, Mg=2, Ca=2, Al=3)
    valence = args.valence if args.valence else common_working_ions[oe]
    oe_list, v_list = entry.get_vc_plot_data(oe,
                                             valence=valence,
                                             allowpmu=args.posmu)
    print(entry.get_printable_vc_plot_data(oe, oe_list, v_list))
    entry.get_voltage_profile_plot(oe, oe_list, v_list, valence).show()