Author Topic: Periodic Images in GSD file  (Read 117 times)

Gabriel Catalini

  • Newbie
  • *
  • Posts: 6
Periodic Images in GSD file
« on: June 19, 2019, 07:37:21 PM »
Hi,

I am having some trouble with .gsd files dumped from hoomd-blue simulations. As far as I understand, OVITO is not reading/using the Periodic Images array from the file, as it is not listed in the DataCollection when the GSD file is opened. I can check that the file actually contains this data via the python gsd reader.
I assumed that the normal behavior would be that OVITO displayed raw positions but that these could be transformed using both the Image Array and the Simulation Cell Matrix.
The 'Wrap at Periodic Boundaries' modifier seems to work with LAMMPS data files because in these files the positions can be specified to be outside the simulation box so that OVITO realizes this and wraps them back into the cell. Nevertheless in hoomd the output files contain only coordinates inside the box and if a particle crosses the boundary the image array is modified accordingly to keep track of this crossing. I would like OVITO to import this array into the DataCollection so that then I can unwrap the coordinates outside the Simulation Cell. This is relevant when particles are bonded together (e.g. polymers).
I attach a .gsd sample of a single diblock copolymer molecule where I can find this problem. I also include a .xml (deprecated hoomd format) which is easily readable.
Please tell me if there is any way to make this work,

Best regards,

Gabriel

Alexander Stukowski

  • Administrator
  • Hero Member
  • *****
  • Posts: 620
Re: Periodic Images in GSD file
« Reply #1 on: June 20, 2019, 06:55:34 AM »
Hi Gabriel,

Yes indeed, OVITO's file reader for the GSD format seems to ignore the image information. I'm not sure whether that is because the official GSD format specification didn't mention the image data at the time I wrote the GSD file reader, or because I didn't have an example file at hand.

Anyway, I now work on extending OVITO's file reader. I expect that I can provide a new program build tomorrow and will get back to you.

-Alex

Gabriel Catalini

  • Newbie
  • *
  • Posts: 6
Re: Periodic Images in GSD file
« Reply #2 on: June 20, 2019, 08:49:04 PM »
Hi Alexander,

A coworker of mine has detected that the same problem is also present in LAMMPS .data files that are exported with wrapped coordinates and images.
I attach such file of the same configuration as the previous .gsd
Thanks for the quick reply and your predisposition!

Best Regards,

Gabriel

Alexander Stukowski

  • Administrator
  • Hero Member
  • *****
  • Posts: 620
Re: Periodic Images in GSD file
« Reply #3 on: June 21, 2019, 02:48:10 AM »
Ok, I will take a look at the LAMMPS file you provided in a moment.

This is just to inform you that the new Ovito build is available (3.0.0-dev415), which parses the periodic image information from GSD files. The data is stored in the "Periodic Image" particle property. Subsequently, you can apply the Unwrap Trajectories modifier if desired to unwrap the particle positions using this information. The modifier will clear the "Periodic Image" property as a side effect.

Gabriel Catalini

  • Newbie
  • *
  • Posts: 6
Re: Periodic Images in GSD file
« Reply #4 on: June 21, 2019, 06:56:44 PM »
Hi Alexander,

Thanks for this new version of OVITO!
The fix seems to be reading and using correctly the images for the first frame of my .gsd files. Nevertheless for multiple frames .gsd files, it is not working correctly.
When I open a multiple frame .gsd file and use the 'Unwrap Trajectories' Modifier the first frame of the simulations is correctly unwrapped, but the rest of the frames get unwrapped again so that they are effectively unwrapped 2 times, which sends particles 2*L_box away, distorting the visualization. This happens for all .gsd files I have tested so far with version 3.0.0-dev415.
I attach one of my simulations, sorry for the large file size.

Best regards,

Gabriel

Alexander Stukowski

  • Administrator
  • Hero Member
  • *****
  • Posts: 620
Re: Periodic Images in GSD file
« Reply #5 on: June 23, 2019, 02:31:03 AM »
I'm not sure, but to me it looks like the 'particles/image' array in the file 'Homopolymer.gsd' contains only information for frame 0 of the trajectory. Thus, the GSD file reader assumes it is a static particle property that doesn't change with time. This leads to wrong results when the Unwrap Trajectories modifier uses the information to c compute unwrapped coordinates. The periodic image property read from the GSD file should change every time a particle crosses a periodic boundary in the simulation.

Did I get this wrong? Isn't the periodic image property supposed to change with time?
« Last Edit: June 23, 2019, 02:33:01 AM by Alexander Stukowski »

Gabriel Catalini

  • Newbie
  • *
  • Posts: 6
Re: Periodic Images in GSD file
« Reply #6 on: June 24, 2019, 12:25:58 AM »
Yes! You are right. I checked the script for that simulation and it turned out that the 'momentum' property was not in the dynamic list.
I checked other simulations where the 'particle/image' was dynamic and those seem to work fine.
I will have to be more careful with this, sorry!
Thanks for your support,

Best Regards,

Gabriel