irradiapy.analysis.defects module

Defects analysis module.

irradiapy.analysis.defects.identify_defects(lattice, a0, data_atoms, a1=None, pos_pka=None, theta_pka=None, phi_pka=None, transform=False, debug=False)[source]

Identify defects in a given atomic structure.

Parameters:
  • lattice (str) – Lattice type. Currently only “bcc” is supported.

  • a0 (float) – Lattice parameter.

  • data_atoms (dict[str, Any]) – Dictionary containing simulation data as given by the LAMMPSReader and similar readers. Must include keys: ‘atoms’, ‘boundary’, ‘xlo’, ‘xhi’, ‘ylo’, ‘yhi’, ‘zlo’, ‘zhi’, ‘timestep’.

  • a1 (float | None) – Final lattice parameter. If provided, defect positions are rescaled to this value (independently of the transform value).

  • pos_pka (GenericAlias[double] | None) – Position vector of the PKA. If provided with theta_pka and phi_pka, defects are recentered and aligned.

  • theta_pka (float | None) – Polar angle (in radians) for the PKA direction.

  • phi_pka (float | None) – Azimuthal angle (in radians) for the PKA direction.

  • transform (bool) – If True, defects are recentered and aligned with the PKA direction (if provided). If True but no PKA parameters are provided, defects are recentered based on their average position. Note that the box boundaries are not modified for visualization purposes, only the atomic positions are transformed.

  • debug (bool) – If True, enables debug mode for additional output.

Returns:

Snapshot data containing the identified defects in its "atoms" entry.

Return type:

dict[str, Any]

irradiapy.analysis.defects.identify_lammps_dump(lattice, a0, dump_path, dump_defects_path, a1=None, pos_pka=None, theta_pka=None, phi_pka=None, transform=False, overwrite=False, debug=False)[source]

Identify defects in a LAMMPS dump file.

Parameters:
  • lattice (str) – Lattice type. Currently only “bcc” is supported.

  • a0 (float) – Lattice parameter.

  • dump_path (Path) – Path to the LAMMPS dump file to read. Can be compressed with .bz2 or not.

  • dump_defects_path (Path) – Path to the output file where identified defects will be written (in text format).

  • a1 (float | None) – Final lattice parameter. If provided, defect positions are rescaled to this value (independently of the transform value).

  • pos_pka (GenericAlias[double] | None) – Position vector of the PKA. If provided with theta_pka and phi_pka, defects are recentered and aligned.

  • theta_pka (float | None) – Polar angle (in radians) for the PKA direction.

  • phi_pka (float | None) – Azimuthal angle (in radians) for the PKA direction.

  • transform (bool) – If True, defects are recentered and aligned with the PKA direction (if provided). If True but no PKA parameters are provided, defects are recentered based on their average position. Note that the box boundaries are not modified for visualization purposes, only the atomic positions are transformed.

  • overwrite (bool) – If True, allows overwriting the output file if it already exists.

  • debug (bool) – If True, enables debug mode for additional output.

Return type:

None