Commit 71971ba6 authored by Peter Eastman's avatar Peter Eastman
Browse files

Added a getForces() method to System. Also fixed some formatting errors in Doxygen comments.

parent 79e37b50
...@@ -37,13 +37,15 @@ ...@@ -37,13 +37,15 @@
groups = -1) groups = -1)
-> State -> State
Get a State object recording the current state information stored in this context. Get a State object recording the current state information stored in this context.
getPositions -- whether to store particle positions in the State
getVelocities -- whether to store particle velocities in the State Parameters:
getForces -- whether to store the forces acting on particles in the State - getPositions (bool=False) whether to store particle positions in the State
getEnergy -- whether to store potential and kinetic energy in the State - getVelocities (bool=False) whether to store particle velocities in the State
getParameter -- whether to store context parameters in the State - getForces (bool=False) whether to store the forces acting on particles in the State
enforcePeriodicBox -- if false, the position of each particle will be whatever position is stored in the Context, regardless of periodic boundary conditions. If true, particle positions will be translated so the center of every molecule lies in the same periodic box. - getEnergy (bool=False) whether to store potential and kinetic energy in the State
groups -- a set of bit flags for which force groups to include when computing forces and energies. Group i will be included if (groups&(1<<i)) != 0. The default value includes all groups. - getParameter (bool=False) whether to store context parameters in the State
- enforcePeriodicBox (bool=False) if false, the position of each particle will be whatever position is stored in the Context, regardless of periodic boundary conditions. If true, particle positions will be translated so the center of every molecule lies in the same periodic box.
- groups (int=-1) a set of bit flags for which force groups to include when computing forces and energies. Group i will be included if (groups&(1<<i)) != 0. The default value includes all groups.
""" """
if getPositions: getP=1 if getPositions: getP=1
...@@ -227,6 +229,9 @@ Parameters: ...@@ -227,6 +229,9 @@ Parameters:
def __setstate__(self, serializationString): def __setstate__(self, serializationString):
system = XmlSerializer.deserializeSystem(serializationString) system = XmlSerializer.deserializeSystem(serializationString)
self.this = system.this self.this = system.this
def getForces(self):
"""Get the list of Forces in this System"""
return [self.getForce(i) for i in range(self.getNumForces())]
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment