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