Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rotational degrees of virtual sites do not contribute to kinetic energy #3596

Closed
fweik opened this issue Mar 25, 2020 · 0 comments · Fixed by #4198
Closed

Rotational degrees of virtual sites do not contribute to kinetic energy #3596

fweik opened this issue Mar 25, 2020 · 0 comments · Fixed by #4198

Comments

@fweik
Copy link
Contributor

fweik commented Mar 25, 2020

From energy_inline.hpp:

inline void add_kinetic_energy(Particle const &p1) {
  if (p1.p.is_virtual)
    return;

...

    // Note that rotational degrees of virtual sites are integrated
    // and therefore can contribute to kinetic energy
#ifdef ROTATION
  if (p1.p.rotation) {
 ...

The situation is actually more complicated, because this depends on the virtual sites
parameters. Maybe VirtualSites::m_have_quaternion should be dropped in favor of
obeying the rotation flag of the virtual particle. Also there is of course no test.

@RudolfWeeber RudolfWeeber added this to the Espresso 4.2 milestone Nov 18, 2020
@kodiakhq kodiakhq bot closed this as completed in #4198 Apr 9, 2021
kodiakhq bot added a commit that referenced this issue Apr 9, 2021
Fixes #3596.

This is a fix closest to the existing behavior. I think there should be a discussion here how
to handle active/inactive degrees of freedom, and if this should be consistent between
translation and rotation, and how it should interact with the virtual sites relative feature.

Description of changes:
- Don't drop rotational kinetic energy of virtual particles.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants