Warnings about fix rigid and fix rigid/nve

Dear all
I set up a rigid ball, and when the force is applied to it, the ball moves, and I want to calculate its velocity equivalent. Here I ues fix rigid /nve command on the ball but a warnning came up

WARNING: Cannot count rigid body degrees-of-freedom before bodies are initialized (… /fix_rigid.cpp:1239)
I did not make this warnning disappear by following the methods in the LAMMPS manual.


velocity ball create 300.0 12345
run 0 # temperature may not be 300K
velocity ball scale 300.0 # now it should be
fix 2 ball rigid/nve single

I would like to ask how to solve this problem? Whether the presence of this Warnning affects subsequent results

You “solution” is incorrect. You need to do:

fix 2 ball rigid/nve single
velocity ball create 300.0 12345
run 0 post no # temperature may not be 300K
velocity ball scale 300.0 # now it should be

The warning means that the created temperature is likely to be a bit different than what you requested. Thus you can see the effect immediately by looking at the temperature of the rigid body. With the modified sequence of commands it should be. Whether this difference negatively impacts your simulation results is very difficult to say from remote and without knowing more. Most likely not a lot, if at all.

Thanks