relentless.simulate.WriteTrajectory#
- class relentless.simulate.WriteTrajectory(filename, every, format=None, velocities=False, images=False, types=False, masses=False)#
Write a simulation trajectory to file.
The
filenameis relative to the directory where the simulation is being run. Regardless of the file extension, the file format is currently restricted to be native to the specific simulation backend. Any existing file of the same name will be overwritten.Particle positions, wrapped into the periodic simulation box, are always included in the trajectory. Additional properties can be opted in.
- Parameters:
filename (str) – Name of the trajectory file to be written, as a relative path.
every (int) – Interval of time steps at which to write a snapshot.
format (str) –
File format, from the following:
"HOOMD-GSD": HOOMD GSD file"LAMMPS-dump": LAMMPS dump file
If
None(default),formatis inferred from thefilenameaccording to the following ordered rules:Files with
.gsdas their sufix are HOOMD-GSD.Files with
.dumpor.lammpstrjanywhere in their suffix ordumpas the stem of their file name are LAMMPS-dump.
Simulations are encouraged but not required to support as many file formats as possible.
velocities (bool) – Include particle velocities.
images (bool) – Include particle images.
types (bool) – Include particle types.
masses (bool) – Include particle masses.
Methods
post_run(sim, sim_op)pre_run(sim, sim_op)process(sim, sim_op)