glotzmd::Simulation Class Reference
[Molecular Dynamics]

Implements a molecular dynamics (MD) - like simulation. More...

#include <Simulation.h>

Inheritance diagram for glotzmd::Simulation:

glotzsimapi::SimulationApi glotzmd::BaseObject glotzutil::Listable glotzutil::Serializable glotzlammps::Simulation

List of all members.

Public Member Functions

 Simulation ()
 Constructor.
 Simulation (const Simulation &)
 Copy constructor.
virtual SimulationClone ()
 Clone function.
virtual ~Simulation ()
 Destructor.
void operator++ (const int)
 Step the simulation forward one timestep.
void operator+= (const int)
 Step the simulation forward "n" timesteps.
void operator-- (const int)
 Step the simulation backward one timestep.
void operator-= (const int)
 Step the simulation backward n timesteps.
void StepForward (const int)
 Step the simulation forward "n" timesteps.
void StepBackward (const int)
 Step the simulation backward "n" timesteps.
void RescaleSystem (const glotz_flt)
void RescaleSystem (const glotz_vec)
void RescaleSystem (const glotz_flt, const glotz_flt, const glotz_flt)
void RescaleVelocities (const glotz_flt)
void InvertVelocities ()
void ZeroLinearMomentum ()
int Fail ()
 Get a boolean value indicating whether or not the simulation has failed.
void Save (const char *)
 Save the current state of the simulation.
void Restore (const char *)
 Restore the simulaiton from a previous state.
void Save ()
 Save the current state of the simulation.
void Load (const char *)
 Restore the simulaiton from a previous state.
void Serialize (glotzutil::Archive &)
virtual glotz_flt ComputePotentialEnergy ()
 Compute the system potential energy.
virtual glotz_flt ComputeKineticEnergy ()
 Compute the system kinetic energy.
virtual glotz_flt ComputeLinearKineticEnergy ()
 Compute kinetic energy from translation.
virtual glotz_flt ComputeAngularKineticEnergy ()
 Compute kinetic energy from rotation.
virtual glotz_flt ComputeVirial ()
 Compute the system viral.
virtual glotz_flt ComputeTemperature ()
 Compute the system temperature.
virtual glotz_flt ComputePressure ()
 Compute the system pressure.
virtual glotz_flt ComputeTotalEnergy ()
 Compute the system total energy.
virtual glotz_flt ComputeNumberDensity ()
 Compute the number density.
virtual glotz_flt ComputeVolumeFraction ()
 Compute the volume fraction.
virtual int ComputeDegreesOfFreedom ()
 Compute the system's degrees of freedom.
void AddParticle (Particle *)
 Add a new particle to the system.
void AddInteraction (const int, const int, Potential *)
 Add a new set of particle interactions to the system.
void AddSimulationModifier (SimulationModifier *)
 Add a new modifier the the simulation.
void RemoveParticle (Particle *)
 Remove an existing particle from the system.
void RemoveSimulationModifier (SimulationModifier *)
 Remove an existing modifier from the simulation.
void RemoveInteraction (Potential *)
 Remove an existing set of particle interactions from the system.
void SetForceRoutine (ForceRoutine *)
 Set the force calculation method.
void SetIntegrationScheme (IntegrationScheme *)
 Set the scheme used to integrate Newton's equations of motion.
void SetBoundaryConditions (BoundaryConditions *)
 Set the type of boundary conditions.
void SetUnits (Units *)
 Set the type of units (reduced, real, etc.).
void SetDimensions (const int)
 Set the number of dimensions.
void SetTimestep (const glotz_flt)
 Set the integration timestep.
void SetConfiguration (glotzdatasources::Lattice *)
 Set the initial configuration (requires datasources enabled).
BoundaryConditionsGetBoundaryConditions ()
 Get a pointer to the boundary conditions.
std::string GetEnsemble ()
 Get a string describing the ensmeble being sampled.
glotz_flt GetTargetTemperature ()
 Get thermostat temperature.
glotz_flt GetTargetPressure ()
 Get barostat pressure.
glotz_flt GetTimestep ()
 Get the size of the simulation timestep.
