-
Notifications
You must be signed in to change notification settings - Fork 11
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
Bond length and angle distributions #32
Conversation
Codecov Report
@@ Coverage Diff @@
## master #32 +/- ##
==========================================
+ Coverage 99.55% 99.62% +0.07%
==========================================
Files 5 5
Lines 224 270 +46
==========================================
+ Hits 223 269 +46
Misses 1 1
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
pos1_unwrap = pos1 + (img1 * snap.configuration.box[:3]) | ||
pos2_unwrap = pos2 + (img2 * snap.configuration.box[:3]) | ||
pos3_unwrap = pos3 + (img3 * snap.configuration.box[:3]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you could use freud unwrap if you wanted to support non-orthogonal boxes, but it's not urgent
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, I thought about that as well. I say we can add that later if the need arises.
This PR creates 2 functions. One that returns the bond lengths for a given bond pair, and one that returns bond angles for a given angle triplet. It allows the user to accumulate lengths and angles over a range of snapshots for better sampling.
A quick note about handling PBCs: I chose to use the periodic images stored in the gsd file to unwrap positions before finding the bond vectors. I think the other option would be to check if a vector is larger than half the box and correct it using the box length, but I'm not sure how to do that if we don't have a cubic volume. IMO, unwrapping the relevant positions first seems like the best option.