State Class Reference

A State object records a snapshot of the current state of a simulation at a point in time. More...

#include <State.h>

List of all members.

Public Types

enum  DataType {
  Positions = 1, Velocities = 2, Forces = 4, Energy = 8,
  Parameters = 16
}
 

This is an enumeration of the types of data which may be stored in a State.

More...

Public Member Functions

double getTime () const
 Get the time for which this State was created.
const std::vector< Vec3 > & getPositions () const
 Get the position of each particle.
const std::vector< Vec3 > & getVelocities () const
 Get the velocity of each particle.
const std::vector< Vec3 > & getForces () const
 Get the force acting on each particle.
double getKineticEnergy () const
 Get the total kinetic energy of the system.
double getPotentialEnergy () const
 Get the total potential energy of the system.
const std::map< std::string,
double > & 
getParameters () const
 Get a map containing the values of all parameters.

Friends

class Context

Detailed Description

A State object records a snapshot of the current state of a simulation at a point in time.

You create it by calling getState() on a Context.

When a State is created, you specify what information should be stored in it. This saves time and memory by only copying in the information that you actually want. This is especially important for forces and energies, since they may need to be calculated. If you query a State object for a piece of information which is not available (because it was not requested when the State was created), it will throw an exception.


Member Enumeration Documentation

enum DataType

This is an enumeration of the types of data which may be stored in a State.

When you create a State, use these values to specify which data types it should contain.

Enumerator:
Positions 
Velocities 
Forces 
Energy 
Parameters 

Member Function Documentation

const std::vector<Vec3>& getForces (  )  const

Get the force acting on each particle.

If this State does not contain forces, this will throw an exception.

double getKineticEnergy (  )  const

Get the total kinetic energy of the system.

If this State does not contain energies, this will throw an exception.

const std::map<std::string, double>& getParameters (  )  const

Get a map containing the values of all parameters.

If this State does not contain parameters, this will throw an exception.

const std::vector<Vec3>& getPositions (  )  const

Get the position of each particle.

If this State does not contain positions, this will throw an exception.

double getPotentialEnergy (  )  const

Get the total potential energy of the system.

If this State does not contain energies, this will throw an exception.

double getTime (  )  const

Get the time for which this State was created.

const std::vector<Vec3>& getVelocities (  )  const

Get the velocity of each particle.

If this State does not contain velocities, this will throw an exception.


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