"group" command in LAMMPS

Hi there,

I have a question for you all about decoding the LAMMPS —

In the LAMMPS, it has a “group” command in its Package. And, its upper most number is 32, i.e., MAX_GROUP = 32 in “group.cpp” document.

Now I want to modify this command by enlarging the MAX_GROUP = 80 in “group.cpp” document. So, could you all tell me how to re-compile LAMMPS after this modification ? It looked like it was not enough to change the MAX_GROUP only, thus it still needs further decoding works, and then my goal can be realized …

Please give me a hand !!

Sincerely,

Henry2014

What do you need 80 groups for?
There is likely a simpler and more efficient way to do that same thing.

This kind of change is not a simple as you may think. The membership of atoms to groups is stored in a bitmask in the Atom::mask array, which is an array of signed 32-bit integers. If you want to change the number of groups, you would have to change the type and for 80 groups, you need to use a 128-bit integer. After that, you have to change pretty much every piece of code that uses the bitmask to be compatible with this change and make certain that you didn’t break anything in the process.
Something that is a very, VERY, VERY big challenge.

That said, chances are you don’t need this and can achieve whatever you want to do with 80 groups using the “chunk” mechanism in LAMMPS. This feature was developed specifically to address the needs that prompted people to ask for more than 32 groups. If you look through the archives, you can find previous discussions and should also find that all cases could be addressed by using chunks or some other approach.