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

refactor: Automatically update types in ForceComposite::update #1440

Merged
merged 1 commit into from Nov 29, 2022

Conversation

b-butler
Copy link
Member

Description

Update types in ForceComposite::update.

Motivation and context

@joaander mentioned in a PR (where I assumed this already happened) that this would be a good change to introduce.

Resolves #???

How has this been tested?

Existing tests are likely sufficient.

Change log

Changed: `hoomd.md.constrain.Rigid` now updates constituent particle types each step.

Checklist:

@b-butler b-butler requested review from a team as code owners November 28, 2022 19:04
@b-butler b-butler requested review from tommy-waltmann and bdice and removed request for a team November 28, 2022 19:04
@tommy-waltmann
Copy link
Contributor

If I understand this PR correctly, it will allow users to change rigid body tags dynamically throughout the simulation. If that is something that was not previously possible, then the current tests likely aren't sufficient to cover the new feature.

@b-butler
Copy link
Member Author

Nope, this PR just sets types on the updateCompositeParticle step like it already does for positions and orientations. In other words, this means that if the constituent types are [A, A, B] if for some reason the type was changed by a users, we would change it back to the rigid body definition.

@joaander
Copy link
Member

Previously, the code only validated the types were correct once on attaching (and again only when body definitions changed). Now it ensures that the types are always set properly to avoid user errors. This also makes the behavior more consistent: ALL keys in Rigid.body are enforced by Rigid on every timestep.

@joaander joaander added the validate Execute long running validation tests on pull requests label Nov 29, 2022
@joaander joaander merged commit 6012710 into trunk-major Nov 29, 2022
@joaander joaander deleted the refactor/rigid-updating branch November 29, 2022 17:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
validate Execute long running validation tests on pull requests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants