.Simulation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
Public Member Functions | Friends | List of all members
MDSimulation::Simulation Class Reference

The Simulation class is the environment in which the simulation occurs. More...

#include <Simulation.h>

Public Member Functions

 Simulation (const InfoStruct &info, const std::string &outDir="", const bool save=true)
 A templatized version of the constructor that takes a particle factory as a type. More...
 
void PurgeEvents ()
 Prints all the events in the calendar to standard out if we are in debug mode.
 
bool HasRebounded () const
 Returns whether or not the bubble wall has rebounded yet. More...
 
EventType NextStep ()
 Advance the simulation by one step. More...
 
std::vector< Particle >
::const_iterator 
begin ()
 Beginning iterator for the particles in the system. More...
 
std::vector< Particle >
::const_iterator 
end ()
 Ending iterator used to determine the stopping criteria for the particle iterator.
 
double GetCurrentTime () const
 
unsigned long long GetCollisionCount () const
 Get the collision count from the simulation.
 
unsigned long long GetCellCrossingCount () const
 Get the number of cell crossing events so far.
 
unsigned long long GetWallCollisionCount () const
 Get the number of cell wall events so far.
 
unsigned long long GetConeBoundaryCount () const
 Get the number of cone boundary events so far.
 
template<typename Writer >
void Serialize (Writer &writer) const
 Serialize the simulation to the writer being given.
 
int GetParticleCount () const
 Get the current number of particles in the system.
 

Friends

std::ostream & operator<< (std::ostream &stream, const Simulation &sim)
 

Detailed Description

The Simulation class is the environment in which the simulation occurs.

It internally tracks all of the relevant information to the system and provides an interface for accessing this information for analysis purposes.

Constructor & Destructor Documentation

MDSimulation::Simulation::Simulation ( const InfoStruct info,
const std::string &  outDir = "",
const bool  save = true 
)
explicit

A templatized version of the constructor that takes a particle factory as a type.

This makes it fairly easy to swap out particle generators for testing purposes.

Parameters
infoThe info struct providing needed constants and other configurable parameters of the simulation.
outDirThe path where generated output will be saved to.
nThe number of particle to generate.

Member Function Documentation

std::vector< Particle >::const_iterator MDSimulation::Simulation::begin ( )

Beginning iterator for the particles in the system.

This is just a standard iterator over a vector of particles.

double MDSimulation::Simulation::GetCurrentTime ( ) const
Returns
The current time in simulation units. Mostly just to view the progress of the simulation.
bool MDSimulation::Simulation::HasRebounded ( ) const

Returns whether or not the bubble wall has rebounded yet.

This is useful for determining when to stop advancing the simulation.

Returns
True if the bubble wall has rebounded, otherwise false.
EventType MDSimulation::Simulation::NextStep ( )

Advance the simulation by one step.

This mean executing one event and then updating the calendar and cell list appropriately.


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