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

Visualization: dihedrals connectivity #2677

Merged
merged 6 commits into from
Apr 24, 2019
Merged

Conversation

jngrad
Copy link
Member

@jngrad jngrad commented Apr 8, 2019

Visualizers currently represent proper dihedral bonds (A-B-C-D connectivity, aka torsion angle) as improper dihedral bonds (A-B(-C)-D connectivity, aka out-of-plane angle), causing some confusion when setting up linear polymers. This PR introduces a conditional statement to correctly treat bond connectivity in dihedral interactions.

MWE: re-use /samples/visualization_bonded.py, with box_l = 200, n_part = 20, then add

from espressomd.interactions import Dihedral
dihedral = Dihedral(bend=10, mult=1, phase=np.pi)
system.bonded_inter.add(dihedral)
for i in range(1, n_part - 3):
    system.part[i].add_bond((dihedral, system.part[i - 1].id, system.part[i + 1].id,
        system.part[i + 2].id))

right before the minimization step. Without this PR, the polymer looks like a spiderweb. With this PR, the polymer looks like beads on a string, and the magenta segments (bonds) perfectly overlap with the orange segments (dihedrals). I've tested it in OpenGL but not in MayaVi (cannot run the mayavi module in my environment because of an issue with the wx module, it has nothing to do with espresso).

@KonradBreitsprecher could you please run the MWE in both visualizers as part of the code review?

@codecov
Copy link

codecov bot commented Apr 8, 2019

Codecov Report

Merging #2677 into python will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@          Coverage Diff           @@
##           python   #2677   +/-   ##
======================================
  Coverage      80%     80%           
======================================
  Files         508     508           
  Lines       27055   27055           
======================================
  Hits        21843   21843           
  Misses       5212    5212

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ca2e5f9...3c4e073. Read the comment docs.

@RudolfWeeber
Copy link
Contributor

@fweik, why did you assign me?

@fweik
Copy link
Contributor

fweik commented Apr 9, 2019

Because somebody has to manage this?

@RudolfWeeber
Copy link
Contributor

RudolfWeeber commented Apr 9, 2019 via email

@KonradBreitsprecher
Copy link
Contributor

Thanks for the MWE, will test it.

@jngrad
Copy link
Member Author

jngrad commented Apr 10, 2019

Update: the mayavi2 GUI works in my environment, the issue only comes when espresso makes it call the wx plugin. pip3 install wxPython --user fails because gtk+-3.0 is missing. pip3 install -f https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-18.04/ wxPython --user worked, but now there is an API error when loading the wx plugin from mayavi in espresso.

@RudolfWeeber
Copy link
Contributor

@KonradBreitsprecher ?

Copy link
Contributor

@KonradBreitsprecher KonradBreitsprecher left a comment

Choose a reason for hiding this comment

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

Tested the openGl part, no more bond 'spiderweb' there.

MayaVi code cannot be tested on Ubuntu 18.04 at this moment (espressomd#2704).
@jngrad
Copy link
Member Author

jngrad commented Apr 17, 2019

@RudolfWeeber @KonradBreitsprecher I've removed the MayaVi fix since we cannot know if it works.

@mkuron
Copy link
Member

mkuron commented Apr 17, 2019

Try Ubuntu 16.04 in a virtual machine. That has working mayavi packages.

@jngrad
Copy link
Member Author

jngrad commented Apr 18, 2019

Tried Ubuntu 16.04 in a VM, mayavi still segfaults. Used mayavi 4.4.3 (from apt), then 4.5.0 (from pip), with traits 4.5.0, then 4.6.0.

@mkuron
Copy link
Member

mkuron commented Apr 18, 2019

The version from Apt used to work about a year ago. Does the minimal example from #2704 (comment) also segfault?

@mkuron
Copy link
Member

mkuron commented Apr 18, 2019

By the way, the Mac version does not segfault.

@jngrad
Copy link
Member Author

jngrad commented Apr 18, 2019

I've used your MWE to test multiple versions of mayavi. Where can I find our VM image for Mac?

@RudolfWeeber
Copy link
Contributor

@jngrad, could you please re-introduce the Mayavi fix and test it on someone's Mac at the ICP (@KaiSzuttor, @mkuron).
Then this PR can be finalized.

@fweik fweik added the Next label Apr 24, 2019
@fweik fweik merged commit 707a014 into espressomd:python Apr 24, 2019
@mkuron mkuron mentioned this pull request Apr 25, 2019
4 tasks
@jngrad jngrad deleted the torsion-visu branch January 18, 2022 12:11
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.

5 participants