ErrorList GetErrorList ()
 Get the list of errors that the simulation has encountered.
ObjectListGetObjects ()
 Get a list of interacting objects.
ParticleListGetParticleList ()
 Get a list of particles.
BeadListGetBeadList ()
 Get a list of particles.
int GetNumberOfObjects ()
 Get the number of interacting objects.
int GetNumberOfBeads ()
 Get the number of beads.
int GetNumberOfParticles ()
 Get the number of particles.
int GetNumberOfRigidBodies ()
 Get the number of rigid bodies.
int GetNumberOfSprings ()
 Get the number of springs.
int GetDimensions ()
 Get the dimensionality.
int GetNumberOfSimulationModifiers ()
 Get the number of simulation modifiers.
int GetNumberOfPotentials ()
 Get the number of potentials.
int GetTimesteps ()
 Get the number of timesteps the simulation has performed.
void PrintPotentialEnergy (std::ostream &)
void PrintPotentialEnergies (std::ostream &)
void PrintPositions (std::ostream &)
void PrintVelocities (std::ostream &)
void PrintForces (std::ostream &)
void PrintVis3d (std::ostream &)
void PrintVis3dTemplate (std::ostream &)
void PrintParticles (std::ostream &, std::string &)
void PrintParticles (std::ostream &, const char *)

Public Attributes

ParticleList gParticle
 Global vector of particles.
ObjectList gInteractingObject
 Global vector of objects.
BeadList gBead
 Global vector of beads.
RigidBodyList gRigidBody
 Global vector of rigid bodies.
SpringList gSpring
 Global vector of springs.
PotentialMap gPotentialMap
 Global map of potentials.
PotentialList gPotential
 Global list of potentials.
SimulationModifierList gSimulationModifier
 Global map of simulation components.
ForceRoutinegForceRoutine
 Global pointer to the force routine.
IntegrationSchemegIntegrationScheme
 Global pointer to the integration scheme.
BoundaryConditionsgBoundaryConditions
 Global pointer to simulation boundary conditions.
UnitsgUnits
 Global pointer to the simulation units.
int gDimensions
 Simulation dimensions.
glotz_flt gTimestep
 Simulation timestep.
SimulationEventManagergEventManager
 Manages "events" or changes to the simulation.
BaseObjectList gBaseObject
 List of pointers to all objects (force routines, integrators, particles, etc.).

Protected Types

enum  { BACKWARD = -1, FORWARD = 1 }

Protected Member Functions

void FinalizeUnserialization ()
void CheckForErrors ()
 Check the simulation for errors.
void HandleEvents ()
 Handle Events.
virtual void OnEvent ()
 Perform when an event occurs.
void Timestep ()

Protected Attributes

int mDirectionOfTime
bool mIsFirstTimeVis3d
RigidBodyUpdatermRigidBodyUpdater
SimulationEvent mPossibleEvents
 A list of events that the simulation reacts to.


Detailed Description

Implements a molecular dynamics (MD) - like simulation.

Author:
Aaron Keys

Tony Sheh

Performs a molecular dynamics (MD) simulation. Can also perform Brownian Dynamics (BD) and Dissipative Particle Dynamics (DPD) simulations as well. For more information on simulation methods, see:

An MD Simulation needs several inputs in order to run.


Member Enumeration Documentation

anonymous enum [protected]

Enumerator:
BACKWARD 
FORWARD 


Constructor & Destructor Documentation

glotzmd::Simulation::Simulation (  ) 

Constructor.

Reimplemented in glotzlammps::Simulation.

glotzmd::Simulation::Simulation ( const Simulation rhs  ) 

Copy constructor.

glotzmd::Simulation::~Simulation (  )  [virtual]

Destructor.

Reimplemented in glotzlammps::Simulation.


Member Function Documentation

Simulation * glotzmd::Simulation::Clone (  )  [virtual]

Clone function.

