Skip to content

Conversation

@clpetix
Copy link
Contributor

@clpetix clpetix commented May 29, 2025

This adds functionality to automatically center box for conversion to GSD rather than raise an error.

Additionally, this fixes a bug where tilts were not being converted to HOOMD-blue's convention in to_hoomd_gsd(). I believe this error went unnoticed in our unit tests because we were creating a reference to the tilt data in from_hoomd_gsd() rather than a copy.

@clpetix
Copy link
Contributor Author

clpetix commented May 30, 2025

We had another bug floating around our conversion from_hoomd_gsd. We had previously set snap.box.low equal to -L/2 which isn't correct when there is tilt since HOOMD is always centered.

I think I've ironed out all the problems with how the conversions work and have checked both orthorhombic and triclinic boxes look correct in Ovito going both directions.

@mphoward, please let me know if you see anything else that needs tweaked here!

@clpetix
Copy link
Contributor Author

clpetix commented Jun 4, 2025

@mphoward, I've applied the suggested edits! This should be ready for you to take another look!

Copy link
Contributor

@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.

Thanks! Two small suggestions to simplify the code, then this looks good to me.

@clpetix
Copy link
Contributor Author

clpetix commented Jun 4, 2025

I've made those two changes, so this should be good to go!

@mphoward mphoward merged commit fe85500 into main Jun 4, 2025
15 checks passed
@mphoward
Copy link
Contributor

mphoward commented Jun 4, 2025

Thank you!

@mphoward mphoward deleted the feature/hoomd-center-box branch June 4, 2025 17:05
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.

3 participants