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

Revamp Ellipsoid Class, use fixed bonds. #191

Open
wants to merge 17 commits into
base: main
Choose a base branch
from

Conversation

chrisjonesBSU
Copy link
Member

@chrisjonesBSU chrisjonesBSU commented Feb 28, 2025

The ellipsoid chain features currently in flowerMD are quite "experimental", and after doing a deeper dive with @StephMcCallum there are clearly some issues with the approach we used initially (rigid bodies + ghost particles) that make the model unstable and difficult to get up and running.

After chatting a bit, we think it would be worth revamping these classes in flowerMD to start with a more simple approach. The model here now uses fixed bond lengths between the tips of 2 bonded ellipsoids. A single ghost particle is used between ellipsoids that will handle both fixed bonds, and enforcing a 2-body angle potential (ellipsoid_center - ghost at tip- ellipsoid_center). Rigid bodies are no longer used in this approach.

Here is a minimal example:

from flowermd.library import EllipsoidChain, EllipsoidForcefield
from flowermd import Pack, Simulation
from flowermd.utils import set_bond_constraints

chain = EllipsoidChain(lengths=30, num_mols=1, lpar=1, bead_mass=1)
system = Pack(molecules=chain, density=0.01, packing_expand_factor=25)
constrain_snap, d_constraint = set_bond_constraints(system.hoomd_snapshot, constrain_value=1.0, bond_type="_C-_H")
forces = EllipsoidForcefield(epsilon=1.0, lpar=1.0, lperp=0.5, r_cut=3.0, angle_k=10, angle_theta0=2.2)

sim = Simulation(initial_state=constrain_snap, forcefield=forces.hoomd_forces, constraint=d_constraint, gsd_write_freq=5000)
sim.run_NVT(kT=1.0, n_steps=500000, tau_kt=100*sim.dt)

Copy link

codecov bot commented Feb 28, 2025

Codecov Report

Attention: Patch coverage is 97.95918% with 1 line in your changes missing coverage. Please review.

Project coverage is 92.08%. Comparing base (a600b73) to head (50ec78d).
Report is 58 commits behind head on main.

Files with missing lines Patch % Lines
flowermd/base/simulation.py 90.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #191      +/-   ##
==========================================
- Coverage   94.77%   92.08%   -2.69%     
==========================================
  Files          26       26              
  Lines        1970     2048      +78     
==========================================
+ Hits         1867     1886      +19     
- Misses        103      162      +59     
Files with missing lines Coverage Δ
flowermd/library/forcefields.py 95.45% <100.00%> (-0.08%) ⬇️
flowermd/library/polymers.py 100.00% <100.00%> (ø)
flowermd/utils/__init__.py 100.00% <100.00%> (ø)
flowermd/utils/constraints.py 32.00% <100.00%> (ø)
flowermd/base/simulation.py 90.79% <90.00%> (-1.23%) ⬇️

@StephMcCallum
Copy link
Contributor

On my initial run with the minimum working example, I am seeing that the _H-_C-_H are bending. Do we want these to stay rigid for the body of the ellipsoid?

Screenshot 2025-03-02 at 2 00 46 PM

There also appears to be one _H missing on the beginning of the chain (or maybe an extra one on the end).

@chrisjonesBSU
Copy link
Member Author

Yeah I'm noticing the same thing..so we'll probably have to use rigid bodies still.

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.

2 participants