Task #2461

Expose more info from t_atom to trajectory analysis framework

Added by Joe Jordan about 2 years ago. Updated over 1 year ago.

Target version:


Currently the functions [compute, refresh, initialize]MassesAndCharges expose the mass and charge of a group to the trajectoryanalysis framework. Both of these are just drawn straight from the t_atoms struct. In the course of computing scattering or density maps for EM, it will be useful to have direct access to the element name or atomic number. The atom type cou7ld potentially be useful as well, but I don't have a use case in mind yet.

Are there other things that should be exposed or good reasons not to expose more info to trajectoryanalysis? In particular, is there ever any case where this conditional
for (int i = pos.m.mapb.index[b]; i < pos.m.mapb.index[b+1]; ++i)
has more than a single iteration? I think this should always return a single atom by index and so it should be safe to pull more from the t_atoms struct, but if not would be interested to see where this could go wrong.

Related issues

Related to GROMACS - Task #2442: Port gmx saxs and gmx sans to c++New
Related to GROMACS - Feature #2282: Density map toolsetNew


#1 Updated by Joe Jordan about 2 years ago

  • Tracker changed from Bug to Task
  • Affected version deleted (git master)

#2 Updated by Joe Jordan about 2 years ago

  • Related to Task #2442: Port gmx saxs and gmx sans to c++ added

#3 Updated by Joe Jordan about 2 years ago

#4 Updated by Paul Bauer about 2 years ago

Shouldn't this be possible through the mtop object loaded from the topology? You can access the t_atom struct through the functions in mtop_lookup (just found out about those myself yesterday). Then you have access to the atom properties.

#5 Updated by Joe Jordan about 2 years ago

Yes, it is possible to get this info out directly from the topology in a few lines of code in the initAnalysis section. My thinking here was that it might be nice to have direct access to this data in the analyzeFrame section based on the position object. Otherwise, I think, it is necessary to create a map that connects mass and atomic number or to add it to the selection object in some way manually. I have an implementation of the map but I think it would be cleaner to just have direct access to the atom data in the position object.

#6 Updated by Gerrit Code Review Bot about 2 years ago

Gerrit received a related patchset '1' for Issue #2461.
Uploader: Joe Jordan ()
Change-Id: gromacs~master~I851c88aa1558965294bc636372f02071dbbc9b72
Gerrit URL:

#7 Updated by Joe Jordan over 1 year ago

  • Status changed from New to Closed

Also available in: Atom PDF