I am using GenerateTrajectoryLinesModifier
to obtain the trajectory of a subset of particles from a dump file (includes shear) over a period of time. Below is my simplified code:
pipeline = import_file(dump_file)
cmd = convert_ovito_command(processor_atoms_id) # select some atoms
pipeline.modifiers.append(ExpressionSelectionModifier(expression=cmd))
pipeline.modifiers.append(UnwrapTrajectoriesModifier())
trajectory_modifier = GenerateTrajectoryLinesModifier(only_selected=True, sampling_frequency=1)
pipeline.modifiers.append(trajectory_modifier)
trajectory_modifier.generate()
In the code above, processor_atoms_id
refers to the atom IDs that a particular processor process (in an MPI parallel program) needs to handle.
I have encountered an issue where the program occasionally throws the following error:
trajectory_modifier.generate()
RuntimeError: The current simulation sequence consists only of a single frame. Thus, no trajectory lines were created.
By “occasionally,” I mean that the same code sometimes runs without errors and sometimes produces this error. The error message indicates that there is only a single frame, which seems unlikely given the context.
Could someone help me understand what might be causing this error? I am happy to provide additional information if needed.