[lammps-users] checking conservation of extended hamiltonian for rigid body nvt dynamics

Hi Donal,

thanks for pointing this out. I think it is necessary to check the conservation of the extended Hamiltonian for fix rigid/nvt, in a similar way to fix nh. Unfortunately, this calculation has not been done yet.

Steve once suggested us implement a FixRigidNH similar to FixNH, which should allow for implementing a compute_scalar() similar to that in fix_nh.cpp. I don't know if there is any better way to calculate and print out that quantity within the current implementation of fix rigid and fix rigid/nvt.

Steve and other developers may have suggestions for this. I'm willing to add this functionality to fix rigid/nvt once we know the best way to do it.

Cheers,
-Trung

Quoting Donal MacKernan <[email protected]>:

Trung - any fix can provide a compute_scalar() that
calculates/returns a single value upon request (e.g. from
a thermo output command). So you can add that
function to fix rigid/nvt directly, assuming you know
how to calculate the conservation value. Take a first
cut at the new routine and send me the updated version
to look at if you like.

Steve

Hi Steve,

here is my updated version of fix rigid/nvt with compute_scalar(). The computed energy plus the potential energy is supposed to be the conserved quantity.

More comments were also added with regards to the references.

Cheers,
-Trung

Quoting Steve Plimpton <[email protected]>:

fix_rigid_nvt.cpp (19.4 KB)

fix_rigid_nvt.h (2.08 KB)