chemfiles: Lammps dump properties not found.
I am using chemfiles to read lammps dump files as a replacement for a reader that I have written as I would like to have a generic reader that can handle many formats. Lammps is however, the most important one at the moment. I find that chemfiles returns an empty list when I call frame.list_properties and returns 0 when I call frame.properties_count. However, if I call frame.velocities or frame.positions it does return the velocities and positions. Even the frame.has_velocities returns true.
Perhaps I have misunderstood how the properties work but when looking through the cpp code I noticed that chemfiles does in fact read additional properties from the data and I believe the charges on the atoms were also stored correctly. I would like to be able to access any of the properties in the dump, including custom ones. The code appears to do this but I cannot get the api to access them.
the header of the file is:
ITEM: TIMESTEP
100
ITEM: NUMBER OF ATOMS
1600
ITEM: BOX BOUNDS pp pp pp
0.0000000000000000e+00 3.1134167999999999e+01
0.0000000000000000e+00 3.1134167999999999e+01
0.0000000000000000e+00 3.1134167999999999e+01
ITEM: ATOMS id mol type element q x y z ix iy iz
I also frequently will dump forces, energy, or stresses along with the data.
My input script is quite simple.
>>> from chemfiles import Trajectory
>>> data = Trajectory('test_data/dump.lammpstrj')
>>> frame = data.read()
>>> frame.nsteps
4
>>> frame.has_velocities()
True
>>> frame.list_properties()
[]
>>> frame.properties_count()
0
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 24 (11 by maintainers)
Appears to have worked!
I also see what you were trying to explain now… It was just checkout out the correct branch on the chemfiles core library then installing the python package.
I ran a test on a system with forces and it returns them correctly.