python interface and periodic image flags

Hi - is the list of things that can be passed as the first argument (attribute name) to scatter_atoms() documented anyplace? I want to access the periodic image flags, and I’m not sure what string to pass. The "compute property/atom” documentation lists some things, but they don’t exactly map to scatter_atoms() arguments, for example property/atom has separate x, y, and z, but scatter atom has ‘x’ as a 3-vector of positions. I might guess that “i” would work, by analogy to property/atom’s ix, iy, and iz, but it’d be nice to have a complete list someplace.

By the way, the documentation page
http://lammps.sandia.gov/doc/Section_python.html
refers to scatter_coords() in one place. Is this just an outdated thing that hasn’t been updated?

Hi - is the list of things that can be passed as the first argument
(attribute name) to scatter_atoms() documented anyplace? I want to access
the periodic image flags, and I’m not sure what string to pass. The
"compute property/atom” documentation lists some things, but they don’t
exactly map to scatter_atoms() arguments, for example property/atom has
separate x, y, and z, but scatter atom has ‘x’ as a 3-vector of positions.
I might guess that “i” would work, by analogy to property/atom’s ix, iy,
and iz, but it’d be nice to have a complete list someplace.

​you'll find the list in the function

void *Atom::extract(char *name)

​in the file atom.cpp​

​as you can see, it matches strings with corresponding pointers. if those
pointers actually contain data, depends on ​the atom style in use. so you
need to be careful, as there may be many segfaulting landmines here.

​imageflags are a somewhat tricky thing in this, since all three components
are stored in a single integer. with the default settings, you have 3
10-bit signed integers stored in a 32-bit signed integer. with
-DLAMMPS_BIGBIG, you store 3 21-bit signed integers. so you need to so some
masking and bitshifting to compose and decompose the data that is stored.

By the way, the documentation page
LAMMPS Molecular Dynamics Simulator
refers to scatter_coords() in one place. Is this just an outdated thing
that hasn’t been updated?

​possibly. i'll have a look. thanks for reporting.

axel.​

yes, the scatter_coords() was an old reference - it is now scatter_atoms().

I updated the Section python doc page and the Section howto 6.19 section

on the LAMMPS lib interface to point to src/atom.cpp::extract() for a list

of possible names.

Steve