File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -310,6 +310,22 @@ def _create_dynamics(
310310 ):
311311 from openmm .unit import angstrom
312312
313+ # Get the positions from the context.
314+ positions = (
315+ dynamics .context ()
316+ .getState (getPositions = True )
317+ .getPositions (asNumpy = True )
318+ ) / angstrom
319+
320+ # The positions array also contains the ghost water atoms that
321+ # were added during the GCMC setup. We need to make sure that
322+ # we copy these over to the perturbed positions array.
323+ diff = len (positions ) - len (perturbed_positions )
324+ if diff != 0 :
325+ perturbed_positions = _np .concatenate (
326+ [perturbed_positions , positions [- diff :]]
327+ )
328+
313329 dynamics .context ().setPeriodicBoxVectors (* perturbed_box * angstrom )
314330 dynamics .context ().setPositions (perturbed_positions * angstrom )
315331
You can’t perform that action at this time.
0 commit comments