Dear All,

I am going to compute the number of particles whose displacements are less than a given radius over time.

Using compute displace/atom, I defined a formula as a variable to obtain whether each particle is inside the sphere (radius), and then applied summation using “compute reduce” to get the number.

variable r equal 0.4

compute d all displace/atom

variable OD atom (c_d-${r})<0

compute OF all reduce sum v_OD

fix 1 all ave/time 2 1 2 c_OF file OF_file

But the code gives this error:

“overlapDisplace: Mismatched compute in variable formula”

The error still is there if I have only:

variable OD atom c_d

I have tested other commands and styles to debug the code, but my effort was not fruitful.

Would you please guide me with this?

(I tried to calculate the quantity using a post-processing analysis, but as can be expected it requires much more memory and energy.)