ContextImpl Class Reference

This is the internal implementation of a Context. More...

#include <ContextImpl.h>

List of all members.

Public Member Functions

 ContextImpl (Context &owner, System &system, Integrator &integrator, Platform *platform, const std::map< std::string, std::string > &properties)
 Create an ContextImpl for a Context;.
 ~ContextImpl ()
ContextgetOwner ()
 Get the Context for which this is the implementation.
SystemgetSystem ()
 Get System being simulated in this context.
IntegratorgetIntegrator ()
 Get Integrator being used to by this context.
PlatformgetPlatform ()
 Get the Platform implementation being used for computations.
double getTime () const
 Get the current time (in picoseconds).
void setTime (double t)
 Set the current time (in picoseconds).
void getPositions (std::vector< Vec3 > &positions)
 Get the positions of all particles.
void setPositions (const std::vector< Vec3 > &positions)
 Set the positions of all particles.
void getVelocities (std::vector< Vec3 > &velocities)
 Get the velocities of all particles.
void setVelocities (const std::vector< Vec3 > &velocities)
 Set the velocities of all particles.
void getForces (std::vector< Vec3 > &forces)
 Get the current forces on all particles.
double getParameter (std::string name)
 Get the value of an adjustable parameter.
void setParameter (std::string name, double value)
 Set the value of an adjustable parameter.
void calcForces ()
 Recalculate all of the forces in the system.
double calcKineticEnergy ()
 Calculate the kinetic energy of the system (in kJ/mol).
double calcPotentialEnergy ()
 Calculate the potential energy of the system (in kJ/mol).
void updateContextState ()
 This should be called at the start of each time step.
void * getPlatformData ()
 Get the platform-specific data stored in this context.
const void * getPlatformData () const
 Get the platform-specific data stored in this context.
void setPlatformData (void *data)
 Set the platform-specific data stored in this context.

Friends

class Context

Detailed Description

This is the internal implementation of a Context.


Constructor & Destructor Documentation

ContextImpl ( Context owner,
System system,
Integrator integrator,
Platform platform,
const std::map< std::string, std::string > &  properties 
)

Create an ContextImpl for a Context;.

~ContextImpl (  ) 

Member Function Documentation

void calcForces (  ) 

Recalculate all of the forces in the system.

After calling this, use getForces() to retrieve the forces that were calculated.

double calcKineticEnergy (  ) 

Calculate the kinetic energy of the system (in kJ/mol).

double calcPotentialEnergy (  ) 

Calculate the potential energy of the system (in kJ/mol).

void getForces ( std::vector< Vec3 > &  forces  ) 

Get the current forces on all particles.

Parameters:
forces on exit, this contains the forces
Integrator& getIntegrator (  )  [inline]

Get Integrator being used to by this context.

Context& getOwner (  )  [inline]

Get the Context for which this is the implementation.

double getParameter ( std::string  name  ) 

Get the value of an adjustable parameter.

If there is no parameter with the specified name, this throws an exception.

Parameters:
name the name of the parameter to get
Platform& getPlatform (  )  [inline]

Get the Platform implementation being used for computations.

const void* getPlatformData (  )  const

Get the platform-specific data stored in this context.

void* getPlatformData (  ) 

Get the platform-specific data stored in this context.

void getPositions ( std::vector< Vec3 > &  positions  ) 

Get the positions of all particles.

Parameters:
positions on exit, this contains the particle positions
System& getSystem (  )  [inline]

Get System being simulated in this context.

double getTime (  )  const

Get the current time (in picoseconds).

void getVelocities ( std::vector< Vec3 > &  velocities  ) 

Get the velocities of all particles.

Parameters:
velocities on exit, this contains the particle velocities
void setParameter ( std::string  name,
double  value 
)

Set the value of an adjustable parameter.

If there is no parameter with the specified name, this throws an exception.

Parameters:
name the name of the parameter to set
value the value of the parameter
void setPlatformData ( void *  data  ) 

Set the platform-specific data stored in this context.

void setPositions ( const std::vector< Vec3 > &  positions  ) 

Set the positions of all particles.

Parameters:
positions a vector containg the particle positions
void setTime ( double  t  ) 

Set the current time (in picoseconds).

void setVelocities ( const std::vector< Vec3 > &  velocities  ) 

Set the velocities of all particles.

Parameters:
velocities a vector containg the particle velocities
void updateContextState (  ) 

This should be called at the start of each time step.

It calls updateContextState() on each ForceImpl in the system, allowing them to modify the values of state variables.


Friends And Related Function Documentation

friend class Context [friend]

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

Generated by  doxygen 1.6.2