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: Jeff Towers <jeff.towers66@...24...>
Date: Wed, 29 Nov 2017 21:47:44 +0900

Dear Axel and Steve,

Thank you both very much for elaborating further. That's very good to know.

Best,
Jeff

On Mon, Nov 27, 2017 at 10:46 PM, Axel Kohlmeyer <akohlmey@...24...> wrote:


On Mon, Nov 27, 2017 at 12:37 AM, Jeff Towers <jeff.towers66@...24...> wrote:
Dear Axel,

Thank you so much for your quick reply. That's really helpful.

I don't fully understand what you mean by "molecule IDs in LAMMPS are purely indicating molecules by convention and thus may not be tied to individual molecules at all". Would you mind elaborating further? Based on my reading of compute_pe_mol_tally, I assume that all the atoms in the same molecule will always have the same molecule ID as each other.

as mentioned, ​that is only by convention. the molecule id has no physical meaning during the simulation and thus can be used to group atoms any which way you like. the conventional use is to group atoms by molecule, however other grouping (e.g. by residue) is possible, too. some LAMMPS commands also follow the convention that isolated atoms all have the same molecule id 0. the grouping by molecule id pre-dates the "chunk" infrastructure in LAMMPS, which extends and simplifies grouping of atoms in LAMMPS.
for simple classical force fields, the determination of molecules (as atoms connected by explicit bonds) can also be done by LAMMPS itself through the fragment/atom compute.

axel.

 

Thanks again.
Best,
Jeff

On Mon, Nov 27, 2017 at 1:09 PM, Axel Kohlmeyer <akohlmey@...24...> wrote:


On Sun, Nov 26, 2017 at 9:25 PM, Jeff Towers <jeff.towers66@...36.....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?

​no.​


The array is empty when called from a typical compute like
  compute_pe_atom.cpp's ComputePEAtom::compute_peratom()
or
  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.

axel.

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,
Best,

Jeff

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
lammps-users mailing list
lammps-users@...655....net
https://lists.sourceforge.net/lists/listinfo/lammps-users




--
Dr. Axel Kohlmeyer  akohlmey@...24...  http://goo.gl/1wk0
College of Science & Technology, Temple University, Philadelphia PA, USA
International Centre for Theoretical Physics, Trieste. Italy.




--
Dr. Axel Kohlmeyer  akohlmey@...24...  http://goo.gl/1wk0
College of Science & Technology, Temple University, Philadelphia PA, USA
International Centre for Theoretical Physics, Trieste. Italy.