Skip to content

Commit

Permalink
updated opls145B; fixed unneccessary rebuilding of compound.atoms in …
Browse files Browse the repository at this point in the history
…traj.update_compound
  • Loading branch information
ctk3b committed Feb 22, 2015
1 parent f3d3636 commit 3e2e68e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
9 changes: 2 additions & 7 deletions mosdef_gomc/tools/parameterize/oplsaa.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,17 +121,12 @@ def opls_145(atom):
@Element('C')
@NeighborCount(3)
@NeighborsExactly('C', 3)
@NeighborsExactly('145', 3)
@Whitelist('145B')
@Blacklist([145])
def opls_145B(atom):
"""Biphenyl C1 """
# Store for checking neighbors outside the first ring.
ring_one = benzene(atom)
if ring_one:
for neighbor in atom.neighbors:
if neighbor not in ring_one:
if benzene(neighbor):
return True
return True


@Element('H')
Expand Down
9 changes: 4 additions & 5 deletions mosdef_gomc/trajectory.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,11 @@ def from_compound(cls, compound, show_ports=False, **kwargs):
return traj

def update_compound(self, compound, frame=0):
assert(isinstance(compound, Compound))
assert isinstance(compound, Compound)

for chain in self.topology.chains:
for res in chain.residues:
for atom in res.atoms:
compound.atoms[atom.index].pos = self.xyz[frame, atom.index]
atoms = compound.atoms
for atom in self.topology.atoms:
atoms[atom.index].pos = self.xyz[frame, atom.index]

def to_compound(self, part=None, frame=0):
if part is None:
Expand Down

0 comments on commit 3e2e68e

Please sign in to comment.