Skip to content

Commit

Permalink
fix forcefield params
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisjonesBSU committed Mar 6, 2025
1 parent c7c7347 commit 658f729
Showing 1 changed file with 12 additions and 15 deletions.
27 changes: 12 additions & 15 deletions flowermd/library/forcefields.py
Original file line number Diff line number Diff line change
Expand Up @@ -611,32 +611,29 @@ def __init__(

def _create_forcefield(self):
forces = []
# Bonds
bond = hoomd.md.bond.Harmonic()
bond.params["A-X"] = dict(k=50, r0=1.0)
forces.append(bond)
# Angles
if all([self.angle_k, self.angle_theta0]):
angle = hoomd.md.angle.Harmonic()
angle.params["_C-_H-_C"] = dict(
k=self.angle_k, t0=self.angle_theta0
)
angle.params["_H-_C-_H"] = dict(k=0, t0=0)
# angle.params["_H-_C-_T"] = dict(k=0, t0=0)
angle.params["X-A-X"] = dict(k=self.angle_k, t0=self.angle_theta0)
angle.params["A-X-A"] = dict(k=0, t0=0)
forces.append(angle)
# Gay-Berne Pairs
nlist = hoomd.md.nlist.Cell(buffer=0.40)
nlist = hoomd.md.nlist.Cell(buffer=0.40, exclusions=["body"])
gb = hoomd.md.pair.aniso.GayBerne(nlist=nlist, default_r_cut=self.r_cut)
gb.params[("_C", "_C")] = dict(
gb.params[("X", "X")] = dict(
epsilon=self.epsilon, lperp=self.lperp, lpar=self.lpar
)
# Add zero pairs
for pair in [
("_H", "_H"),
("_T", "_T"),
("R", "R"),
("_C", "_H"),
("_C", "_T"),
("_C", "R"),
("_T", "_H"),
("_T", "R"),
("_H", "R"),
("A", "A"),
("A", "X"),
("A", "R"),
("X", "R"),
]:
gb.params[pair] = dict(epsilon=0.0, lperp=0.0, lpar=0.0)
gb.params[pair].r_cut = 0.0
Expand Down

0 comments on commit 658f729

Please sign in to comment.