Skip to content

Commit

Permalink
Context reinitialisation is now handled by Sire.
Browse files Browse the repository at this point in the history
  • Loading branch information
lohedges committed Oct 18, 2024
1 parent def9309 commit f0347a7
Showing 1 changed file with 0 additions and 39 deletions.
39 changes: 0 additions & 39 deletions src/somd2/runner/_dynamics.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,18 +224,6 @@ def _setup_dynamics(self, equilibration=False):
map=self._config._extra_args,
)

# We now need to re-initialize the context so that the constraints
# are updated correctly.

# Get the current positions.
positions = self._dyn._d._omm_mols.getState(getPositions=True).getPositions()

# Reinitialize the context to update the constraints.
self._dyn._d._omm_mols.reinitialize()

# Set the positions.
self._dyn._d._omm_mols.setPositions(positions)

def _minimisation(
self, lambda_min=None, constraint="none", perturbable_constraint="none"
):
Expand Down Expand Up @@ -271,19 +259,6 @@ def _minimisation(
shift_delta=self._config.shift_delta,
map=self._config._extra_args,
)

# We now need to re-initialize the context so that the constraints
# are updated correctly.

# Get the current positions.
positions = m._d._omm_mols.getState(getPositions=True).getPositions()

# Reinitialize the context to update the constraints.
m._d._omm_mols.reinitialize()

# Set the positions.
m._d._omm_mols.setPositions(positions)

m.run(timeout=self._config.timeout)
self._system = m.commit()
except:
Expand All @@ -309,20 +284,6 @@ def _minimisation(
shift_delta=self._config.shift_delta,
map=self._config._extra_args,
)

# We now need to re-initialize the context so that the constraints
# are updated correctly.

# Get the current positions.
positions = m._d._omm_mols.getState(getPositions=True).getPositions()

# Reinitialize the context to update the constraints.
m._d._omm_mols.reinitialize()

# Set the positions.
m._d._omm_mols.setPositions(positions)

# Minimise and commit the changes.
m.run(timeout=self._config.timeout)
self._system = m.commit()
except:
Expand Down

0 comments on commit f0347a7

Please sign in to comment.