Dear all,

I am currently messing with the compute_temp_* and compute_press codes

and, inspired by the thread started by Giacomo Saielli

http://lammps.sandia.gov/threads/msg35483.html , I think there's

something not yet clear about the degrees of freedom used for

temperature and pressure computations.

When computing its global scalar, the ComputePress class solves the

pressure as

temp->dof / 3.0 * force->boltz * temp->scalar / volume (+virial terms)

I think this was intended to correctly take into account the

constrained

translational degrees of freedom due to fix_rigid or alike.

But when the temperature takes into account extra degrees of freedom

such as rotations (temp/(a)sphere), the formula above will not yield the

_real_ pressure. For an indeal gas PV=NKT independently of the

rotational

and vibrational degrees of freedom of its molecules!

I think the ComputePess class must be provided a

ComputePress::compute_dof() method to compute its own translational dof

and it must be possible to modify its extra constrained dof by means of

the fix_modify extra command applied directly to the pressure compute

instead of the termperature compute. Then the pressure will be the same

whatever dof are used by whatever temperature compute if the computed

temperature is the same.

It could simply be translational_dof = 3 * natoms - extra_dof - fix_dof,

just like the simple ComputeTemp does. I would do it myself, but I

wouldn't know how to handle rigid bodies.

What do you think?