I want to monitor the minimum distance between a rigid body surface and a wall. What would be the best way doing this? I was thinking of doing this in postprocessing but I should dump the trajectories at every timestep as the rigid body is not a smooth sphere so its rotation changes the distance. I would appreciate any pointer.

I want to monitor the minimum distance between a rigid body surface and a
wall. What would be the best way doing this? I was thinking of doing this in
postprocessing but I should dump the trajectories at every timestep as the
rigid body is not a smooth sphere so its rotation changes the distance. I
would appreciate any pointer.

what do you need this information for?

i cannot think of a purpose that you would need the single absolute
minimum number. that would be impossible to obtain anyway, since you
are using a finite time step. so it would only make sense to collect a
distance distribution and then postprocessing is not a problem and you
don't need frequent dumps, since those would have low statistical
relevance anyway.

If the wall is flat, isn't this just the max (or min) coord
of one of the body atoms? If so, then compute reduce
on the group of atoms in the body could work.