A cluster is defined as a set of atoms, each of which is within the cutoff distance from one or more other atoms in the cluster. If an atom has no neighbors within the cutoff distance, then it is a 1-atom cluster.
I want to discard one atom clusters. More precisely I want to define cluster only if number of particles(N) in cluster becomes more than a cutoff (say, N>10).
On the other hand, what I am trying to implement is to dynamically achieve a predefined cluster:free ratio by varying LJ pair interaction strength iteratively.
A post-processing dependent method would require multiple rerun of LAMMPS script. I am curious if there is a smart way to get it in a single LAMMPS run.
After computing the size of the clusters, you can use the compute chunk/spread/atom command — LAMMPS documentation to turn the size of the cluster into a per-atom property. Next step is to define an atom style variable that computes a comparison of whether this number of larger that the threshold that you want. That variable will have the value 0 for atoms that are in smaller clusters and 1 for atoms that are in larger clusters.
For that variable you can do a compute reduce sum to get the count of the atoms in the larger clusters.
Finally, the ratio of the this reduction with the total number of atoms will give you the ration you are asking for. This can be computed with an equal style variable.
So it is quite tedious and requires careful debugging, but it should be possible.