Exemplo n.º 1
0
    def _set_phonon(self):
        if self._supercell_matrix is None:
            cell = sort_cell_by_symbols(
                get_crystallographic_cell(self.get_cell()))
            self._supercell_matrix = estimate_supercell_matrix(
                cell,
                max_num_atoms=self._max_num_atoms)
        else:
            cell = self.get_cell()

        phonopy_cell = cell2atoms(cell)
        self._phonon = Phonopy(phonopy_cell,
                               self._supercell_matrix,
                               primitive_matrix=self._primitive_matrix,
                               dynamical_matrix_decimals=14,
                               force_constants_decimals=14,
                               symprec=self._symmetry_tolerance)
        self._phonon.generate_displacements(
            distance=self._distance,
            is_plusminus=self._displace_plusminus,
            is_diagonal=self._displace_diagonal)
        supercell = self._phonon.get_supercell()
        displacements = self._phonon.get_displacements()

        write_poscar(cell, filename="POSCAR-unitcell")
        write_poscar_yaml(cell, filename="POSCAR-unitcell.yaml")
        write_disp_yaml(displacements, supercell)
Exemplo n.º 2
0
    def _prepare_next(self, cell):
        self._stage = 1
        self._status = "phonons"

        if self._supercell_matrix is None:
            self._supercell_matrix = estimate_supercell_matrix(
                cell,
                max_num_atoms=self._max_num_atoms)

        self._qh_tasks += self._get_phonon_tasks(cell)
        self._tasks = self._qh_tasks[1:]
Exemplo n.º 3
0
    def _prepare_mode_gruneisen(self):
        self._stage = 2
        self._status = "mode_gruneisen"

        if self._supercell_matrix is None:
            cell = self.get_cell()
            self._supercell_matrix = estimate_supercell_matrix(
                cell,
                max_num_atoms=self._max_num_atoms)

        cells = [task.get_cell()
                 for task in self._all_tasks[1].get_all_tasks()[2:5]]
        tasks = self._get_phonon_tasks(cells,
                                       is_cell_relaxed=True,
                                       directory="gruneisen")
        self._all_tasks += tasks
        self._tasks = tasks
Exemplo n.º 4
0
    def _prepare_phonons(self):
        self._stage = 3
        self._status = "phonons"

        if self._supercell_matrix is None:
            self._supercell_matrix = estimate_supercell_matrix(
                cell,
                max_num_atoms=self._max_num_atoms)

        if self._estimate_strain:
            self._strains = self._get_estimated_strains()

        cell = self.get_cell()
        cells = get_strained_cells(cell, self._strains)
        tasks = self._get_phonon_tasks(cells)

        self._all_tasks += tasks
        self._tasks = tasks
Exemplo n.º 5
0
    def _set_phonon(self):
        cell = self.get_cell()

        if self._supercell_matrix is None:
            self._supercell_matrix = estimate_supercell_matrix(
                cell,
                max_num_atoms=self._max_num_atoms)

        phonopy_cell = cell2atoms(cell)
        self._phonon = Phonopy(phonopy_cell,
                               self._supercell_matrix,
                               primitive_matrix=self._primitive_matrix,
                               is_auto_displacements=False,
                               dynamical_matrix_decimals=14,
                               force_constants_decimals=14)
        self._phonon.generate_displacements(
            distance=self._distance,
            is_plusminus=self._displace_plusminus,
            is_diagonal=self._displace_diagonal)
        supercell = self._phonon.get_supercell()
        displacements = self._phonon.get_displacements()

        write_poscar(cell, "POSCAR-unitcell")
        write_disp_yaml(displacements, supercell)
Exemplo n.º 6
0
#!/usr/bin/env python

import sys
import numpy as np
from cogue.interface.vasp_io import read_poscar
from cogue.crystal.cell import symbols2formula
from cogue.crystal.supercell import estimate_supercell_matrix

cell = read_poscar(sys.argv[1])
supercell_matrix = estimate_supercell_matrix(cell, 120)