[lammps-users] How to combine 'group' and 'fix reax/bonds' commands

Hi Aidan,

I was trying to combine ‘group’ and ‘fix reax/bonds’ to get the bond connection information for certain atoms and molecules, but Lammps ignored that.

What I did are the following:

(1) in the input script, I have that three commands to define my group IDs:

group COOH id <> 97 128
group 1NH3 id 129 130 131 132

group 1NH3COOH union COOH 1NH3

(2) in the later part of that script, I have this ‘fix reax/bonds’ command:

fix 5 1NH3COOH reax/bonds 1 1NH3COOH.connect

I do have a file named “1NH3COOH.connect” from the output, but the contents of that file is the same as the one generated by “fix 2 all reax/bonds 1 all.connect”. I have other molecules/atoms in the system, but I just want to receive the bond connection information of that one NH3 with the eight COOH groups.

It seems that Lammps with reax FF does not follow the script.

Any comment?

Thanks in advance.

Paul

Hi Aidan,
I was trying to combine 'group' and 'fix reax/bonds' to get the bond
connection information for certain atoms and molecules, but Lammps ignored
that.

and a quick look at the source code of fix_reax_bonds
confirms that it does not use the groupbit information anywhere,
i.e. that indeed no selection by group is performed.
[...]

It seems that Lammps with reax FF does not follow the script.
Any comment?

what a fix does with the group information is up to the
implementation of the fix. you would have to add group
handling to it. however, from the very superficial look
that i had at the code it is not entirely straightforward
to me, how this would be implemented in a clean and
meaningful fashion.

at the moment, you may be better off to postprocess
the resulting file.

cheers,
    axel.

Alex,

Thanks for pointing that out. Yeah, I need to post process the result. There seems to be no shortcut at this moment.

Best wishes
Paul

Yes, it is hard coded to operate on the ALL group. It is easy to modify the
code to operate on the specified group. Just add the condition:

       if (mask[i] & groupbit) {
        }

to the loop on iparticle. To do it right requires some extra work, reducing
array allocations, etc.

Aidan

Aidan,

Thanks for sharing that. It would be good to include that function into the code, especially when reax FF is used to predict reactions.

Best,

Paul

We looked at the code - it's a non-trivial change to do it right, so we'll
add it to the to-do list. But all the info you want is there
in the output - I would just sub-select what you want for
now.

Steve