OpenMM
|
This class represents a molecular system. More...
Inherits _object.
Public Member Functions | |
def | getNumParticles |
getNumParticles(self) -> int | |
def | addParticle |
addParticle(self, mass) -> int | |
def | getParticleMass |
getParticleMass(self, index) -> double | |
def | setParticleMass |
Set the mass (in atomic mass units) of a particle. | |
def | setVirtualSite |
Set a particle to be a virtual site. | |
def | isVirtualSite |
isVirtualSite(self, index) -> bool | |
def | getVirtualSite |
getVirtualSite(self, index) -> VirtualSite | |
def | getNumConstraints |
getNumConstraints(self) -> int | |
def | addConstraint |
addConstraint(self, particle1, particle2, distance) -> int | |
def | getConstraintParameters |
Get the parameters defining a distance constraint. | |
def | setConstraintParameters |
Set the parameters defining a distance constraint. | |
def | removeConstraint |
Remove a constraint from the System. | |
def | addForce |
addForce(self, force) -> int | |
def | getNumForces |
getNumForces(self) -> int | |
def | getForce |
getForce(self, index) -> Force getForce(self, index) -> Force | |
def | removeForce |
Remove a Force from the System. | |
def | getDefaultPeriodicBoxVectors |
Get the default values of the vectors defining the axes of the periodic box (measured in nm). | |
def | setDefaultPeriodicBoxVectors |
Set the default values of the vectors defining the axes of the periodic box (measured in nm). | |
def | usesPeriodicBoundaryConditions |
usesPeriodicBoundaryConditions(self) -> bool | |
def | __getstate__ |
def | __setstate__ |
def | __deepcopy__ |
def | getForces |
Get the list of Forces in this System. | |
def | __copy__ |
__copy__(self) -> System | |
def | __init__ |
__init__(self) -> System __init__(self, other) -> System | |
Public Attributes | |
this |
This class represents a molecular system.
The definition of a System involves four elements:
The particles and constraints are defined directly by the System object, while forces are defined by objects that extend the Force class. After creating a System, call addParticle() once for each particle, addConstraint() for each constraint, and addForce() for each Force.
In addition, particles may be designated as "virtual sites". These are particles whose positions are computed automatically based on the positions of other particles. To define a virtual site, call setVirtualSite(), passing in a VirtualSite object that defines the rules for computing its position.
def __init__ | ( | self, | |
args | |||
) |
def __deepcopy__ | ( | self, | |
memo | |||
) |
def __getstate__ | ( | self | ) |
def __setstate__ | ( | self, | |
serializationString | |||
) |
def addConstraint | ( | self, | |
particle1, | |||
particle2, | |||
distance | |||
) |
addConstraint(self, particle1, particle2, distance) -> int
Add a constraint to the System. Particles whose mass is 0 cannot participate in constraints.
particle1 | (int) the index of the first particle involved in the constraint |
particle2 | (int) the index of the second particle involved in the constraint |
distance | (double) the required distance between the two particles, measured in nm |
def addForce | ( | self, | |
force | |||
) |
def addParticle | ( | self, | |
mass | |||
) |
addParticle(self, mass) -> int
Add a particle to the System. If the mass is 0, Integrators will ignore the particle and not modify its position or velocity. This is most often used for virtual sites, but can also be used as a way to prevent a particle from moving.
mass | (double) the mass of the particle (in atomic mass units) |
def getConstraintParameters | ( | self, | |
index | |||
) |
Get the parameters defining a distance constraint.
index | (int) the index of the constraint for which to get parameters |
def getDefaultPeriodicBoxVectors | ( | self | ) |
Get the default values of the vectors defining the axes of the periodic box (measured in nm).
Any newly created Context will have its box vectors set to these. They will affect any Force added to the System that uses periodic boundary conditions.
def getForce | ( | self, | |
args | |||
) |
def getNumConstraints | ( | self | ) |
getNumConstraints(self) -> int
Get the number of distance constraints in this System.
def getNumForces | ( | self | ) |
def getNumParticles | ( | self | ) |
getNumParticles(self) -> int
Get the number of particles in this System.
def getParticleMass | ( | self, | |
index | |||
) |
getParticleMass(self, index) -> double
Get the mass (in atomic mass units) of a particle. If the mass is 0, Integrators will ignore the particle and not modify its position or velocity. This is most often used for virtual sites, but can also be used as a way to prevent a particle from moving.
index | (int) the index of the particle for which to get the mass |
def getVirtualSite | ( | self, | |
index | |||
) |
getVirtualSite(self, index) -> VirtualSite
Get VirtualSite object for a particle. If the particle is not a virtual site, this throws an exception.
index | (int) the index of the particle to get |
def isVirtualSite | ( | self, | |
index | |||
) |
isVirtualSite(self, index) -> bool
Get whether a particle is a VirtualSite.
index | (int) the index of the particle to check |
def removeConstraint | ( | self, | |
index | |||
) |
Remove a constraint from the System.
index | (int) the index of the constraint to remove |
def removeForce | ( | self, | |
index | |||
) |
def setConstraintParameters | ( | self, | |
index, | |||
particle1, | |||
particle2, | |||
distance | |||
) |
Set the parameters defining a distance constraint.
Particles whose mass is 0 cannot participate in constraints.
index | (int) the index of the constraint for which to set parameters |
particle1 | (int) the index of the first particle involved in the constraint |
particle2 | (int) the index of the second particle involved in the constraint |
distance | (double) the required distance between the two particles, measured in nm |
def setDefaultPeriodicBoxVectors | ( | self, | |
a, | |||
b, | |||
c | |||
) |
Set the default values of the vectors defining the axes of the periodic box (measured in nm).
Any newly created Context will have its box vectors set to these. They will affect any Force added to the System that uses periodic boundary conditions.
Triclinic boxes are supported, but the vectors must satisfy certain requirements. In particular, a must point in the x direction, b must point "mostly" in the y direction, and c must point "mostly" in the z direction. See the documentation for details.
a | (Vec3) the vector defining the first edge of the periodic box |
b | (Vec3) the vector defining the second edge of the periodic box |
c | (Vec3) the vector defining the third edge of the periodic box |
def setParticleMass | ( | self, | |
index, | |||
mass | |||
) |
Set the mass (in atomic mass units) of a particle.
If the mass is 0, Integrators will ignore the particle and not modify its position or velocity. This is most often used for virtual sites, but can also be used as a way to prevent a particle from moving.
index | (int) the index of the particle for which to set the mass |
mass | (double) the mass of the particle |
def setVirtualSite | ( | self, | |
index, | |||
virtualSite | |||
) |
Set a particle to be a virtual site.
The VirtualSite object should have been created on the heap with the "new" operator. The System takes over ownership of it, and deletes it when the System itself is deleted.
index | (int) the index of the particle that should be treated as a virtual site |
virtualSite | (VirtualSite *) a pointer to the VirtualSite object describing it |
def usesPeriodicBoundaryConditions | ( | self | ) |
usesPeriodicBoundaryConditions(self) -> bool
Returns whether or not any forces in this System use periodic boundaries.
If a force in this System does not implement usesPeriodicBoundaryConditions a OpenMM::OpenMMException is thrown