Masses missing from TNG specification
I've been playing around with the tng format and noticed that there is no block_id for masses. For analysis this is pretty fundamental to have.
Have I missed where it's stored, or is it a deliberate choice to save space in the file?
You could probably guess the mass for most "mainstream" forcefields, but for others (weird names and/or coarse-grained?) it is required. Something like a mapping of atomtype to mass might be a low-space way of providing this.
Added data block for atom masses.
Added a block ID for atom masses and a test for reading
Also made a minor update to the test for writing partial
charges to keep it in line with the test for atom masses.
#1 Updated by Berk Hess over 2 years ago
- Tracker changed from Bug to Feature
- Status changed from New to Accepted
- Priority changed from Normal to High
I agree we need masses. These should be stored in the tng file, not looked up based on atomtype, since that is asking for trouble.
I don't know why these were not planned from the start. It should be easy to add those to the tng_atom struct. I don't know if that requires a file format specification change.
The main issue is that we currently don't have anyone responsible for tng.
#3 Updated by Magnus Lundborg over 2 years ago
- Project changed from GROMACS to TNG trajectory library
- Assignee set to Magnus Lundborg
This should be quite straight-forward to add. It will just be a matter of adding another block type for atom masses (similar to e.g. charges, as Max said above). Then the masses can be constant during the simulation (the most common scenario) or change over time. The new data block will of course be readable also by older versions of the library, but the data block ID will not be defined in the library header (of older versions of the library).
I could try looking into it next week.
#4 Updated by Berk Hess over 2 years ago
Somewhat unrelated, at the GROMACS workshop it was said that TNG has the atoms and bonds of the system. To me, and maybe others, that gave the impression that GROMACS stores all that information in the tng file. But I can't find anything in the code. Is the situation that the TNG format supports it, but mdrun currently only writes x,v,f and box?