File: generate_displacements.py

package info (click to toggle)
phonopy 2.48.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 29,556 kB
  • sloc: python: 44,403; xml: 12,080; ansic: 3,227; cpp: 525; sh: 213; makefile: 20
file content (18 lines) | stat: -rw-r--r-- 551 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
"""A script to generate supercells with displacements for LAMMPS."""

import phonopy
from phonopy.interface.calculator import write_supercells_with_displacements
from phonopy.interface.phonopy_yaml import read_cell_yaml

cell = read_cell_yaml("phonopy_unitcell.yaml")
ph = phonopy.load(
    unitcell=cell,
    primitive_matrix="auto",
    supercell_matrix=[2, 2, 2],
    calculator="lammps",
)
ph.generate_displacements()
ph.save("phonopy_disp.yaml")
write_supercells_with_displacements(
    "lammps", ph.supercell, ph.supercells_with_displacements
)