Energy and Force of "fix colvars"

Hello all. I am using the "fix colvars " for SMD simulation, and the constraints applied are harmonic constraints, I am very confused whether the energy and force generated by the “harmonic” at this time are included in the MD simulation, that is, does the energy generated by “thermo_style” or the force calculated by “compute group/group” include the value generated by the “harmonic”?

Hi @Tifo,

COLVAR is a complex module and it is very difficult to guess what you are doing with so few information (LAMMPS version, COLVAR version, commands etc.).

From the LAMMPS manual page of the fix colvars command:

The fix_modify energy option is supported by this fix to add the energy change from the biasing force added by Colvars to the global potential energy of the system as part of thermodynamic output. The default setting for this fix is fix_modify energy no.

So by default no information added/subtracted from the COLVAR module is included in thermo outputs As far as I can remember, COLVAR and LAMMPS instances work separately and exchange little information but you can retrieve the information missing from LAMMPS outputs in COLVAR outputs.

Best I can advise is a careful reading of the dedicated COLVAR manual for LAMMPS.

1 Like

The documentation for compute group/group makes no mention of contributions from any fixes, and so I would be very surprised if COLVARS affects it. My memory is also that the source code of compute group/group does not “poll” fixes for any potential (haha) contributions.

1 Like

You can very easily confirm this yourself, but running the exact same simulation run for just a few steps, once with fix colvars included and once without and then collect and compare all relevant data.

On top of that, since most fixes are global, per-atom interactions (i.e. forces added or modified), they make no sense to be included in compute group/group, which requires a decomposition into pairwise contributions.

1 Like

Thanks for your suggestion, I tried changing the “fix_modify energy” settings. The energy generated in COLVAR is indeed determined by this command to determine whether it is output by the “thermo_style pe” command.
However, regardless of whether this part of the energy is output or not, I found that the force exerted on the atoms constrained by springs in the COLVAR output by the “dump fx fy fz” command includes spring force, does it mean that the force generated by the spring is always output?