Hi all,
I have recently run into a snag while using LAMMPS. My simulation creates bonds between particles (fix bond/react) and breaks some of these bonds when they are stretched (quartic bond style). I use “compute <compute_id> <group_name> property/local btype batom1 batom2” to keep track of which particles are bonded at a given time. I then use the “dump local” command to output this information in a data file. My question is simple: how do I get the number of bonds at any given time? Note Because the quartic bond style allows for bonds to be broken if the particles are far enough apart, the number of bonds in the system is not the same as the number of reactions output by “fix bond/react”. Since the output of the “compute” is an array, with the number of rows being the number of bonds, i.e., how do I get the number of rows of this “compute” output and use it in the same input script?
Here is my workflow:
For all timesteps:
- Make some bonds using bond/react, and maybe break some bonds due to quartic bond style
- Compute the number of bonds in the current time step
- Calculate how many more bonds to make based on the current number of bonds.
I hope this all makes sense, and I hope there is an easy solution to my issue. Thank you all for your time!
Cheers,