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

Fix operator transformation from body frame to lab frame #4683

Merged
merged 1 commit into from
Mar 9, 2023

Conversation

mebrito
Copy link
Contributor

@mebrito mebrito commented Mar 9, 2023

Partially fixes #4667

Description of changes:

  • Fix operator transformation
  • Add unit test

Fix bug in convert_body_to_space().
@jngrad jngrad changed the title core: Correct multiplication order in transformation Fix operator transformation from body frame to lab frame Mar 9, 2023
Copy link
Member

@jngrad jngrad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@jngrad jngrad added this to the Espresso 4.2.1 milestone Mar 9, 2023
@kodiakhq kodiakhq bot merged commit 0ab8ad4 into espressomd:python Mar 9, 2023
@@ -189,6 +189,38 @@ BOOST_AUTO_TEST_CASE(propagate_omega_quat_particle_test) {
}
}

BOOST_AUTO_TEST_CASE(convert_operator_body_to_space_test) {
auto constexpr sqrt_2_half = Utils::sqrt_2() / 2.0;
// rotation around z-axis by pi/2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry that I am late but what does rotation around z-axis mean here?
I do not get the test

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a typo in the comment. The quaternion actually describes a rotation around the y-axis. This can be fixed as part of the 4.2.1 release spellcheck or as part of the fix for #4667. The idea behind this test is to make sure the old behavior is not re-introduced by mistake. As I understood it , the behavior in ticket #4667 is actually caused by two bugs: the rotation matrix was incorrectly applied (the particle quaternion describes the rotation from the z-axis to the director, so we need to revert the direction) and the prefactor was not transformed.

jngrad pushed a commit to jngrad/espresso that referenced this pull request Mar 21, 2023
…4683)

Partially fixes espressomd#4667

Description of changes:
- Fix operator transformation
- Add unit test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Langevin thermostat with anisotropic friction is broken
3 participants