Hi everyone,

I use fix rigid/nve with langevin thermostatting. I have a hybrid model with two types of rigid bodies and one non-rigid particle type.

I output the temperature of all the rigid bodies in two ways:

- output the global scalar of fix rigid using “thermo_style”
- compute the temperature of all rigid particles using “compute temp”

I was expecting the temperature outputs to be the same based on how I interpreted the lammps manual (degrees of freedom changes due to fixes are taken into account).

Below are the descriptions from lammps doc:

*fix rigid:*

*The rigid and rigid/small and rigid/nve fixes compute a global scalar which can be accessed by various output commands. The scalar value calculated by these fixes is “intensive”. The scalar is the current temperature of the collection of rigid bodies. This is averaged over all rigid bodies and their translational and rotational degrees of freedom.*

*compute temp:*

*This compute subtracts out degrees-of-freedom due to fixes that constrain molecular motion, such as fix shake and fix rigid. This means the temperature of groups of atoms that include these constraints will be computed correctly.*

However, when I compare the two temperature outputs, I see that thermo_style output is the scaled version of compute temp by a constant.

If I remove one of the rigid body types from the system (i.e. if I remove group “solvent” below), the two commands give the same temperature. It is as if there is a dof related difference between the two temperatures if I have more than one type of rigid bodies.

Any comments to help me understand the output/see what I am missing is very much appreciated. I use the 16Apr15 version of LAMMPS.

Please find a test script and data file attached. The temperatures I expected to be the same are “TCationSolv” and “f_2”.

Best,

Betul

test.txt (213 KB)

in.test (1.71 KB)

Hi everyone,

I use fix rigid/nve with langevin thermostatting. I have a hybrid model with

two types of rigid bodies and one non-rigid particle type.

I output the temperature of all the rigid bodies in two ways:

1) output the global scalar of fix rigid using "thermo_style"

2) compute the temperature of all rigid particles using "compute temp"

I was expecting the temperature outputs to be the same based on how I

interpreted the lammps manual (degrees of freedom changes due to fixes are

taken into account).

Below are the descriptions from lammps doc:

fix rigid:

The rigid and rigid/small and rigid/nve fixes compute a global scalar which

can be accessed by various output commands. The scalar value calculated by

these fixes is "intensive". The scalar is the current temperature of the

collection of rigid bodies. This is averaged over all rigid bodies and their

translational and rotational degrees of freedom.

compute temp:

This compute subtracts out degrees-of-freedom due to fixes that constrain

molecular motion, such as fix shake and fix rigid. This means the

temperature of groups of atoms that include these constraints will be

computed correctly.

However, when I compare the two temperature outputs, I see that thermo_style

output is the scaled version of compute temp by a constant.

If I remove one of the rigid body types from the system (i.e. if I remove

group "solvent" below), the two commands give the same temperature. It is as

if there is a dof related difference between the two temperatures if I have

more than one type of rigid bodies.

Any comments to help me understand the output/see what I am missing is very

much appreciated. I use the 16Apr15 version of LAMMPS.

your observation is correct. the problem is that the scalar computes

in the fixes you mention currently don't account for the fact that

linear rigid bodies only have 5 degrees of freedom instead of 6.

strangely enough the method computing the degrees of freedom removed

by the fixes does handle this case, so it should be possible to make

the information reported by those fixes consistent again.

axel.

please try out the attached patch, relative to the 15May2015 version,

that should improve the situation.

axel.

lammps-rigid-scalar-compute-fix.diff.gz (1.26 KB)

Thank you so much Axel, everything seems fine with the patch.

Just to make sure, the patch didnot affect thermostatting (langevin thermostat works fine without the patch) right?

Best,

Betul

Thank you so much Axel, everything seems fine with the patch.

Just to make sure, the patch didnot affect thermostatting (langevin thermostat works fine without the patch) right?

fix langevin does not use any information from the rigid fixes.