Pressure Computation Confusion in lammps

Dear Yijin,

Please keep the mailing list in cc.

Dear Vasily,

I replace N with N-1, which is 4-1 = 3, then pressure finally match
very well.
So I wanna make sure what N refer to if it is not the number of
particles?

"Note that the N in the first formula above is really
degrees-of-freedom divided by d = dimensionality, where the DOF value
is calcluated by the temperature compute. See the various compute
temperature styles for details. "

Sentence in bold is cited from
LAMMPS Molecular Dynamics Simulator.

DOF value for an one-atom molecule is 3, isn't it? Then total DOF of
the 4 atom system should be 3*4=12, since there are some constrains to
atoms motion, I guess there are 3, so finally N should equals to (12 -
3)/3 = 3; Does this explanation make sense? If it does, I still have
troubles with counting the number of constrains. To my knowledge,
velocity distribution is one kind of constrain.

3 DOFs are excluded from temperature calculation because they correspond
to motion of a system as a whole (other DOFs are "thermal" motion). That
was discussed in the mailing list before.

Interestingly, if I increase the number of atoms from 4 to 4000 by
changing these four lines
create_atoms 1 single 0 -0.889687 -0.889687 units box
create_atoms 1 single -0.889687 0 -0.889687 units box
create_atoms 1 single -0.889687 -0.889687 0 units box
create_atoms 1 single 0 0 0 units box
to
create_atoms 1 box

The pressure comes to be weird again.

You could try looking into the code and find out how pressure
calculation is implemented.

Best regards,
Vasily