Fix bond/react Error: Compute fragment/atom used when bonds are not allowed

Hi there,

I was looking for some information on the following error I am receiving while attempting to use fix bond/react. As a note, I am attempting to bond two monomers while utilizing ReaxFF (Vashisth et al. 2018. CHON2017_weak_bb.ff). I have successfully simulated mixing of the monomers, but now need to begin crosslinking.

The error I get:

“Compute fragment/atom used when bonds are not allowed. Last command: fix 3 all bond/react…”

Looking into the src for fix bond/react I found this command which outputs that error message:

“if (atom->avec->bonds_allow == 0)
error->all(FLERR,“Compute fragment/atom used when bonds are not allowed”);”

I believe this means that in my pre- and post-reaction templates I need to include at a minimum the atoms, atom coords, and bonds for fix bond/react to work? As such, neither can be blank/not included? Is this a correct interpretation of this error? If not, a better explanation would be greatly appreciated!

I tested this by removing everything except for Atoms, Coords, and Bonds in the templates for the example from PACKAGES/reaction “in.tiny_epoxy.stabilized” and the code ran, but removing Bonds caused the code to crash (with a different error but not important for this discussion).

Initially, I did not include bond information since ReaxFF does not require it. As such, I included the bond information for the pre-reacted template as a test, which leads to the following error message due to the molecule file instead:

“Invalid bond type in Bonds section of molecule file. Last command: molecule mol1 pre_reacted”

As such, the code is crashing prior to fix bond/react due to the molecule file if I include bonds. I utilized VMD topo guessbonds to get the bonding information for the individual monomers and then superimposed them to create the bond information for the template. I believe my issue is due to the Bonds information conflicting with ReaxFF since it does not require said information? In other words, is the issue due to the fact that I’m using VMD to print out LAMMPS style bonding information which conflicts with ReaxFF? As a note, if I change the Bond type to 1 for all bonds in the “in.tiny_epoxy.stabilized” example files, it still runs, so this is what leads me to believe it is a ReaxFF combined with Bonds issue in the template files and not simply that they are all type 1.

Here is a snippet of the molecule file:


31 atoms
30 bonds


1 1
2 1
3 1

1 -1.23049495 0.20151752 -0.43120249
2 -0.44650405 -1.41418813 1.28705912
3 0.89398713 -1.18685574 0.92342482
4 1.23614647 -0.25303866 -0.12672459

1 1 1 5
2 1 2 3
3 1 2 11
4 1 3 4

Finally, here is the section of my code for fix bond/react. I took the entry in the manual and modified it.

molecule mol1 pre_reacted.txt
molecule mol2 post_reacted_1.txt
molecule mol3 pre_reacted_2.txt
molecule mol4 post_reacted_2.txt

fix 3 all bond/react stabilization yes nvt_grp 0.1 &
react myrxn1 all 1 0 4.0 mol1 mol2 rxn1_map_file.txt custom stabilize_steps 100 &
react myrxn2 all 1 0 4.0 mol3 mol4 rxn2_map_file.txt custom stabilize_steps 100

fix 2 nvt_grp_REACT nvt temp 300 300 10
fix 4 bond_react_MASTER_group temp/rescale 1 300 300 10 1

Any help on the errors would be greatly appreciated! I believe my issues are utilizing fix bond/react with ReaxFF, but hopefully this is not the issue and I have made a silly mistake in my Bond information for the template files.



Using fix bond/react in combination with ReaxFF makes no sense.

Thank you for the very prompt response - this is pretty much the conclusion I was coming to while working through the issues.

With that said, is there anything similar to fix bond/react in LAMMPS that would work for ReaxFF or would this have to be developed as a new command in LAMMPS? I know SCM’s Bond-Boost in AMS 2021 as well as Dr. van Duin’s for ReaxFF standalone are alternatives for crosslinking using ReaxFF; however, the additional capabilities of LAMMPS far surpasses the other two software currently for what is required for my research.



If there was, it would be documented in the manual.

The ReaxFF implementation in LAMMPS was developed independently from the van Duin code. Thus it will always take time and some volunteer to port features over (or rather re-implement them from the publications).