LAMMPS WWW Site - LAMMPS Documentation - LAMMPS Mailing List Archives
Re: [lammps-users] molindex and identifying atoms on the same molecule
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lammps-users] molindex and identifying atoms on the same molecule

From: Axel Kohlmeyer <akohlmey@...24...>
Date: Sun, 26 Nov 2017 23:09:56 -0500

On Sun, Nov 26, 2017 at 9:25 PM, Jeff Towers <jeff.towers66@...24...> wrote:
Dear LAMMPS users and developers,

I am trying to add a new compute to LAMMPS, and I need to be able to identify which atoms are part of the same molecule.

Under atom_style "full", the molecule number of each atom is defined in the data file so I am thinking to do a comparison of molecule numbers for each atom. I would like to ask:

Is the molecule number assigned to each atom held in atom->molindex?


The array is empty when called from a typical compute like
  compute_pe_atom.cpp's ComputePEAtom::compute_peratom()
  compute X/tally

​if you'd looked closer at compute_pe_mol_tally.cpp,​ you'd have seen, that what you are looking for is stored in atom->molecule and that when atom->molecule_flag is non-zero, this information is available.


p.s.: please note, that molecule IDs in LAMMPS are purely indicating molecules by convention and thus may not be tied to individual molecules at all.


In each case I get
(gdb) print(atom->molindex)
$1 = (int *) 0x0

My guess is that either

(1) An array different to molindex holds the molecule-member information
(2) Lammps doesn't hold molecule-member information beyond the initial read_data (in which case, any suggestion about a different way to do this would be appreciated)
(3) molindex is correct but I need to do something to make this information available within the computes above.

I would really appreciate any guidance on this issue.

Thank you,


Check out the vibrant tech community on one of the world's most
engaging tech sites,!
lammps-users mailing list

Dr. Axel Kohlmeyer  akohlmey@...24...
College of Science & Technology, Temple University, Philadelphia PA, USA
International Centre for Theoretical Physics, Trieste. Italy.