aiida_lammps.data.trajectory
#
Data structure for storing LAMMPS trajectories.
The idea is that each of the steps of the simulation are stored as ZIP files which can then be easily accessed by the user.
Module Contents#
Classes#
Store a lammps trajectory file. |
- class aiida_lammps.data.trajectory.LammpsTrajectory(fileobj=None, aliases=None, **kwargs)[source]#
Bases:
aiida.orm.Data
Store a lammps trajectory file.
Each trajectory step is stored as a separate file, within a compressed zip folder. This reduces storage space, and allows for fast access to each step.
- property number_steps[source]#
Get the number of steps stored in the data.
- Returns:
number of steps stored in the data
- Return type:
- property time_steps[source]#
Get the simulation time steps stored in the data.
- Returns:
time steps stored in the data.
- Return type:
- property number_atoms[source]#
Get the number of atoms present in the simulation box.
- Returns:
number of atoms in the simulation box
- Return type:
- property field_names[source]#
Get the name of the fields as written to file.
- Returns:
list of field names as written to file.
- Return type:
- property aliases[source]#
Get the mapping of one or more lammps variables.
- Returns:
mapping of one or more lammps variables.
- Return type:
- set_from_fileobj(fileobj, aliases=None)[source]#
Store a lammps trajectory file.
- Parameters:
- Raises:
ValueError – if the aliases are not of the correct type
IOError – if a given step has more atoms than supposed to
IOError – if a given step has incompatible field names
IOError – if the timesteps are not present in the trajectory file
- get_step_structure(step_idx: int, symbol_field: str = 'element', position_fields: tuple = ('x', 'y', 'z'), original_structure: aiida.orm.StructureData = None) aiida.orm.StructureData [source]#
Return a StructureData object, for a specific trajectory step.
- Parameters:
step_idx (int) – trajectory step to be looked at
symbol_field (str, optional) – the variable field denoting the symbol for each atom, defaults to ‘element’
position_fields (tuple, optional) – tuple, the variable fields denoting the x, y, z position for each atom, defaults to (‘x’, ‘y’, ‘z’)
original_structure (orm.StructureData, optional) – a structure that will be used to define kinds for each atom, defaults to None
- Returns:
structure of the simulation at the given time step
- Return type:
orm.StructureData