irradiapy.utils.io module
Utility functions for I/O operations.
- irradiapy.utils.io.apply_boundary_conditions_to_lammps(in_path, out_path, x, y, z, overwrite=False)[source]
Apply periodic boundary conditions to a LAMMPS dump file.
- Parameters:
in_path (
Path) – Path to the input LAMMPS file (bzip2 compressed or not).out_path (
Path) – Path to the output LAMMPS file (bzip2 compressed or not).x (
bool) – Whether to apply periodic boundary conditions in the x direction.y (
bool) – Whether to apply periodic boundary conditions in the y direction.z (
bool) – Whether to apply periodic boundary conditions in the z direction.overwrite (
bool) – Whether to overwrite the output file if it exists.
- Return type:
- irradiapy.utils.io.compress_file_bz2(input_path, output_path, compresslevel=9)[source]
Compress a file using bzip2.
- irradiapy.utils.io.decompress_file_bz2(input_path, output_path)[source]
Decompress a bzip2-compressed file.
- irradiapy.utils.io.get_last_reader(reader)[source]
Get the last snapshot from a LAMMPS dump file using a reader.
- irradiapy.utils.io.lammps_to_mmonca(path_in, path_out, scale=10.0)[source]
Convert LAMMPS dump file to MMonCa format. Uses LAMMPSReader.
- Parameters:
- Return type:
Warning
This converter is very basic: defects of type 0 are considered vacancies (V), and all other defect types are considered interstitials (I). Therefore, this will produce wrong results when multiple elements are present.