[lammps-users] :Group Issue

Hi,
I will go by bullets to describe my problem.

  • The number of groups including ‘all’ is limited to 32 and i need more than that with low frequency of some values related to those group say center of mass.

  • What i am trying to do is group and ungroup and keep things running in between and get my data.

  • I tried to add ‘ungroup’(following the command ‘clear’) as a command so that i can create new groups in between runs (following the command ‘clear’). I added ‘a delete group’ in a newly created function to be called from lammps.cpp. I am not sure of anything else to make sure the no memory related to group does exist anymore.

  • While this allows more groups to be created there are some memory still left as a result if a create a group with one atom it says it has 125 atoms (say). I am not sure how to clear this memory.

  • I tried ‘clear’ command and then things are fine. But then the problem is if i use a restart file the group information is stored and i am back to square one.

  • If i use my initial datafile with ‘clear’ command while the group issue is solved i am not getting forward in terms of simulation time.
    So i am unable to find a way to do this, basically to make work the ‘ungroup’ thing. Or if there is any other way out to handle what i am trying to do. Any suggestion/comments/advice with regards to this is appreciated. Thanking in advance.

Thanks
Arnab

Arnab Chakrabarty
Graduate Student
Chemical Engineering
Texas A & M University

Why do you need more than 32 groups? Do you need
more at one time, or only over time. Several commands
in LAMMPS (e.g. fix rigid) work on many collections of
atoms (many more than 32), but don't use groups to
identify them.

Steve

Hi,
       Thanks for your reply Steve. I need groups only over time. What i am trying to do is to see if i can quantify the polymer entanglement. In order to do that i am trying to compute the center of mass of each monomer building a chain of polymer. To address atleast some monomer (to define the backbone) of each chain the total number goes over 32. Now since this movement i presume is not that fast i can save this information every picosecond instead. Now this may not be the best way (in fact a very inefficient way it seems) but what i was trying to do here is get groups of a chain save it at time t=0 fs (say) and then t = 1ps. In between ungroup these and regroup some different chain and save it's information at t=100 fs and then at t = 1.1 ps and so on. So at some point of time i may not need 32 groups but over time it adds up to more than 32.

Thanks
Arnab

Arnab Chakrabarty
Graduate Student
Chemical Engineering
Texas A & M University

Steve Plimpton wrote:

Hi Arnab,

This might be something you would want to analyze with pizza after
performing the simulation in LAMMPS.

Naveen

Hi,
                   Thanks Naveen for your suggestion. That is always an option. But the reason i am trying to avoid this as that will take a lot of space (dumping co-ordinates of all the atoms as oppose to just the center of mass of large groups) and will restrict the number of data points for analysis.

Thanks
Arnab

Arnab Chakrabarty
Graduate Student
Chemical Engineering
Texas A & M University

[email protected] wrote:

Ahh, I didn't realize that you were trying to avoid saving a trajectory.

There is one other possible way that doesn't involve groups - but it will
require you to implement a new fix. If you structure your data file in a
way that each "group" of atoms (corresponding to one monomer) has a
separate molecule number, you can create an array of size Nx3 (for N
molecules) for the center of mass of each monomer, and another array of
size N for the number of atoms in each monomer.

Every timestep iterate through all the relevant atoms (possibly by putting
them all into a group if you have other atoms, like solvent, that should
be ignored), using the molecule number as an index for the center of mass
array, and keep a running center of mass. After iterating through all
atoms, divide each center of mass coordinate by the total count array for
each molecule (you can build this up in the fix's setup code) and you'll
have an array for the center of mass of each monomer, which you can write
out to a file.

You can use the center of mass fix as a framework (which shows how to
properly account for periodicity by using the box flags)

Naveen

Hi,
       Thanks Naveen for your suggestion. This should work.

Thanks
Arnab

[email protected] wrote:

What Naveen suggested is what fix rigid molecule does. It
identifies rigid bodies by common moleucule IDs rather than
groups. So you can write your own fix, say fix com/molecule,
using fix com as a pattern and cluster your atoms any way
you wish (by molecule ID, atom ID, etc).

Steve

Hi,
Thanks Steve for your input. I will then code something similar to fix com and i will look into fix rigid too. The reason i am not using fix rigid directly as per my understanding it will treat that molecule as a rigid one which i don’t want. But as you mentioned since the clustering here is nongroup basis (like molecules and atoms) i think i should follow the same for the clustering issue in the new fix.

Thanks
Arnab