ContextImpl Class Reference
This is the internal implementation of a Context.
More...
#include <ContextImpl.h>
List of all members.
Detailed Description
This is the internal implementation of a Context.
Constructor & Destructor Documentation
Member Function Documentation
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 |
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 |
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.
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
The documentation for this class was generated from the following file: