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

Align chains along z-axis when using system.Lattice #107

Merged
merged 6 commits into from
Dec 19, 2023

Conversation

chrisjonesBSU
Copy link
Member

system.Lattice assumes that the molecule backbone is aligned down the z-axis of the box, then translates molecules along the x and y direction to build up the lattice. This doesn't work if the compounds aren't initially aligned down the z-axis. This PR adds a hidden method to Molecule which iterates over the mbuild compounds and translates them so that their backbone aligns with the z-axis. The backbone is defined as the line of best fit through the atomistic coordinates and uses cmelab/cmeutils#72 from cmeutils.

@chrisjonesBSU chrisjonesBSU added the bug Something isn't working label Dec 19, 2023
Copy link

codecov bot commented Dec 19, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (ab33ddd) 94.02% compared to head (54b7e37) 94.15%.
Report is 15 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #107      +/-   ##
==========================================
+ Coverage   94.02%   94.15%   +0.12%     
==========================================
  Files          23       23              
  Lines        1724     1745      +21     
==========================================
+ Hits         1621     1643      +22     
+ Misses        103      102       -1     
Files Coverage Δ
flowermd/base/molecule.py 96.77% <100.00%> (+0.19%) ⬆️
flowermd/base/system.py 91.95% <100.00%> (+0.05%) ⬆️
flowermd/library/polymers.py 100.00% <100.00%> (+1.33%) ⬆️

@marjanalbooyeh marjanalbooyeh merged commit d0f77d6 into cmelab:main Dec 19, 2023
4 checks passed
@chrisjonesBSU chrisjonesBSU deleted the align-chains branch December 20, 2023 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants