Hi guys!
I’ve recently faced a tiny bug in Ovito involving inserting a data file, load trajectory and unwrapped image flags. It would be normal to open a LAMMPS data file, which contains all information on bonds and particles’ weight in Ovito with loading a trajectory of the same system’s particles, while the latter file only consists of the unwrapped scaled positions and particle identifiers.
At this very particular stage, you’ll face a bug if you wanna use the ‘unwrapped position’ modifier since Ovito does not update the image’s flags and keeps the flags of the data file. Eventually, what you have! a broken molecule I spent two weeks to get my simulation is correct, and the weird results are just a matter of bad visualisation.
I appreciate it if you have any ideas or tricks to overcome this issue.
Best
Russell.
Hi Russell,
while the latter file only consists of the unwrapped scaled positions and particle identifiers
Just to confirm, you probably mean wrapped, right? Otherwise, unwrapping the particle coordinates wouldn’t be necessary.
Let me try to clear up the issue:
- The Load trajectory modifier lets you combine atomic trajectories and other time-dependent data from a separate trajectory file and merges them with static topology data. The expected behavior is that any particle property not present in the trajectory will be copied from the primary data file to all other simulation frames.
If I understand you correctly, you have a LAMMPS Data file with Image Flags and a LAMMPS Dump file without Image Flags? That means if you combine those with OVITO’s Load trajectory modifier, you effectively generate static image flags from the Data file.
- The Unwrap trajectory modifier does not generate image flags itself. If image flags are already included in the input data, the modifier uses them for the unwrapping process. Only if these flags are absent OVITO employs a heuristic method to unwrap the particle coordinates. In your case, those static image flags didn’t match the wrapped particle coordinates and led to unexpected results.
We can offer to extend OVITO’s Load Trajectory Modifier for the next release to automatically delete the image flags from the Data collection if they are only present in the topology file but missing in the trajectory file.
For the time being, I think a quick workaround would be to delete the image flags imported from the topology file with a Python modifier, e.g
def modify(frame: int, data: DataCollection)
del data.particles_['Periodic Image']
-Constanze
Hi Constanze!
Yes! There is a typo in my earlier message, and I would like to revise it here to avoid messing up the flow.
You got my point correctly, and I figured out that OVITO does not compute the image flags if they are not in the Dump file (trajectory file), and OVITO uses the previous flags.
Technically, OVITO does its task correctly, and I was not accurate in dumping my data. So, it would be perfect if OVITO apprises me of the visualisation of absent data.
Russell