Hi,
I need to use more groups than its restricted by lammps. Maximum one can use 32 groups including "all". I tried to modify "group.cpp" by changing MAX_GROUP define parameter. However later I found that bitmasking would fail by doing so. I guess the way it works is like following: first it creates bitmask[igroup] for all the groups such that the binary expression should involve only one 1 and the rest 0. Obviously this means one can offer only these numbers - 1, 2, 4, 8, 16, 32, 64, 128,...2^31 - to the bitmask[igroup] where igroup can be from 0 to 31. Then using the OR bit operation it changes mask[i] of the atom to bitmask[igroup] - for example first 10 atoms could be assigned to igroup = 3 i.e. mask[i] of all those first atoms would be 8 (2^3). Now any atom not lying in the igroup=3, whose binary expression is not 1000, would give the value 0 when AND operation is performed with mask[i] and bitmask[igroup], and any atom exactly lying in igroup=3 would give the value 1 after AND operation. This is how whether any atom should perform any particular group operation in ensured.
One way to circumvent this problem would be to perform the masking in integer terms instead of binary terms, i.e. assign integer expression to bitmask[igroup] and while checking use "mask[i] && bitmask[igroup]" in place of "mask[i] & bitmask[igroup]". But the problem is its a very time consuming process, because one has to change all fix.cpp, modify.cpp, compute.cpp and so on. And also I don't know what other problems I'd face further by this.
Please help me to figure out how to increase the maximum group size.
Thanks,
Amit