Example #1
0
    def __init__(self, atoms: Atoms, oszicar: Oszicar, name: str=None, time: float=None):

        if name is None:
            self.name = str(self.atoms)
        else:
            self.name = name

        self.time = time

        self.atoms = atoms
        self.potential_energy = atoms.get_potential_energy()
        self.kinetic_energy = atoms.get_kinetic_energy()
        self.total_energy = atoms.get_total_energy()
        self.temperature = atoms.get_temperature()
        # self.magmom = atoms.get_magnetic_moment()

        self.elements = Counter(atoms.get_chemical_symbols())

        self.set_area()

        self.set_oszicar(oszicar)
        n = len(atoms)
        if self.get('F'):
            self.F_n = self.F / n
        else:
            self.F_n = self.potential_energy / n
Example #2
0
def gen_calculation(atoms: Atoms, parameter: str, start: int, step: int=1, calc_params: dict={}):
    for val in count(start, step):
        name = f''
        Vasp(name, **calc_params)
        atoms.calc.set(**{parameter: val})
        yield (val, atoms.get_total_energy())