defectpl.defect_utils¶
make_defect_entry
¶
make_defect_entry(
name,
center=None,
perfect_poscar=None,
defect_poscar=None,
out_path="defect_entry.json",
site_tol=0.5,
)
Create a defect_entry.json file.
Either supply center directly, or let the function auto-detect it by
comparing perfect_poscar and defect_poscar.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Defect label (e.g. |
required |
center
|
sequence of 3 floats
|
Fractional coordinates of the defect centre. Required when
|
None
|
perfect_poscar
|
str or Path
|
Path to the perfect (undoped) supercell POSCAR/CONTCAR. |
None
|
defect_poscar
|
str or Path
|
Path to the defect supercell POSCAR/CONTCAR. |
None
|
out_path
|
str or Path
|
Destination for the JSON file. Default |
'defect_entry.json'
|
site_tol
|
float
|
Cartesian tolerance (Å) for matching sites in auto-detection. |
0.5
|
Returns:
| Type | Description |
|---|---|
dict
|
The JSON content that was written. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If neither |
Source code in defectpl\defect_utils.py
make_defect_structure_info
¶
make_defect_structure_info(
poscar,
defect_center_frac,
cutoff_radius=3.5,
out_path="defect_structure_info.json",
)
Generate a defect_structure_info.json via distance-based neighbour search.
Finds all atoms within cutoff_radius Å of defect_center_frac in the supercell defined by poscar (minimum-image convention).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
poscar
|
str or Path
|
POSCAR / CONTCAR of the defect supercell. |
required |
defect_center_frac
|
sequence of 3 floats
|
Fractional coordinates of the defect centre. |
required |
cutoff_radius
|
float
|
Search radius in Å. Default 3.5 Å. |
3.5
|
out_path
|
str or Path
|
Destination file. Default |
'defect_structure_info.json'
|
Returns:
| Type | Description |
|---|---|
dict
|
The JSON content that was written, with key |
Raises:
| Type | Description |
|---|---|
ImportError
|
If pymatgen is not installed. |