Clone() creates a new simulation that is identical to the current one and returns a pointer to it. This type of routine is particularly useful when trying to run multiple parallel simulations (i.e. parallel tempering, replica exchange, etc.

Returns:
a pointer to a new identical simulation.

Reimplemented from glotzsimapi::SimulationApi.

Reimplemented in glotzlammps::Simulation.

void glotzmd::Simulation::operator++ ( const   int  )  [virtual]

Step the simulation forward one timestep.

Reimplemented from glotzsimapi::SimulationApi.

Reimplemented in glotzlammps::Simulation.

void glotzmd::Simulation::operator+= ( const   int  )  [virtual]

Step the simulation forward "n" timesteps.

Reimplemented from glotzsimapi::SimulationApi.

Reimplemented in glotzlammps::Simulation.

void glotzmd::Simulation::operator-- ( const   int  )  [virtual]

Step the simulation backward one timestep.

Reimplemented from glotzsimapi::SimulationApi.

Reimplemented in glotzlammps::Simulation.

void glotzmd::Simulation::operator-= ( const   int  )  [virtual]

Step the simulation backward n timesteps.

Reimplemented from glotzsimapi::SimulationApi.

Reimplemented in glotzlammps::Simulation.

void glotzmd::Simulation::StepForward ( const   int  )  [virtual]

Step the simulation forward "n" timesteps.

Parameters:
timesteps is the number of timesteps to integrate forward

Reimplemented from glotzsimapi::SimulationApi.

Reimplemented in glotzlammps::Simulation.

void glotzmd::Simulation::StepBackward ( const   int  )  [virtual]

Step the simulation backward "n" timesteps.

Reimplemented from glotzsimapi::SimulationApi.

Reimplemented in glotzlammps::Simulation.

void glotzmd::Simulation::RescaleSystem ( const   glotz_flt  ) 

void glotzmd::Simulation::RescaleSystem ( const   glotz_vec  ) 

void glotzmd::Simulation::RescaleSystem ( const   glotz_flt,
const   glotz_flt,
const   glotz_flt 
)

void glotzmd::Simulation::RescaleVelocities ( const   glotz_flt  ) 

void glotzmd::Simulation::InvertVelocities (  ) 

Reimplemented in glotzlammps::Simulation.

void glotzmd::Simulation::ZeroLinearMomentum (  ) 

int glotzmd::Simulation::Fail (  ) 

Get a boolean value indicating whether or not the simulation has failed.

Returns:
the error code if there is an error, zero otherwise

void glotzmd::Simulation::Save ( const char *  filename  ) 

Save the current state of the simulation.

Parameters:
filename is the filename to save the simulation to

void glotzmd::Simulation::Restore ( const char *  filename  ) 

Restore the simulaiton from a previous state.

Parameters:
filename is the filename to load the simulation from

void glotzmd::Simulation::Save (  ) 

Save the current state of the simulation.

Save to default filename

void glotzmd::Simulation::Load ( const char *  filename  ) 

Restore the simulaiton from a previous state.

Parameters:
filename is the filename to load the simulation from

void glotzmd::Simulation::Serialize ( glotzutil::Archive ar  )  [virtual]

Reimplemented from glotzutil::Serializable.

glotz_flt glotzmd::Simulation::ComputePotentialEnergy (  )  [virtual]

Compute the system potential energy.

Reimplemented in glotzlammps::Simulation.

glotz_flt glotzmd::Simulation::ComputeKineticEnergy (  )  [virtual]

Compute the system kinetic energy.

Reimplemented in glotzlammps::Simulation.

glotz_flt glotzmd::Simulation::ComputeLinearKineticEnergy (  )  [virtual]

Compute kinetic energy from translation.

glotz_flt glotzmd::Simulation::ComputeAngularKineticEnergy (  )  [virtual]

Compute kinetic energy from rotation.

glotz_flt glotzmd::Simulation::ComputeVirial (  )  [virtual]

Compute the system viral.

glotz_flt glotzmd::Simulation::ComputeTemperature (  )  [virtual]

Compute the system temperature.

Reimplemented in glotzlammps::Simulation.

glotz_flt glotzmd::Simulation::ComputePressure (  )  [virtual]

Compute the system pressure.

Reimplemented in glotzlammps::Simulation.

glotz_flt glotzmd::Simulation::ComputeTotalEnergy (  )  [virtual]

Compute the system total energy.

Reimplemented in glotzlammps::Simulation.

glotz_flt glotzmd::Simulation::ComputeNumberDensity (  )  [virtual]

Compute the number density.

glotz_flt glotzmd::Simulation::ComputeVolumeFraction (  )  [virtual]

Compute the volume fraction.

int glotzmd::Simulation::ComputeDegreesOfFreedom (  )  [virtual]

Compute the system's degrees of freedom.

void glotzmd::Simulation::AddParticle ( Particle particle  ) 

Add a new particle to the system.

Parameters:
particle is the particle to be added

void glotzmd::Simulation::AddInteraction ( const   int,
const   int,
Potential potential 
)

Add a new set of particle interactions to the system.

Parameters:
type1 is one of the interacting types
type2 is one of the interacting types
potential is the potential function describing the interaction

void glotzmd::Simulation::AddSimulationModifier ( SimulationModifier mod  ) 

Add a new modifier the the simulation.

Parameters:
mod is the modifier to be added

void glotzmd::Simulation::RemoveParticle ( Particle particle  ) 

Remove an existing particle from the system.

Parameters:
particle is the particle to be removed

void glotzmd::Simulation::RemoveSimulationModifier ( SimulationModifier mod  ) 

Remove an existing modifier from the simulation.

Parameters:
mod is the modifier to remove

void glotzmd::Simulation::RemoveInteraction ( Potential potential  ) 

Remove an existing set of particle interactions from the system.

Parameters:
potential is the potential function to be removed

void glotzmd::Simulation::SetForceRoutine ( ForceRoutine forceRoutine  ) 

Set the force calculation method.

Parameters:
forceRoutine is the force routine that the simulation will use

void glotzmd::Simulation::SetIntegrationScheme ( IntegrationScheme integrationScheme  ) 

Set the scheme used to integrate Newton's equations of motion.

Parameters:
integrationScheme is the integration scheme that the simulation will use

void glotzmd::Simulation::SetBoundaryConditions ( BoundaryConditions boundaryConditions  ) 

Set the type of boundary conditions.

Parameters:
boundaryConditions is the set of boundary conditions that the simulation will use

void glotzmd::Simulation::SetUnits ( Units units  ) 

Set the type of units (reduced, real, etc.).

Parameters:
units is the unit system used for printing data

void glotzmd::Simulation::SetDimensions ( const   int  ) 

Set the number of dimensions.

Note:
This routine currently does not do anything, needs to have an effect on integrators -TS

void glotzmd::Simulation::SetTimestep ( const   glotz_flt  ) 

Set the integration timestep.

Parameters:
timestep is the integration timestep

void glotzmd::Simulation::SetConfiguration ( glotzdatasources::Lattice datasource  ) 

Set the initial configuration (requires datasources enabled).

BoundaryConditions * glotzmd::Simulation::GetBoundaryConditions (  ) 

Get a pointer to the boundary conditions.

std::string glotzmd::Simulation::GetEnsemble (  ) 

Get a string describing the ensmeble being sampled.

glotz_flt glotzmd::Simulation::GetTargetTemperature (  ) 

Get thermostat temperature.

glotz_flt glotzmd::Simulation::GetTargetPressure (  ) 

Get barostat pressure.

glotz_flt glotzmd::Simulation::GetTimestep (  ) 

Get the size of the simulation timestep.

ErrorList glotzmd::Simulation::GetErrorList (  ) 

Get the list of errors that the simulation has encountered.

Returns:
list of error codes

ObjectList & glotzmd::Simulation::GetObjects (  ) 

Get a list of interacting objects.

ParticleList & glotzmd::Simulation::GetParticleList (  ) 

Get a list of particles.

BeadList & glotzmd::Simulation::GetBeadList (  ) 

Get a list of particles.

int glotzmd::Simulation::GetNumberOfObjects (  ) 

Get the number of interacting objects.

int glotzmd::Simulation::GetNumberOfBeads (  ) 

Get the number of beads.

int glotzmd::Simulation::GetNumberOfParticles (  ) 

Get the number of particles.

int glotzmd::Simulation::GetNumberOfRigidBodies (  ) 

Get the number of rigid bodies.

int glotzmd::Simulation::GetNumberOfSprings (  ) 

Get the number of springs.

Returns:
the total number of springs (bonds) in the simulation

int glotzmd::Simulation::GetDimensions (  ) 

Get the dimensionality.

int glotzmd::Simulation::GetNumberOfSimulationModifiers (  ) 

Get the number of simulation modifiers.

int glotzmd::Simulation::GetNumberOfPotentials (  ) 

Get the number of potentials.

int glotzmd::Simulation::GetTimesteps (  )  [virtual]

Get the number of timesteps the simulation has performed.

Reimplemented from glotzsimapi::SimulationApi.

void glotzmd::Simulation::PrintPotentialEnergy ( std::ostream &  os  ) 

Reimplemented in glotzlammps::Simulation.

void glotzmd::Simulation::PrintPotentialEnergies ( std::ostream &  os  ) 

void glotzmd::Simulation::PrintPositions ( std::ostream &  os  ) 

void glotzmd::Simulation::PrintVelocities ( std::ostream &  os  ) 

void glotzmd::Simulation::PrintForces ( std::ostream &  os  ) 

void glotzmd::Simulation::PrintVis3d ( std::ostream &  os  ) 

void glotzmd::Simulation::PrintVis3dTemplate ( std::ostream &  os  ) 

void glotzmd::Simulation::PrintParticles ( std::ostream &  os,
std::string &  format 
)

void glotzmd::Simulation::PrintParticles ( std::ostream &  os,
const char *  format 
)

void glotzmd::Simulation::FinalizeUnserialization (  )  [protected]

void glotzmd::Simulation::CheckForErrors (  )  [protected]

Check the simulation for errors.

Prints error messages to the screen.

void glotzmd::Simulation::HandleEvents (  )  [protected]

Handle Events.

void glotzmd::Simulation::OnEvent (  )  [protected, virtual]

Perform when an event occurs.

Reimplemented from glotzmd::BaseObject.

void glotzmd::Simulation::Timestep (  )  [protected]


Member Data Documentation

ParticleList glotzmd::Simulation::gParticle

Global vector of particles.

ObjectList glotzmd::Simulation::gInteractingObject

Global vector of objects.

BeadList glotzmd::Simulation::gBead

Global vector of beads.

RigidBodyList glotzmd::Simulation::gRigidBody

Global vector of rigid bodies.

SpringList glotzmd::Simulation::gSpring

Global vector of springs.

PotentialMap glotzmd::Simulation::gPotentialMap

Global map of potentials.

PotentialList glotzmd::Simulation::gPotential

Global list of potentials.

SimulationModifierList glotzmd::Simulation::gSimulationModifier

Global map of simulation components.

ForceRoutine* glotzmd::Simulation::gForceRoutine

Global pointer to the force routine.

IntegrationScheme* glotzmd::Simulation::gIntegrationScheme

Global pointer to the integration scheme.

BoundaryConditions* glotzmd::Simulation::gBoundaryConditions

Global pointer to simulation boundary conditions.

Units* glotzmd::Simulation::gUnits

Global pointer to the simulation units.

int glotzmd::Simulation::gDimensions

Simulation dimensions.

glotz_flt glotzmd::Simulation::gTimestep

Simulation timestep.

SimulationEventManager* glotzmd::Simulation::gEventManager

Manages "events" or changes to the simulation.

BaseObjectList glotzmd::Simulation::gBaseObject

List of pointers to all objects (force routines, integrators, particles, etc.).

int glotzmd::Simulation::mDirectionOfTime [protected]

bool glotzmd::Simulation::mIsFirstTimeVis3d [protected]

RigidBodyUpdater* glotzmd::Simulation::mRigidBodyUpdater [protected]

SimulationEvent glotzmd::Simulation::mPossibleEvents [protected]

A list of events that the simulation reacts to.


The documentation for this class was generated from the following files:
Generated on Tue Feb 24 20:54:30 2009 by  doxygen 1.5.3