irradiapy.io.lammpswriter module

This module contains the LAMMPSWriter class.

class irradiapy.io.lammpswriter.LAMMPSWriter(file_path, mode='w', encoding=<factory>, newline=<factory>, int_format=<factory>, float_format=<factory>, excluded_items=<factory>)[source]

Bases: object

A class to write data like a LAMMPS dump file.

Note

Assumed orthogonal simulation box.

Variables:
  • file_path (Path) – The path to the LAMMPS dump file.

  • mode (str, optional (default="w")) – The file open mode.

  • encoding (str, optional (default=irradiapy.config.ENCODING)) – The file encoding.

  • newline (str, optional (default=irradiapy.config.NEWLINE)) – The newline character for the file.

  • int_format (str, optional (default=irradiapy.config.INT_FORMAT)) – The format for integers.

  • float_format (str, optional (default=irradiapy.config.FLOAT_FORMAT)) – The format for floats.

  • excluded_items (list[str], optional (default=irradiapy.config.EXCLUDED_ITEMS)) – Atom fields to exclude from output.

close()[source]

Closes the file associated with this writer.

Return type:

None

encoding: str
excluded_items: list[str]
file_path: Path
float_format: str
int_format: str
mode: str = 'w'
newline: str
write(data)[source]

Write the data to the file.

Parameters:

data (dict[str, Any]) – A dictionary containing the data to be written. The keys should include “timestep”, “boundary”, “xlo”, “xhi”, “ylo”, “yhi”, “zlo”, “zhi”, and “atoms”. Optional keys: “time”.

Return type:

None