Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions feflow/utils/hybrid_topology.py
Original file line number Diff line number Diff line change
Expand Up @@ -2698,14 +2698,17 @@ def _create_hybrid_topology(self):
# In the first instance, create a list of necessary atoms from
# both old & new Topologies
atom_list = []
# iterate once over the topologies for speed
old_topology_atoms = list(self._old_topology.atoms())
new_topology_atoms = list(self._new_topology.atoms())

for pidx in range(self.hybrid_system.getNumParticles()):
if pidx in self._hybrid_to_old_map:
idx = self._hybrid_to_old_map[pidx]
atom_list.append(list(self._old_topology.atoms())[idx])
atom_list.append(old_topology_atoms[idx])
else:
idx = self._hybrid_to_new_map[pidx]
atom_list.append(list(self._new_topology.atoms())[idx])
atom_list.append(new_topology_atoms[idx])

# Now we loop over the atoms and add them in alongside chains & resids

Expand Down
Loading