System Class Reference

This class represents a molecular system. More...

#include <System.h>

List of all members.

Classes

class  ConstraintInfo
 This is an internal class used to record information about a constraint.

Public Member Functions

 System ()
 Create a new System.
 ~System ()
int getNumParticles () const
 Get the number of particles in this System.
int addParticle (double mass)
 Add a particle to the System.
double getParticleMass (int index) const
 Get the mass (in atomic mass units) of a particle.
void setParticleMass (int index, double mass)
 Set the mass (in atomic mass units) of a particle.
int getNumConstraints () const
 Get the number of distance constraints in this System.
int addConstraint (int particle1, int particle2, double distance)
 Add a constraint to the System.
void getConstraintParameters (int index, int &particle1, int &particle2, double &distance) const
 Get the parameters defining a distance constraint.
void setConstraintParameters (int index, int particle1, int particle2, double distance)
 Set the parameters defining a distance constraint.
int addForce (Force *force)
 Add a Force to the System.
int getNumForces () const
 Get the number of Force objects that have been added to the System.
const ForcegetForce (int index) const
 Get a const reference to one of the Forces in this System.
ForcegetForce (int index)
 Get a writable reference to one of the Forces in this System.
void getPeriodicBoxVectors (Vec3 &a, Vec3 &b, Vec3 &c) const
 Get the vectors which define the axes of the periodic box (measured in nm).
void setPeriodicBoxVectors (Vec3 a, Vec3 b, Vec3 c)
 Set the vectors which define the axes of the periodic box (measured in nm).

Detailed Description

This class represents a molecular system.

The definition of a System involves four elements:

  1. The set of particles in the system
  2. The forces acting on them
  3. Pairs of particles whose separation should be constrained to a fixed value
  4. 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.


Constructor & Destructor Documentation

System (  ) 

Create a new System.

~System (  ) 

Member Function Documentation

int addConstraint ( int  particle1,
int  particle2,
double  distance 
)

Add a constraint to the System.

Parameters:
particle1 the index of the first particle involved in the constraint
particle2 the index of the second particle involved in the constraint
distance the required distance between the two particles, measured in nm
Returns:
the index of the constraint that was added
int addForce ( Force force  )  [inline]

Add a Force to the System.

The Force should have been created on the heap with the "new" operator. The System takes over ownership of it, and deletes the Force when the System itself is deleted.

Parameters:
force a pointer to the Force object to be added
Returns:
the index within the System of the Force that was added
int addParticle ( double  mass  )  [inline]

Add a particle to the System.

Parameters:
mass the mass of the particle (in atomic mass units)
Returns:
the index of the particle that was added
void getConstraintParameters ( int  index,
int &  particle1,
int &  particle2,
double &  distance 
) const

Get the parameters defining a distance constraint.

Parameters:
index the index of the constraint for which to get parameters
particle1 the index of the first particle involved in the constraint
particle2 the index of the second particle involved in the constraint
distance the required distance between the two particles, measured in nm
Force& getForce ( int  index  )  [inline]

Get a writable reference to one of the Forces in this System.

Parameters:
index the index of the Force to get
const Force& getForce ( int  index  )  const [inline]

Get a const reference to one of the Forces in this System.

Parameters:
index the index of the Force to get
int getNumConstraints (  )  const [inline]

Get the number of distance constraints in this System.

int getNumForces (  )  const [inline]

Get the number of Force objects that have been added to the System.

int getNumParticles (  )  const [inline]

Get the number of particles in this System.

double getParticleMass ( int  index  )  const [inline]

Get the mass (in atomic mass units) of a particle.

Parameters:
index the index of the particle for which to get the mass
void getPeriodicBoxVectors ( Vec3 a,
Vec3 b,
Vec3 c 
) const

Get the vectors which define the axes of the periodic box (measured in nm).

These 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 setConstraintParameters ( int  index,
int  particle1,
int  particle2,
double  distance 
)

Set the parameters defining a distance constraint.

Parameters:
index the index of the constraint for which to set parameters
particle1 the index of the first particle involved in the constraint
particle2 the index of the second particle involved in the constraint
distance the required distance between the two particles, measured in nm
void setParticleMass ( int  index,
double  mass 
) [inline]

Set the mass (in atomic mass units) of a particle.

Parameters:
index the index of the particle for which to set the mass
mass the mass of the particle
void setPeriodicBoxVectors ( Vec3  a,
Vec3  b,
Vec3  c 
)

Set the vectors which define the axes of the periodic box (measured in nm).

These 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

The documentation for this class was generated from the following file:

Generated by  doxygen 1.6.2