|
| System () |
| Create a new System. More...
|
|
| ~System () |
|
int | getNumParticles () const |
| Get the number of particles in this System. More...
|
|
int | addParticle (double mass) |
| Add a particle to the System. More...
|
|
double | getParticleMass (int index) const |
| Get the mass (in atomic mass units) of a particle. More...
|
|
void | setParticleMass (int index, double mass) |
| Set the mass (in atomic mass units) of a particle. More...
|
|
void | setVirtualSite (int index, VirtualSite *virtualSite) |
| Set a particle to be a virtual site. More...
|
|
bool | isVirtualSite (int index) const |
| Get whether a particle is a VirtualSite. More...
|
|
const VirtualSite & | getVirtualSite (int index) const |
| Get VirtualSite object for a particle. More...
|
|
int | getNumConstraints () const |
| Get the number of distance constraints in this System. More...
|
|
int | addConstraint (int particle1, int particle2, double distance) |
| Add a constraint to the System. More...
|
|
void | getConstraintParameters (int index, int &particle1, int &particle2, double &distance) const |
| Get the parameters defining a distance constraint. More...
|
|
void | setConstraintParameters (int index, int particle1, int particle2, double distance) |
| Set the parameters defining a distance constraint. More...
|
|
int | addForce (Force *force) |
| Add a Force to the System. More...
|
|
int | getNumForces () const |
| Get the number of Force objects that have been added to the System. More...
|
|
const Force & | getForce (int index) const |
| Get a const reference to one of the Forces in this System. More...
|
|
Force & | getForce (int index) |
| Get a writable reference to one of the Forces in this System. More...
|
|
void | getDefaultPeriodicBoxVectors (Vec3 &a, Vec3 &b, Vec3 &c) const |
| Get the default values of the vectors defining the axes of the periodic box (measured in nm). More...
|
|
void | setDefaultPeriodicBoxVectors (const Vec3 &a, const Vec3 &b, const Vec3 &c) |
| Set the default values of the vectors defining the axes of the periodic box (measured in nm). More...
|
|
This class represents a molecular system.
The definition of a System involves four elements:
-
The set of particles in the system
-
The forces acting on them
-
Pairs of particles whose separation should be constrained to a fixed value
-
For periodic systems, the dimensions of the periodic box
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.
void getDefaultPeriodicBoxVectors |
( |
Vec3 & |
a, |
|
|
Vec3 & |
b, |
|
|
Vec3 & |
c |
|
) |
| const |
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.
Currently, only rectangular boxes are supported. This means that a, b, and c must be aligned with the x, y, and z axes respectively. Future releases may support arbitrary triclinic boxes.
- Parameters
-
a | on exit, this contains the vector defining the first edge of the periodic box |
b | on exit, this contains the vector defining the second edge of the periodic box |
c | on exit, this contains the vector defining the third edge of the periodic box |
void setDefaultPeriodicBoxVectors |
( |
const Vec3 & |
a, |
|
|
const Vec3 & |
b, |
|
|
const Vec3 & |
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.
Currently, only rectangular boxes are supported. This means that a, b, and c must be aligned with the x, y, and z axes respectively. Future releases may support arbitrary triclinic boxes.
- Parameters
-
a | the vector defining the first edge of the periodic box |
b | the vector defining the second edge of the periodic box |
c | the vector defining the third edge of the periodic box |