Count the number of free monomers in simulation box

Hi All,

Thank you in advance for your help!

My system is made up of many rigid bodies (determined by molecule ID) that contain ellipsoids with one ellipsoid acting as a ‘core-atom’ at the center of each rigid body. There are only non-bonded interactions in my system.

I want to calculate the number of free monomers in my simulation box throughout a single LAMMPS run and the best method I can think of for doing this is to use cluster/atom on the group of ‘core’ atoms with some constraint that says two monomers are bound if their core sites are within some distance. If I then count the number of cluster IDs in that list that only occur once I should have the number of free monomers.

The second step has been quite difficult…

My first thought was to use a python variable function (this calculation is very easy in post-processing using Python) but there doesn’t seem to be a way to use data types other than string, float, int or SELF. So inputting the per-atom vector as a list for example is not possible.

My current method is to modify the compute cluster/atom so that it does the calculation for me. Which I am working on.

My question is if any of the LAMMPS developers can think of a better way to do this calculation that I can’t see?

Thank you,


What is a “free” monomer? Is there some particle
in your system besides the rigid bodies you mention?