Skip to content

Conversation

@mzbush
Copy link
Contributor

@mzbush mzbush commented Feb 9, 2026

Description

In the thermalize rigid body particles step, there is a potential division by zero if a rigid body has particles that have zero mass.

Motivation and context

This allows for rigid bodies to have constituent particles that do not participate in the MPCD collision step and have zero mass.

Resolves #2223

How has this been tested?

A pytest has been added to check for this error to future proof the code.

Checklist:

  • I have reviewed the Contributor Guidelines.
  • I agree with the terms of the HOOMD-blue Contributor Agreement.
  • My name is on the list of contributors (sphinx-doc/credits.rst) in the pull request source branch.
  • I have summarized these changes in CHANGELOG.rst following the established format.

Copy link
Collaborator

@mphoward mphoward left a comment

Choose a reason for hiding this comment

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

Looks good to me! Please add the small comment to the unit test, then this is good to go from my side. You will also need to add a changelog entry documenting the bugfix.

@mzbush mzbush requested a review from mphoward February 10, 2026 16:41
@mphoward
Copy link
Collaborator

There seems to be an issue with the MPI unit tests. Please run locally and debug. You also still need to add a changelog entry.

Copy link
Collaborator

@mphoward mphoward left a comment

Choose a reason for hiding this comment

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

Looks good to me, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Division by zero in collision method

2 participants