-
Notifications
You must be signed in to change notification settings - Fork 2
/
script.py
29 lines (23 loc) · 896 Bytes
/
script.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
from fileinput import filename
from defectivator.point_defects import PointDefectSet
from defectivator.defect_complexes import DefectComplexMaker
from ase.build import bulk
from pymatgen.io.ase import AseAtomsAdaptor
from ase.build import make_supercell
from defectivator.random_defect_structure import generate_random_defects
# define some example structure
bulk_supercell = bulk("LiF", "rocksalt", 4.1)
bulk_supercell = make_supercell(bulk_supercell, [[-2, 2, 2], [2, -2, 2], [2, 2, -2]])
bulk_supercell = AseAtomsAdaptor.get_structure(bulk_supercell)
# generate the host defect
ds = PointDefectSet(
bulk_supercell,
# extrinsic_species=["Fe"],
charge_tol=5,
interstitial_scheme=None
)
structure = ds.vacancies[0]
for i in generate_random_defects(structure, 10, 2):
i.to(filename = "vis.cif")
# for v in ds.interstitials:
# v.structure.to(filename = "vis.cif")